hive-forge: fix pr_merge.rs's dead pr-merge: bail! prefix

7 bail! messages in pr_merge.rs were prefixed pr-merge: -- the flat-alias
verb name that main.rs's renamed-verb list now refuses to run, not the
current pr merge kind-namespaced form. Someone who read the prefix and
tried hive-forge pr-merge got a second, unrelated refusal for a verb that
doesn't exist anymore.

#4157 swept the renamed verbs out of docs, prompts and the deprecation
list; it didn't cover runtime error prefixes, which is where these
survived (same shape as the two pr_status.rs had, fixed in #4182/#4184).

One of the seven also told the reader to check pr status --pr {number};
now pr status {number}, matching #4184's new positional form.

fixes #4183
This commit is contained in:
damocles 2026-09-11 11:03:07 +02:00
commit 911238ad73

View file

@ -82,10 +82,10 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
.send()?; .send()?;
if pull.merged.unwrap_or(false) { if pull.merged.unwrap_or(false) {
bail!("pr-merge: PR #{} is already merged", args.number); bail!("pr merge: PR #{} is already merged", args.number);
} }
if pull.state == Some(StateType::Closed) { if pull.state == Some(StateType::Closed) {
bail!("pr-merge: PR #{} is closed", args.number); bail!("pr merge: PR #{} is closed", args.number);
} }
if !args.force { if !args.force {
@ -139,13 +139,13 @@ fn check_ready(client: &Client, repo: &str, number: u64, pull: &PullRequest) ->
// rather than an oversight, so don't tell the caller to just // rather than an oversight, so don't tell the caller to just
// undraft it if it isn't theirs to undraft. // undraft it if it isn't theirs to undraft.
Some(false) if pull.draft.unwrap_or(false) => bail!( Some(false) if pull.draft.unwrap_or(false) => bail!(
"pr-merge: PR #{number} is a draft, not mergeable. Pass --force, or check with whoever set draft before un-drafting it." "pr merge: PR #{number} is a draft, not mergeable. Pass --force, or check with whoever set draft before un-drafting it."
), ),
Some(false) => bail!( Some(false) => bail!(
"pr-merge: PR #{number} is not mergeable. Check `pr status --pr {number}` for detail, or pass --force." "pr merge: PR #{number} is not mergeable. Check `pr status {number}` for detail, or pass --force."
), ),
None => bail!( None => bail!(
"pr-merge: PR #{number} mergeability is still being computed. Retry shortly, or pass --force." "pr merge: PR #{number} mergeability is still being computed. Retry shortly, or pass --force."
), ),
} }
@ -156,7 +156,7 @@ fn check_ready(client: &Client, repo: &str, number: u64, pull: &PullRequest) ->
if !combined.statuses.is_empty() && combined.state != "success" { if !combined.statuses.is_empty() && combined.state != "success" {
let state = &combined.state; let state = &combined.state;
bail!( bail!(
"pr-merge: PR #{number} CI is not green (state: {state}). Wait for green, or pass --force." "pr merge: PR #{number} CI is not green (state: {state}). Wait for green, or pass --force."
); );
} }
} }
@ -173,7 +173,7 @@ fn check_ready(client: &Client, repo: &str, number: u64, pull: &PullRequest) ->
.collect(); .collect();
if !blockers.is_empty() { if !blockers.is_empty() {
bail!( bail!(
"pr-merge: PR #{number} has changes requested by {}. Resolve the review, or pass --force.", "pr merge: PR #{number} has changes requested by {}. Resolve the review, or pass --force.",
blockers.join(", ") blockers.join(", ")
); );
} }