From 701668b02d999af42f51d8bd25fffb2a8692c3c8 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 16 Feb 2024 22:31:29 +0000 Subject: refactor: rename PR to proposal PR is a problematic term when it ambiguous whether the set of patches are PR-like or email-patch like. --- src/sub_commands/pull.rs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/sub_commands/pull.rs') diff --git a/src/sub_commands/pull.rs b/src/sub_commands/pull.rs index fc6db37..de078e3 100644 --- a/src/sub_commands/pull.rs +++ b/src/sub_commands/pull.rs @@ -9,7 +9,8 @@ use crate::{ git::{Repo, RepoActions}, repo_ref, sub_commands::{ - list::get_most_recent_patch_with_ancestors, push::fetch_pr_and_most_recent_patch_chain, + list::get_most_recent_patch_with_ancestors, + push::fetch_proposal_root_and_most_recent_patch_chain, }, }; @@ -29,7 +30,7 @@ pub async fn launch() -> Result<()> { .context("cannot get checked out branch name")?; if branch_name == main_or_master_branch_name { - bail!("checkout a branch associated with a PR first") + bail!("checkout a branch associated with a proposal first") } #[cfg(not(test))] let client = Client::default(); @@ -44,19 +45,23 @@ pub async fn launch() -> Result<()> { ) .await?; - let (_pr_event, commit_events) = - fetch_pr_and_most_recent_patch_chain(&client, &repo_ref, &root_commit, &branch_name) - .await?; + let (_proposal_root_event, commit_events) = fetch_proposal_root_and_most_recent_patch_chain( + &client, + &repo_ref, + &root_commit, + &branch_name, + ) + .await?; if git_repo.has_outstanding_changes()? { bail!("cannot pull changes when repository is not clean. discard changes and try again."); } - let most_recent_pr_patch_chain = get_most_recent_patch_with_ancestors(commit_events) - .context("cannot get most recent patch for PR")?; + let most_recent_proposal_patch_chain = get_most_recent_patch_with_ancestors(commit_events) + .context("cannot get most recent patch for proposal")?; let applied = git_repo - .apply_patch_chain(&branch_name, most_recent_pr_patch_chain) + .apply_patch_chain(&branch_name, most_recent_proposal_patch_chain) .context("cannot apply patch chain")?; if applied.is_empty() { -- cgit v1.2.3