diff --git a/CHANGELOG.md b/CHANGELOG.md index 173297b186..1ec18c0bf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * `jj branch list` now supports a `--conflicted/-c` option to show only conflicted branches. +* `jj duplicate` and `jj abandon` can now take more than a single `-r` argument, + for consistency with other commands. + ### Fixed bugs ## [0.15.1] - 2024-03-06 diff --git a/cli/src/commands/abandon.rs b/cli/src/commands/abandon.rs index 06e15369b9..3b00e2853a 100644 --- a/cli/src/commands/abandon.rs +++ b/cli/src/commands/abandon.rs @@ -41,8 +41,8 @@ pub(crate) struct AbandonArgs { #[arg(long, short)] summary: bool, /// Ignored (but lets you pass `-r` for consistency with other commands) - #[arg(short = 'r', hide = true)] - unused_revision: bool, + #[arg(short = 'r', hide = true, action = clap::ArgAction::Count)] + unused_revision: u8, } #[instrument(skip_all)] diff --git a/cli/src/commands/duplicate.rs b/cli/src/commands/duplicate.rs index 44fd309574..58efcd2866 100644 --- a/cli/src/commands/duplicate.rs +++ b/cli/src/commands/duplicate.rs @@ -31,8 +31,8 @@ pub(crate) struct DuplicateArgs { #[arg(default_value = "@")] revisions: Vec, /// Ignored (but lets you pass `-r` for consistency with other commands) - #[arg(short = 'r', hide = true)] - unused_revision: bool, + #[arg(short = 'r', hide = true, action = clap::ArgAction::Count)] + unused_revision: u8, } #[instrument(skip_all)] diff --git a/cli/src/commands/new.rs b/cli/src/commands/new.rs index a94d80769e..54b5ee8a29 100644 --- a/cli/src/commands/new.rs +++ b/cli/src/commands/new.rs @@ -45,8 +45,8 @@ pub(crate) struct NewArgs { #[arg(default_value = "@")] pub(crate) revisions: Vec, /// Ignored (but lets you pass `-r` for consistency with other commands) - #[arg(short = 'r', hide = true, overrides_with = "unused_revision")] - unused_revision: bool, + #[arg(short = 'r', hide = true, action = clap::ArgAction::Count)] + unused_revision: u8, /// The change description to use #[arg(long = "message", short, value_name = "MESSAGE")] message_paragraphs: Vec, diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index 420f3a616d..52f2194292 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -189,9 +189,6 @@ If a working-copy commit gets abandoned, it will be given a new, empty commit. T * `-r` — Ignored (but lets you pass `-r` for consistency with other commands) - Possible values: `true`, `false` - - ## `jj backout` @@ -703,9 +700,6 @@ Create a new change with the same content as an existing one * `-r` — Ignored (but lets you pass `-r` for consistency with other commands) - Possible values: `true`, `false` - - ## `jj edit` @@ -1118,9 +1112,6 @@ For more information, see https://github.com/martinvonz/jj/blob/main/docs/workin ###### **Options:** * `-r` — Ignored (but lets you pass `-r` for consistency with other commands) - - Possible values: `true`, `false` - * `-m`, `--message ` — The change description to use * `-L`, `--allow-large-revsets` — Deprecated. Please prefix the revset with `all:` instead