just playing with tangled
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cli: deprecate backout command

+37 -25
+2
CHANGELOG.md
··· 36 36 37 37 * `core.watchman.register_snapshot_trigger` has been renamed to `core.watchman.register-snapshot-trigger` for consistency with other configuration options. 38 38 39 + * `jj backout` is deprecated in favor of `jj revert`. 40 + 39 41 ### New features 40 42 41 43 * `jj sign` will automatically use the gpg key associated with the author's email
+10
cli/src/commands/backout.rs
··· 31 31 /// The description of the new revisions can be customized with the 32 32 /// `templates.backout_description` config variable. 33 33 #[derive(clap::Args, Clone, Debug)] 34 + #[command(hide = true)] 34 35 pub(crate) struct BackoutArgs { 35 36 /// The revision(s) to apply the reverse of 36 37 #[arg( ··· 58 59 command: &CommandHelper, 59 60 args: &BackoutArgs, 60 61 ) -> Result<(), CommandError> { 62 + writeln!( 63 + ui.warning_default(), 64 + "`jj backout` is deprecated; use `jj revert` instead" 65 + )?; 66 + writeln!( 67 + ui.warning_default(), 68 + "`jj backout` will be removed in a future version, and this will be a hard error" 69 + )?; 70 + 61 71 let mut workspace_command = command.workspace_helper(ui)?; 62 72 let to_back_out: Vec<_> = workspace_command 63 73 .parse_union_revsets(ui, &args.revisions)?
+1
cli/src/commands/mod.rs
··· 88 88 enum Command { 89 89 Abandon(abandon::AbandonArgs), 90 90 Absorb(absorb::AbsorbArgs), 91 + // TODO: Remove in jj 0.34+ 91 92 Backout(backout::BackoutArgs), 92 93 #[cfg(feature = "bench")] 93 94 #[command(subcommand)]
-21
cli/tests/cli-reference@.md.snap
··· 13 13 * [`jj`↴](#jj) 14 14 * [`jj abandon`↴](#jj-abandon) 15 15 * [`jj absorb`↴](#jj-absorb) 16 - * [`jj backout`↴](#jj-backout) 17 16 * [`jj bookmark`↴](#jj-bookmark) 18 17 * [`jj bookmark create`↴](#jj-bookmark-create) 19 18 * [`jj bookmark delete`↴](#jj-bookmark-delete) ··· 126 125 127 126 * `abandon` — Abandon a revision 128 127 * `absorb` — Move changes from a revision into the stack of mutable revisions 129 - * `backout` — Apply the reverse of given revisions on top of another revision 130 128 * `bookmark` — Manage bookmarks [default alias: b] 131 129 * `commit` — Update the description and create a new change on top 132 130 * `config` — Manage config options ··· 260 258 Only ancestors of the source revision will be considered. 261 259 262 260 Default value: `mutable()` 263 - 264 - 265 - 266 - ## `jj backout` 267 - 268 - Apply the reverse of given revisions on top of another revision 269 - 270 - The description of the new revisions can be customized with the `templates.backout_description` config variable. 271 - 272 - **Usage:** `jj backout [OPTIONS]` 273 - 274 - ###### **Options:** 275 - 276 - * `-r`, `--revisions <REVSETS>` — The revision(s) to apply the reverse of 277 - 278 - Default value: `@` 279 - * `-d`, `--destination <REVSETS>` — The revision to apply the reverse changes on top of 280 - 281 - Default value: `@` 282 261 283 262 284 263
+24 -4
cli/tests/test_backout_command.rs
··· 38 38 39 39 // Backout the commit 40 40 let output = work_dir.run_jj(["backout", "-r", "@"]); 41 - insta::assert_snapshot!(output, @""); 41 + insta::assert_snapshot!(output, @r" 42 + ------- stderr ------- 43 + Warning: `jj backout` is deprecated; use `jj revert` instead 44 + Warning: `jj backout` will be removed in a future version, and this will be a hard error 45 + [EOF] 46 + "); 42 47 insta::assert_snapshot!(get_log_output(&work_dir), @r#" 43 48 ○ 6d845ed9fb6a Back out "a" 44 49 ··· 56 61 // Backout the new backed-out commit 57 62 work_dir.run_jj(["edit", "@+"]).success(); 58 63 let output = work_dir.run_jj(["backout", "-r", "@"]); 59 - insta::assert_snapshot!(output, @""); 64 + insta::assert_snapshot!(output, @r" 65 + ------- stderr ------- 66 + Warning: `jj backout` is deprecated; use `jj revert` instead 67 + Warning: `jj backout` will be removed in a future version, and this will be a hard error 68 + [EOF] 69 + "); 60 70 insta::assert_snapshot!(get_log_output(&work_dir), @r#" 61 71 ○ 79555ea9040b Back out "Back out "a"" 62 72 ··· 100 110 101 111 // Backout multiple commits 102 112 let output = work_dir.run_jj(["backout", "-r", "b", "-r", "c", "-r", "e"]); 103 - insta::assert_snapshot!(output, @""); 113 + insta::assert_snapshot!(output, @r" 114 + ------- stderr ------- 115 + Warning: `jj backout` is deprecated; use `jj revert` instead 116 + Warning: `jj backout` will be removed in a future version, and this will be a hard error 117 + [EOF] 118 + "); 104 119 insta::assert_snapshot!(get_log_output(&work_dir), @r#" 105 120 ○ 6504c4ded177 Back out "b" 106 121 ··· 203 218 204 219 // Verify that message of backed out commit follows the template 205 220 let output = work_dir.run_jj(["backout", "-r", "a"]); 206 - insta::assert_snapshot!(output, @""); 221 + insta::assert_snapshot!(output, @r" 222 + ------- stderr ------- 223 + Warning: `jj backout` is deprecated; use `jj revert` instead 224 + Warning: `jj backout` will be removed in a future version, and this will be a hard error 225 + [EOF] 226 + "); 207 227 insta::assert_snapshot!(get_log_output(&work_dir), @r#" 208 228 ○ 1db880a5204e Revert commit 2443ea76b0b1 "a" 209 229 @ 2443ea76b0b1 a