jj/tests
Ilya Grigoriev 3244398e89 Fix rebase -r of a parent of a merge commit
Previously, using `rebase -r` on the parent of a merge commit
turned it into a non-merge commit. In other words, starting
with

```
    o   d
    |\
    o | c
    o | b
    | o a
    |/  
    o 
```

and doing `rebase -r c -d a` resulted in

```
    o d
    o b
    | o c
    | o a
    |/  
    o 
```

where `d` is no longer a merge commit.

For reference, here's a complete test that passed before this commit (but should NOT pass; see the diff for a test that should pass):

```
#[test]
fn test_rebase_single_revision_merge_parent() {
    let test_env = TestEnvironment::default();
    test_env.jj_cmd_success(test_env.env_root(), &["init", "repo", "--git"]);
    let repo_path = test_env.env_root().join("repo");

    create_commit(&test_env, &repo_path, "a", &[]);
    create_commit(&test_env, &repo_path, "b", &[]);
    create_commit(&test_env, &repo_path, "c", &["b"]);
    create_commit(&test_env, &repo_path, "d", &["a", "c"]);
    // Test the setup
    insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
    @
    o   d
    |\
    o | c
    o | b
    | o a
    |/
    o
    "###);

    let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-r", "c", "-d", "a"]);
    insta::assert_snapshot!(stdout, @r###"
    Also rebased 2 descendant commits onto parent of rebased commit
    Working copy now at: 3e176b54d680 (no description set)
    Added 0 files, modified 0 files, removed 2 files
    "###);
    insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
    @
    o d
    | o c
    o | b
    | o a
    |/
    o
    "###);
}
```
2022-09-12 12:23:21 -07:00
..
common tests: use testutils::new_temp_dir() thoroughly 2022-09-07 23:49:46 +09:00
smoke_test.rs cli: show placeholder text for empty commit message 2022-05-18 09:16:04 -07:00
test_alias.rs cli: make jj branch take subcommands, not flags 2022-06-06 09:02:56 -07:00
test_branch_command.rs cli: make jj branch take subcommands, not flags 2022-06-06 09:02:56 -07:00
test_checkout.rs cli: disable open commits by default 2022-08-26 23:34:52 -07:00
test_concurrent_operations.rs cli: show placeholder text for empty commit message 2022-05-18 09:16:04 -07:00
test_describe_command.rs cli: make jj move/squash/unsquash ask for combined description 2022-08-30 21:41:26 -07:00
test_diff_command.rs diff: make sure word diff print final newline 2022-07-07 23:29:18 +09:00
test_edit_command.rs cli: add jj edit for editing a commit in the wokring copy 2022-07-01 08:58:08 +08:00
test_git_clone.rs cli: check that clone target is an empty dir if it exists 2022-07-01 09:03:24 +08:00
test_git_colocated.rs cli: make jj branch take subcommands, not flags 2022-06-06 09:02:56 -07:00
test_git_push.rs cli: push only branches pointing to @ by default 2022-07-13 16:23:13 -07:00
test_git_remotes.rs
test_gitignores.rs
test_global_opts.rs cli: rename jj edit to jj touchup 2022-07-01 08:58:08 +08:00
test_init_command.rs cli: show placeholder text for empty commit message 2022-05-18 09:16:04 -07:00
test_interdiff_command.rs cli: add interdiff command 2022-09-02 02:59:37 +08:00
test_log_command.rs cli: show placeholder text for empty commit message 2022-05-18 09:16:04 -07:00
test_move_command.rs cli: make jj move/squash/unsquash ask for combined description 2022-08-30 21:41:26 -07:00
test_new_command.rs cli: fix crash on "jj merge whatever root" 2022-09-01 13:36:17 +09:00
test_obslog_command.rs cli: make jj move/squash/unsquash ask for combined description 2022-08-30 21:41:26 -07:00
test_operations.rs graphlog: don't de-indent multi-line text at end of chain 2022-05-11 04:42:44 -07:00
test_print_command.rs spelling: nonexistent 2022-09-09 11:58:37 -07:00
test_rebase_command.rs Fix rebase -r of a parent of a merge commit 2022-09-12 12:23:21 -07:00
test_restore_command.rs cli: show placeholder text for empty commit message 2022-05-18 09:16:04 -07:00
test_sparse_command.rs
test_split_command.rs cli: show placeholder text for empty commit message 2022-05-18 09:16:04 -07:00
test_squash_command.rs tests: use jj new instead of jj merge in tests 2022-08-31 07:51:32 -07:00
test_touchup_command.rs tests: use jj new instead of jj merge in tests 2022-08-31 07:51:32 -07:00
test_undo.rs cli: show placeholder text for empty commit message 2022-05-18 09:16:04 -07:00
test_unsquash_command.rs tests: use jj new instead of jj merge in tests 2022-08-31 07:51:32 -07:00
test_untrack_command.rs cli: snapshot working copy even on e.g. jj diff -r <some hash> 2022-07-29 22:06:53 +02:00
test_workspaces.rs cli: make jj move/squash/unsquash ask for combined description 2022-08-30 21:41:26 -07:00