hive-forge: two more pure renames say what replaced them
Second round for the flat-alias deprecation. `pr-commits` and `pr-assign-reviewer` are back-compat aliases with an exact scoped equivalent, and they were missed by all three buckets of the original accounting -- which was wrong in both terms: `reopen`/`dependency`/ `reaction` appear only in the doc-comment prose listing the scoped surface and are not Verb variants at all, so the real count is 17 (7 + 2 + 7 + 1), not 18. The test for "pure rename" is that an exact scoped form exists AND the verb is PR-only, so a caller holding just a number can be sent somewhere unambiguous. Verified rather than assumed: `pr commits` and `pr assign-reviewer` exit 0, while `issue commits` and `issue assign-reviewer` exit 2 -- the same code a deliberately bogus verb returns, which is what makes those 2s mean "no such verb". That is also why the seven kind-agnostic aliases are untouched here: each exists as both `issue <verb>` and `pr <verb>`, so refusing them would remove a capability rather than rename one. Both run functions are still called from pr_cmd.rs, so nothing becomes dead code. The enum's block comment enumerates the pure renames by name and is extended to match -- left alone it would be a stale claim naming seven of nine.
This commit is contained in:
parent
8d29ebf53c
commit
0824caaa2b
1 changed files with 8 additions and 5 deletions
|
|
@ -64,9 +64,12 @@ enum Verb {
|
||||||
// `issue <verb>` forms, and they are at two different stages:
|
// `issue <verb>` forms, and they are at two different stages:
|
||||||
//
|
//
|
||||||
// - **Pure renames** (`pr-status`, `pr-create`, `pr-merge`,
|
// - **Pure renames** (`pr-status`, `pr-create`, `pr-merge`,
|
||||||
// `pr-reviews`, `issue-create`, `issue-edit`, `diff`) now *refuse*
|
// `pr-reviews`, `pr-commits`, `pr-assign-reviewer`, `issue-create`,
|
||||||
// and name their replacement — see `renamed`. They are removed
|
// `issue-edit`, `diff`) now *refuse* and name their replacement —
|
||||||
// outright in a later release.
|
// see `renamed`. They are removed outright in a later release.
|
||||||
|
// The test is PR-only-ness: each has an exact scoped equivalent and
|
||||||
|
// no `issue <verb>` form, so a caller holding just a number can be
|
||||||
|
// sent somewhere unambiguous.
|
||||||
// - **Kind-agnostic** (`view`, `comment`, `comments`, `close`,
|
// - **Kind-agnostic** (`view`, `comment`, `comments`, `close`,
|
||||||
// `assign`, `labels`, `timeline`, …) still work. Each exists as both
|
// `assign`, `labels`, `timeline`, …) still work. Each exists as both
|
||||||
// `issue <verb>` and `pr <verb>`, so there is no single replacement
|
// `issue <verb>` and `pr <verb>`, so there is no single replacement
|
||||||
|
|
@ -311,7 +314,7 @@ fn dispatch(client: &client::Client, verb: Verb) -> Result<()> {
|
||||||
Verb::IssueCreate(_) => renamed("issue-create", "issue create"),
|
Verb::IssueCreate(_) => renamed("issue-create", "issue create"),
|
||||||
Verb::IssueEdit(_) => renamed("issue-edit", "issue edit"),
|
Verb::IssueEdit(_) => renamed("issue-edit", "issue edit"),
|
||||||
Verb::Pr(a) => verbs::pr_cmd::run(client, a),
|
Verb::Pr(a) => verbs::pr_cmd::run(client, a),
|
||||||
Verb::PrCommits(a) => verbs::pr_commits::run(client, a),
|
Verb::PrCommits(_) => renamed("pr-commits", "pr commits"),
|
||||||
Verb::PrCreate(_) => renamed("pr-create", "pr create"),
|
Verb::PrCreate(_) => renamed("pr-create", "pr create"),
|
||||||
Verb::Comment(a) => verbs::comment::run(client, a),
|
Verb::Comment(a) => verbs::comment::run(client, a),
|
||||||
Verb::Comments(a) => verbs::comments::run(client, a),
|
Verb::Comments(a) => verbs::comments::run(client, a),
|
||||||
|
|
@ -331,7 +334,7 @@ fn dispatch(client: &client::Client, verb: Verb) -> Result<()> {
|
||||||
Verb::Milestone(a) => verbs::milestone::run(client, a),
|
Verb::Milestone(a) => verbs::milestone::run(client, a),
|
||||||
Verb::PrMerge(_) => renamed("pr-merge", "pr merge"),
|
Verb::PrMerge(_) => renamed("pr-merge", "pr merge"),
|
||||||
Verb::PrReviews(_) => renamed("pr-reviews", "pr reviews"),
|
Verb::PrReviews(_) => renamed("pr-reviews", "pr reviews"),
|
||||||
Verb::PrAssignReviewer(a) => verbs::pr_assign_reviewer::run(client, a),
|
Verb::PrAssignReviewer(_) => renamed("pr-assign-reviewer", "pr assign-reviewer"),
|
||||||
Verb::Branches(a) => verbs::branches::run(client, a),
|
Verb::Branches(a) => verbs::branches::run(client, a),
|
||||||
Verb::TreeSha(a) => verbs::tree_sha::run(client, a),
|
Verb::TreeSha(a) => verbs::tree_sha::run(client, a),
|
||||||
Verb::Diff(_) => renamed("diff", "pr diff"),
|
Verb::Diff(_) => renamed("diff", "pr diff"),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue