Skip to content

Commit

Permalink
cli: delete deprecated jj merge command
Browse files Browse the repository at this point in the history
This has been deprecated for almost a year now.

Signed-off-by: Austin Seipp <[email protected]>
  • Loading branch information
thoughtpolice committed Nov 21, 2024
1 parent 0371341 commit e060ef2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 73 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
* `jj checkout` and the built-in alias `jj co` have been removed.
It was deprecated in 0.14.0.

* `jj merge` has been removed. It was deprecated in 0.14.0.

* `jj git push` no longer pushes new bookmarks by default. Use `--allow-new` to
bypass this restriction.

Expand Down
41 changes: 0 additions & 41 deletions cli/src/commands/merge.rs

This file was deleted.

13 changes: 0 additions & 13 deletions cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ mod help;
mod init;
mod interdiff;
mod log;
mod merge;
mod new;
mod next;
mod operation;
Expand Down Expand Up @@ -118,17 +117,6 @@ enum Command {
Init(init::InitArgs),
Interdiff(interdiff::InterdiffArgs),
Log(log::LogArgs),
/// Merge work from multiple bookmarks (DEPRECATED, use `jj new`)
///
/// Unlike most other VCSs, `jj merge` does not implicitly include the
/// working copy revision's parent as one of the parents of the merge;
/// you need to explicitly list all revisions that should become parents
/// of the merge.
///
/// This is the same as `jj new`, except that it requires at least two
/// arguments.
#[command(hide = true)]
Merge(new::NewArgs),
New(new::NewArgs),
Next(next::NextArgs),
#[command(subcommand)]
Expand Down Expand Up @@ -224,7 +212,6 @@ pub fn run_command(ui: &mut Ui, command_helper: &CommandHelper) -> Result<(), Co
Command::Init(args) => init::cmd_init(ui, command_helper, args),
Command::Interdiff(args) => interdiff::cmd_interdiff(ui, command_helper, args),
Command::Log(args) => log::cmd_log(ui, command_helper, args),
Command::Merge(args) => merge::cmd_merge(ui, command_helper, args),
Command::New(args) => new::cmd_new(ui, command_helper, args),
Command::Next(args) => next::cmd_next(ui, command_helper, args),
Command::Evolog(args) => evolog::cmd_evolog(ui, command_helper, args),
Expand Down
24 changes: 5 additions & 19 deletions cli/tests/test_new_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ fn test_new_merge() {
◆ 0000000000000000000000000000000000000000
"###);

// Same test with `jj merge`
// Same test with `jj new`
test_env.jj_cmd_ok(&repo_path, &["undo"]);
test_env.jj_cmd_ok(&repo_path, &["merge", "main", "@"]);
test_env.jj_cmd_ok(&repo_path, &["new", "main", "@"]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 114023233c454e2eca22b8b209f9e42f755eb28c
├─╮
Expand All @@ -118,20 +118,6 @@ fn test_new_merge() {
◆ 0000000000000000000000000000000000000000
"###);

// `jj merge` with less than two arguments is an error
let stderr = test_env.jj_cmd_cli_error(&repo_path, &["merge"]);
insta::assert_snapshot!(stderr, @r###"
Warning: `jj merge` is deprecated; use `jj new` instead, which is equivalent
Warning: `jj merge` will be removed in a future version, and this will be a hard error
Error: Merge requires at least two revisions
"###);
let stderr = test_env.jj_cmd_cli_error(&repo_path, &["merge", "main"]);
insta::assert_snapshot!(stderr, @r###"
Warning: `jj merge` is deprecated; use `jj new` instead, which is equivalent
Warning: `jj merge` will be removed in a future version, and this will be a hard error
Error: Merge requires at least two revisions
"###);

// merge with non-unique revisions
let stderr = test_env.jj_cmd_failure(&repo_path, &["new", "@", "3a44e"]);
insta::assert_snapshot!(stderr, @r###"
Expand All @@ -140,10 +126,10 @@ fn test_new_merge() {
// if prefixed with all:, duplicates are allowed
let (stdout, stderr) = test_env.jj_cmd_ok(&repo_path, &["new", "@", "all:visible_heads()"]);
insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(stderr, @r###"
Working copy now at: xznxytkn 6286a0ff (empty) (no description set)
insta::assert_snapshot!(stderr, @r#"
Working copy now at: nkmrtpmo ed2dc1d9 (empty) (no description set)
Parent commit : wqnwkozp 11402323 (empty) (no description set)
"###);
"#);

// merge with root
let stderr = test_env.jj_cmd_failure(&repo_path, &["new", "@", "root()"]);
Expand Down

0 comments on commit e060ef2

Please sign in to comment.