cli: replace o as graph node by when using unicode graph

@joyously found `o` confusing because it's a valid change id prefix. I
don't have much preference, but `●` seems fine. The "ascii",
"ascii-large", and "legacy" graph styles still use "o".

I didn't change `@` since it seems useful to have that match the
symbol used on the CLI. I don't think we want to have users do
something like `jj co ◎-`.
This commit is contained in:
Martin von Zweigbergk 2023-03-10 23:10:31 -08:00 committed by Martin von Zweigbergk
parent 82101bc7e0
commit 5c703aeb03
37 changed files with 842 additions and 839 deletions

View File

@ -40,6 +40,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Added `ui.log-word-wrap` option to wrap `jj log`/`obslog`/`op log` content * Added `ui.log-word-wrap` option to wrap `jj log`/`obslog`/`op log` content
based on terminal width. [#1043](https://github.com/martinvonz/jj/issues/1043) based on terminal width. [#1043](https://github.com/martinvonz/jj/issues/1043)
* Nodes in the (text-based) graphical log output now use a `●` symbol instead
of the letter `o`. The ASCII-based graph styles still use `o`.
### Fixed bugs ### Fixed bugs
* Modify/delete conflicts now include context lines * Modify/delete conflicts now include context lines

View File

@ -30,7 +30,7 @@ is:"
run_command "jj op log --color=always | head" run_command "jj op log --color=always | head"
comment "Let's undo that rebase operation:" comment "Let's undo that rebase operation:"
rebase_op=$(jj --color=never op log | grep '^o ' | sed '2q;d' | cut -b4-15) rebase_op=$(jj --color=never op log | grep '^ ' | sed '2q;d' | cut -b4-15)
run_command "jj undo $rebase_op" run_command "jj undo $rebase_op"
comment "Note that only the rebase was undone, and the comment "Note that only the rebase was undone, and the

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 KiB

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 KiB

After

Width:  |  Height:  |  Size: 323 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 KiB

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 KiB

After

Width:  |  Height:  |  Size: 270 KiB

View File

@ -117,9 +117,9 @@ in its `jj log` command:
$ jj log $ jj log
@ mpqrykypylvy martinvonz@google.com 2023-02-12 15:00:22.000 -08:00 aef4df99ea11 @ mpqrykypylvy martinvonz@google.com 2023-02-12 15:00:22.000 -08:00 aef4df99ea11
│ (empty) (no description set) │ (empty) (no description set)
o kntqzsqtnspv martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19dac36 kntqzsqtnspv martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19dac36
│ Say goodbye │ Say goodbye
o orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9 orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9
│ (empty) Merge pull request #6 from Spaceghost/patch-1 │ (empty) Merge pull request #6 from Spaceghost/patch-1
~ ~
``` ```
@ -144,13 +144,13 @@ example:
$ jj log -r '@ | root | branches()' $ jj log -r '@ | root | branches()'
@ mpqrykypylvy martinvonz@google.com 2023-02-12 15:00:22.000 -08:00 aef4df99ea11 @ mpqrykypylvy martinvonz@google.com 2023-02-12 15:00:22.000 -08:00 aef4df99ea11
╷ (empty) (no description set) ╷ (empty) (no description set)
o kowxouwzwxmv octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bbd7e8 kowxouwzwxmv octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bbd7e8
╭─╯ Create CONTRIBUTING.md ╭─╯ Create CONTRIBUTING.md
o tpstlustrvsn support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 octocat-patch-1 b1b3f9723831 tpstlustrvsn support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 octocat-patch-1 b1b3f9723831
├─╯ sentence case ├─╯ sentence case
o orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9 orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9
╷ (empty) Merge pull request #6 from Spaceghost/patch-1 ╷ (empty) Merge pull request #6 from Spaceghost/patch-1
o zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000 zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set) (empty) (no description set)
``` ```
@ -182,15 +182,15 @@ Working copy now at: 62a3c6d315cd C
$ jj log $ jj log
@ qzvqqupxlkot martinvonz@google.com 2023-02-12 15:07:41.946 -08:00 2370ddf3fa39 @ qzvqqupxlkot martinvonz@google.com 2023-02-12 15:07:41.946 -08:00 2370ddf3fa39
│ C │ C
o puqltuttrvzp martinvonz@google.com 2023-02-12 15:07:33.000 -08:00 daa6ffd5a09a puqltuttrvzp martinvonz@google.com 2023-02-12 15:07:33.000 -08:00 daa6ffd5a09a
│ B2 │ B2
o ovknlmrokpkl martinvonz@google.com 2023-02-12 15:07:24.000 -08:00 7d7c6e6bd0b4 ovknlmrokpkl martinvonz@google.com 2023-02-12 15:07:24.000 -08:00 7d7c6e6bd0b4
│ B1 │ B1
o nuvyytnqlquo martinvonz@google.com 2023-02-12 15:07:05.000 -08:00 5dda2f097aa9 nuvyytnqlquo martinvonz@google.com 2023-02-12 15:07:05.000 -08:00 5dda2f097aa9
│ A │ A
o kntqzsqtnspv martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19dac36 kntqzsqtnspv martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19dac36
├─╯ Say goodbye ├─╯ Say goodbye
o orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9 orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9
│ (empty) Merge pull request #6 from Spaceghost/patch-1 │ (empty) Merge pull request #6 from Spaceghost/patch-1
~ ~
``` ```
@ -205,15 +205,15 @@ Added 0 files, modified 1 files, removed 0 files
$ jj log $ jj log
@ qzvqqupxlkot martinvonz@google.com 2023-02-12 15:08:33.000 -08:00 1978b53430cd conflict @ qzvqqupxlkot martinvonz@google.com 2023-02-12 15:08:33.000 -08:00 1978b53430cd conflict
│ C │ C
o puqltuttrvzp martinvonz@google.com 2023-02-12 15:08:33.000 -08:00 f7fb5943ee41 conflict puqltuttrvzp martinvonz@google.com 2023-02-12 15:08:33.000 -08:00 f7fb5943ee41 conflict
│ B2 │ B2
o ovknlmrokpkl martinvonz@google.com 2023-02-12 15:07:24.000 -08:00 7d7c6e6bd0b4 ovknlmrokpkl martinvonz@google.com 2023-02-12 15:07:24.000 -08:00 7d7c6e6bd0b4
├─╯ B1 ├─╯ B1
o nuvyytnqlquo martinvonz@google.com 2023-02-12 15:07:05.000 -08:00 5dda2f097aa9 nuvyytnqlquo martinvonz@google.com 2023-02-12 15:07:05.000 -08:00 5dda2f097aa9
│ A │ A
o kntqzsqtnspv martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19dac36 kntqzsqtnspv martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19dac36
├─╯ Say goodbye ├─╯ Say goodbye
o orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9 orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9
│ (empty) Merge pull request #6 from Spaceghost/patch-1 │ (empty) Merge pull request #6 from Spaceghost/patch-1
~ ~
``` ```
@ -254,17 +254,17 @@ Working copy now at: e3c279cc2043 (no description set)
$ jj log $ jj log
@ ntxxqymrlvxu martinvonz@google.com 2023-02-12 19:34:09.000 -08:00 e3c279cc2043 @ ntxxqymrlvxu martinvonz@google.com 2023-02-12 19:34:09.000 -08:00 e3c279cc2043
│ (empty) (no description set) │ (empty) (no description set)
o qzvqqupxlkot martinvonz@google.com 2023-02-12 19:34:09.000 -08:00 b9da9d28b26b qzvqqupxlkot martinvonz@google.com 2023-02-12 19:34:09.000 -08:00 b9da9d28b26b
├─╯ C ├─╯ C
o puqltuttrvzp martinvonz@google.com 2023-02-12 19:34:09.000 -08:00 2c7a658e2586 puqltuttrvzp martinvonz@google.com 2023-02-12 19:34:09.000 -08:00 2c7a658e2586
│ B2 │ B2
o ovknlmrokpkl martinvonz@google.com 2023-02-12 15:07:24.000 -08:00 7d7c6e6bd0b4 ovknlmrokpkl martinvonz@google.com 2023-02-12 15:07:24.000 -08:00 7d7c6e6bd0b4
├─╯ B1 ├─╯ B1
o nuvyytnqlquo martinvonz@google.com 2023-02-12 15:07:05.000 -08:00 5dda2f097aa9 nuvyytnqlquo martinvonz@google.com 2023-02-12 15:07:05.000 -08:00 5dda2f097aa9
│ A │ A
o kntqzsqtnspv martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19dac36 kntqzsqtnspv martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19dac36
├─╯ Say goodbye ├─╯ Say goodbye
o orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9 orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9
│ (empty) Merge pull request #6 from Spaceghost/patch-1 │ (empty) Merge pull request #6 from Spaceghost/patch-1
~ ~
``` ```
@ -286,12 +286,12 @@ $ jj op log
@ d3b77addea49 martinvonz@vonz.svl.corp.google.com 2023-02-12 19:34:09.549 -08:00 - 2023-02-12 19:34:09.552 -08:00 @ d3b77addea49 martinvonz@vonz.svl.corp.google.com 2023-02-12 19:34:09.549 -08:00 - 2023-02-12 19:34:09.552 -08:00
│ squash commit 63874fe6c4fba405ffc38b0dd926f03b715cf7ef │ squash commit 63874fe6c4fba405ffc38b0dd926f03b715cf7ef
│ args: jj squash │ args: jj squash
o 6fc1873c1180 martinvonz@vonz.svl.corp.google.com 2023-02-12 19:34:09.548 -08:00 - 2023-02-12 19:34:09.549 -08:00 6fc1873c1180 martinvonz@vonz.svl.corp.google.com 2023-02-12 19:34:09.548 -08:00 - 2023-02-12 19:34:09.549 -08:00
│ snapshot working copy │ snapshot working copy
o ed91f7bcc1fb martinvonz@vonz.svl.corp.google.com 2023-02-12 19:32:46.007 -08:00 - 2023-02-12 19:32:46.008 -08:00 ed91f7bcc1fb martinvonz@vonz.svl.corp.google.com 2023-02-12 19:32:46.007 -08:00 - 2023-02-12 19:32:46.008 -08:00
│ new empty commit │ new empty commit
│ args: jj new puqltuttrvzp │ args: jj new puqltuttrvzp
o 367400773f87 martinvonz@vonz.svl.corp.google.com 2023-02-12 15:08:33.917 -08:00 - 2023-02-12 15:08:33.920 -08:00 367400773f87 martinvonz@vonz.svl.corp.google.com 2023-02-12 15:08:33.917 -08:00 - 2023-02-12 15:08:33.920 -08:00
│ rebase commit daa6ffd5a09a8a7d09a65796194e69b7ed0a566d and descendants │ rebase commit daa6ffd5a09a8a7d09a65796194e69b7ed0a566d and descendants
│ args: jj rebase -s puqltuttrvzp -d nuvyytnqlquo │ args: jj rebase -s puqltuttrvzp -d nuvyytnqlquo
[many more lines] [many more lines]
@ -305,17 +305,17 @@ Working copy now at: 63874fe6c4fb (no description set)
$ jj log $ jj log
@ zxoosnnpvvpn martinvonz@google.com 2023-02-12 19:34:09.000 -08:00 63874fe6c4fb @ zxoosnnpvvpn martinvonz@google.com 2023-02-12 19:34:09.000 -08:00 63874fe6c4fb
│ (no description set) │ (no description set)
o qzvqqupxlkot martinvonz@google.com 2023-02-12 15:08:33.000 -08:00 1978b53430cd conflict qzvqqupxlkot martinvonz@google.com 2023-02-12 15:08:33.000 -08:00 1978b53430cd conflict
├─╯ C ├─╯ C
o puqltuttrvzp martinvonz@google.com 2023-02-12 15:08:33.000 -08:00 f7fb5943ee41 conflict puqltuttrvzp martinvonz@google.com 2023-02-12 15:08:33.000 -08:00 f7fb5943ee41 conflict
│ B2 │ B2
o ovknlmrokpkl martinvonz@google.com 2023-02-12 15:07:24.000 -08:00 7d7c6e6bd0b4 ovknlmrokpkl martinvonz@google.com 2023-02-12 15:07:24.000 -08:00 7d7c6e6bd0b4
├─╯ B1 ├─╯ B1
o nuvyytnqlquo martinvonz@google.com 2023-02-12 15:07:05.000 -08:00 5dda2f097aa9 nuvyytnqlquo martinvonz@google.com 2023-02-12 15:07:05.000 -08:00 5dda2f097aa9
│ A │ A
o kntqzsqtnspv martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19dac36 kntqzsqtnspv martinvonz@google.com 2023-02-12 14:56:59.000 -08:00 5d39e19dac36
├─╯ Say goodbye ├─╯ Say goodbye
o orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9 orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9
│ (empty) Merge pull request #6 from Spaceghost/patch-1 │ (empty) Merge pull request #6 from Spaceghost/patch-1
~ ~
``` ```
@ -351,11 +351,11 @@ Working copy now at: a67491542e10 ABCD
$ jj log -r master:@ $ jj log -r master:@
@ mrxqplykzpkw martinvonz@google.com 2023-02-12 19:38:21.000 -08:00 b98c607bf87f @ mrxqplykzpkw martinvonz@google.com 2023-02-12 19:38:21.000 -08:00 b98c607bf87f
│ ABCD │ ABCD
o kwtuwqnmqyqp martinvonz@google.com 2023-02-12 19:38:12.000 -08:00 30aecc0871ea kwtuwqnmqyqp martinvonz@google.com 2023-02-12 19:38:12.000 -08:00 30aecc0871ea
│ ABC │ ABC
o ztqrpvnwqqnq martinvonz@google.com 2023-02-12 19:38:03.000 -08:00 510022615871 ztqrpvnwqqnq martinvonz@google.com 2023-02-12 19:38:03.000 -08:00 510022615871
│ abc │ abc
o orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9 orrkosyozysx octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b01f9
│ (empty) Merge pull request #6 from Spaceghost/patch-1 │ (empty) Merge pull request #6 from Spaceghost/patch-1
~ ~
``` ```

View File

@ -138,11 +138,11 @@ pub fn get_graphlog<'a, K: Clone + Eq + Hash + 'a>(
let builder = GraphRowRenderer::new().output().with_min_row_height(0); let builder = GraphRowRenderer::new().output().with_min_row_height(0);
match settings.graph_style().as_str() { match settings.graph_style().as_str() {
"curved" => SaplingGraphLog::create(builder.build_box_drawing(), formatter, "o"), "curved" => SaplingGraphLog::create(builder.build_box_drawing(), formatter, ""),
"square" => SaplingGraphLog::create( "square" => SaplingGraphLog::create(
builder.build_box_drawing().with_square_glyphs(), builder.build_box_drawing().with_square_glyphs(),
formatter, formatter,
"o", "",
), ),
"ascii" => SaplingGraphLog::create(builder.build_ascii(), formatter, "o"), "ascii" => SaplingGraphLog::create(builder.build_ascii(), formatter, "o"),
"ascii-large" => SaplingGraphLog::create(builder.build_ascii_large(), formatter, "o"), "ascii-large" => SaplingGraphLog::create(builder.build_ascii_large(), formatter, "o"),

View File

@ -45,13 +45,13 @@ fn test_rebase_branch_with_merge() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e @ e
o d d
o c c
o b b
o a a
o
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["abandon", "d"]); let stdout = test_env.jj_cmd_success(&repo_path, &["abandon", "d"]);
@ -64,12 +64,12 @@ fn test_rebase_branch_with_merge() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e @ e
o c d c d
o b b
o a a
o
"###); "###);
test_env.jj_cmd_success(&repo_path, &["undo"]); test_env.jj_cmd_success(&repo_path, &["undo"]);
@ -81,13 +81,13 @@ fn test_rebase_branch_with_merge() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ @
o d e?? d e??
o c c
o b b
o a e?? a e??
o
"###); "###);
test_env.jj_cmd_success(&repo_path, &["undo"]); test_env.jj_cmd_success(&repo_path, &["undo"]);
@ -102,10 +102,10 @@ fn test_rebase_branch_with_merge() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ @
o b b
o a e?? a e??
o c d e?? c d e??
"###); "###);
// Test abandoning the same commit twice directly // Test abandoning the same commit twice directly
@ -117,11 +117,11 @@ fn test_rebase_branch_with_merge() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e @ e
o d d
o c c
o a b a b
o
"###); "###);
// Test abandoning the same commit twice indirectly // Test abandoning the same commit twice indirectly
@ -138,9 +138,9 @@ fn test_rebase_branch_with_merge() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ @
o c d e?? c d e??
o a b e?? a b e??
"###); "###);
let stderr = test_env.jj_cmd_failure(&repo_path, &["abandon", "root"]); let stderr = test_env.jj_cmd_failure(&repo_path, &["abandon", "root"]);

View File

@ -137,7 +137,7 @@ fn test_alias_cannot_override_builtin() {
// Alias should be ignored // Alias should be ignored
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "root"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "root"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
o zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000 zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set) (empty) (no description set)
"###); "###);
} }
@ -177,28 +177,28 @@ fn test_alias_global_args_before_and_after() {
let stdout = test_env.jj_cmd_success(&repo_path, &["l"]); let stdout = test_env.jj_cmd_success(&repo_path, &["l"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22 @ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Can pass global args before // Can pass global args before
let stdout = test_env.jj_cmd_success(&repo_path, &["l", "--at-op", "@-"]); let stdout = test_env.jj_cmd_success(&repo_path, &["l", "--at-op", "@-"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Can pass global args after // Can pass global args after
let stdout = test_env.jj_cmd_success(&repo_path, &["--at-op", "@-", "l"]); let stdout = test_env.jj_cmd_success(&repo_path, &["--at-op", "@-", "l"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Test passing global args both before and after // Test passing global args both before and after
let stdout = test_env.jj_cmd_success(&repo_path, &["--at-op", "abc123", "l", "--at-op", "@-"]); let stdout = test_env.jj_cmd_success(&repo_path, &["--at-op", "abc123", "l", "--at-op", "@-"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["-R", "../nonexistent", "l", "-R", "."]); let stdout = test_env.jj_cmd_success(&repo_path, &["-R", "../nonexistent", "l", "-R", "."]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22 @ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }
@ -214,7 +214,7 @@ fn test_alias_global_args_in_definition() {
// The global argument in the alias is respected // The global argument in the alias is respected
let stdout = test_env.jj_cmd_success(&repo_path, &["l"]); let stdout = test_env.jj_cmd_success(&repo_path, &["l"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }

View File

@ -34,14 +34,14 @@ fn test_branch_multiple_names() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ bar foo 230dd059e1b0 @ bar foo 230dd059e1b0
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["branch", "delete", "foo", "bar"]); let stdout = test_env.jj_cmd_success(&repo_path, &["branch", "delete", "foo", "bar"]);
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
} }
@ -71,13 +71,13 @@ fn test_branch_forget_glob() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ bar-2 foo-1 foo-3 foo-4 230dd059e1b0 @ bar-2 foo-1 foo-3 foo-4 230dd059e1b0
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["branch", "forget", "--glob", "foo-[1-3]"]); let stdout = test_env.jj_cmd_success(&repo_path, &["branch", "forget", "--glob", "foo-[1-3]"]);
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ bar-2 foo-4 230dd059e1b0 @ bar-2 foo-4 230dd059e1b0
o 000000000000 000000000000
"###); "###);
// Forgetting a branch via both explicit name and glob pattern, or with // Forgetting a branch via both explicit name and glob pattern, or with
@ -91,7 +91,7 @@ fn test_branch_forget_glob() {
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ bar-2 230dd059e1b0 @ bar-2 230dd059e1b0
o 000000000000 000000000000
"###); "###);
// Malformed glob // Malformed glob

View File

@ -34,19 +34,19 @@ fn test_checkout() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 05ce7118568d3007efc9163b055f9cb4a6becfde @ 05ce7118568d3007efc9163b055f9cb4a6becfde
o 5c52832c3483e0ace06d047a806024984f28f1d7 second 5c52832c3483e0ace06d047a806024984f28f1d7 second
o 69542c1984c1f9d91f7c6c9c9e6941782c944bd9 first 69542c1984c1f9d91f7c6c9c9e6941782c944bd9 first
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Can provide a description // Can provide a description
test_env.jj_cmd_success(&repo_path, &["checkout", "@--", "-m", "my message"]); test_env.jj_cmd_success(&repo_path, &["checkout", "@--", "-m", "my message"]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 1191baaf276e3d0b96b1747e885b3a517be80d6f my message @ 1191baaf276e3d0b96b1747e885b3a517be80d6f my message
o 5c52832c3483e0ace06d047a806024984f28f1d7 second 5c52832c3483e0ace06d047a806024984f28f1d7 second
o 69542c1984c1f9d91f7c6c9c9e6941782c944bd9 first 69542c1984c1f9d91f7c6c9c9e6941782c944bd9 first
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }

View File

@ -28,8 +28,8 @@ fn test_commit_with_description_from_cli() {
test_env.jj_cmd_success(&workspace_path, &["commit", "-m=first"]); test_env.jj_cmd_success(&workspace_path, &["commit", "-m=first"]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &workspace_path), @r###"
@ b88fb4e51bdd @ b88fb4e51bdd
o 69542c1984c1 first 69542c1984c1 first
o 000000000000 000000000000
"###); "###);
} }
@ -47,8 +47,8 @@ fn test_commit_with_editor() {
test_env.jj_cmd_success(&workspace_path, &["commit"]); test_env.jj_cmd_success(&workspace_path, &["commit"]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &workspace_path), @r###"
@ 3df78bc2b9b5 @ 3df78bc2b9b5
o 30a8c2b3d6eb modified 30a8c2b3d6eb modified
o 000000000000 000000000000
"###); "###);
insta::assert_snapshot!( insta::assert_snapshot!(
std::fs::read_to_string(test_env.env_root().join("editor0")).unwrap(), @r###" std::fs::read_to_string(test_env.env_root().join("editor0")).unwrap(), @r###"

View File

@ -32,11 +32,11 @@ fn test_log_parent_commit_ids() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ c067170d4ca1bc6162b64f7550617ec809647f84 @ c067170d4ca1bc6162b64f7550617ec809647f84
P: 4db490c88528133d579540b6900b8098f0c17701 230dd059e1b059aefc0da06a2e5a7dbf22362f22 P: 4db490c88528133d579540b6900b8098f0c17701 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 4db490c88528133d579540b6900b8098f0c17701 4db490c88528133d579540b6900b8098f0c17701
P: 230dd059e1b059aefc0da06a2e5a7dbf22362f22 P: 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 230dd059e1b059aefc0da06a2e5a7dbf22362f22 230dd059e1b059aefc0da06a2e5a7dbf22362f22
P: 0000000000000000000000000000000000000000 P: 0000000000000000000000000000000000000000
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
P: P:
"###); "###);
} }
@ -53,8 +53,8 @@ fn test_log_author_timestamp() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "author.timestamp()"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "author.timestamp()"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ 2001-02-03 04:05:09.000 +07:00 @ 2001-02-03 04:05:09.000 +07:00
o 2001-02-03 04:05:07.000 +07:00 2001-02-03 04:05:07.000 +07:00
o 1970-01-01 00:00:00.000 +00:00 1970-01-01 00:00:00.000 +00:00
"###); "###);
} }
@ -92,9 +92,9 @@ fn test_log_default() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ kkmpptxzrspx test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178d59d @ kkmpptxzrspx test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178d59d
(empty) description 1 (empty) description 1
o qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97 qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97
add a file add a file
o zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000 zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set) (empty) (no description set)
"###); "###);
@ -103,9 +103,9 @@ fn test_log_default() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ kkmpptxzrspx test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178d59d @ kkmpptxzrspx test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178d59d
(empty) description 1 (empty) description 1
o qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97 qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97
add a file add a file
o zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000 zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set) (empty) (no description set)
"###); "###);
@ -134,7 +134,7 @@ fn test_log_default_divergence() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c @ qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c
description 1 description 1
o zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000 zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set) (empty) (no description set)
"###); "###);
@ -146,22 +146,22 @@ fn test_log_default_divergence() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
Concurrent modification detected, resolving automatically. Concurrent modification detected, resolving automatically.
o qpvuntsmwlqt?? test.user@example.com 2001-02-03 04:05:10.000 +07:00 8979953d4c67 qpvuntsmwlqt?? test.user@example.com 2001-02-03 04:05:10.000 +07:00 8979953d4c67
description 2 description 2
@ qpvuntsmwlqt?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c @ qpvuntsmwlqt?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c
description 1 description 1
o zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000 zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set) (empty) (no description set)
"###); "###);
// Color // Color
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "--color=always"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "--color=always"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
o qpvuntsmwlqt?? test.user@example.com 2001-02-03 04:05:10.000 +07:00 8979953d4c67 qpvuntsmwlqt?? test.user@example.com 2001-02-03 04:05:10.000 +07:00 8979953d4c67
description 2 description 2
@ qpvuntsmwlqt?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c @ qpvuntsmwlqt?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c
description 1 description 1
o zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000 zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set) (empty) (no description set)
"###); "###);
} }
@ -179,9 +179,9 @@ fn test_log_git_head() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:09.000 +07:00 50aaf4754c1e @ rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:09.000 +07:00 50aaf4754c1e
initial initial
o qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:07.000 +07:00 master HEAD@git 230dd059e1b0 qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:07.000 +07:00 master HEAD@git 230dd059e1b0
(empty) (no description set) (empty) (no description set)
o zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000 zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set) (empty) (no description set)
"###); "###);
} }
@ -207,7 +207,7 @@ fn test_log_customize_short_id() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ Q_pvun test.user@example.com 2001-02-03 04:05:08.000 +07:00 6_9542 @ Q_pvun test.user@example.com 2001-02-03 04:05:08.000 +07:00 6_9542
(empty) first (empty) first
o Z_zzzz 1970-01-01 00:00:00.000 +00:00 0_0000 Z_zzzz 1970-01-01 00:00:00.000 +00:00 0_0000
(empty) (no description set) (empty) (no description set)
"###); "###);
@ -226,7 +226,7 @@ fn test_log_customize_short_id() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ QPVUNTSMWLQT test.user@example.com 2001-02-03 04:05:08.000 +07:00 69542c1984c1 @ QPVUNTSMWLQT test.user@example.com 2001-02-03 04:05:08.000 +07:00 69542c1984c1
(empty) first (empty) first
o ZZZZZZZZZZZZ 1970-01-01 00:00:00.000 +00:00 000000000000 ZZZZZZZZZZZZ 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set) (empty) (no description set)
"###); "###);
} }

View File

@ -34,10 +34,10 @@ fn test_concurrent_operation_divergence() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
Concurrent modification detected, resolving automatically. Concurrent modification detected, resolving automatically.
o message 2 message 2
@ message 1 @ message 1
o
"###); "###);
} }
@ -54,12 +54,12 @@ fn test_concurrent_operations_auto_rebase() {
@ cde29280d4a9 test-username@host.example.com 22 years ago, lasted less than a microsecond @ cde29280d4a9 test-username@host.example.com 22 years ago, lasted less than a microsecond
describe commit 123ed18e4c4c0d77428df41112bc02ffc83fb935 describe commit 123ed18e4c4c0d77428df41112bc02ffc83fb935
args: jj describe -m initial args: jj describe -m initial
o 7c212e0863fd test-username@host.example.com 22 years ago, lasted less than a microsecond 7c212e0863fd test-username@host.example.com 22 years ago, lasted less than a microsecond
snapshot working copy snapshot working copy
args: jj describe -m initial args: jj describe -m initial
o a99a3fd5c51e test-username@host.example.com 22 years ago, lasted less than a microsecond a99a3fd5c51e test-username@host.example.com 22 years ago, lasted less than a microsecond
add workspace 'default' add workspace 'default'
o 56b94dfc38e7 test-username@host.example.com 22 years ago, lasted less than a microsecond 56b94dfc38e7 test-username@host.example.com 22 years ago, lasted less than a microsecond
initialize repo initialize repo
"###); "###);
let op_id_hex = stdout[3..15].to_string(); let op_id_hex = stdout[3..15].to_string();
@ -74,9 +74,9 @@ fn test_concurrent_operations_auto_rebase() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
Concurrent modification detected, resolving automatically. Concurrent modification detected, resolving automatically.
Rebased 1 descendant commits onto commits rewritten by other operation Rebased 1 descendant commits onto commits rewritten by other operation
o 3f06323826b4a293a9ee6d24cc0e07ad2961b5d5 new child 3f06323826b4a293a9ee6d24cc0e07ad2961b5d5 new child
@ d91437157468ec86bbbc9e6a14a60d3e8d1790ac rewritten @ d91437157468ec86bbbc9e6a14a60d3e8d1790ac rewritten
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }
@ -105,10 +105,10 @@ fn test_concurrent_operations_wc_modified() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
Concurrent modification detected, resolving automatically. Concurrent modification detected, resolving automatically.
@ 4eb0610031b7cd148ff9f729a673a3f815033170 new child1 @ 4eb0610031b7cd148ff9f729a673a3f815033170 new child1
o 4b20e61d23ee7d7c4d5e61e11e97c26e716f9c30 new child2 4b20e61d23ee7d7c4d5e61e11e97c26e716f9c30 new child2
o 52c893bf3cd201e215b23e084e8a871244ca14d5 initial 52c893bf3cd201e215b23e084e8a871244ca14d5 initial
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "--git"]); let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "--git"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ -125,15 +125,15 @@ fn test_concurrent_operations_wc_modified() {
let stdout = test_env.jj_cmd_success(&repo_path, &["op", "log", "-Tdescription"]); let stdout = test_env.jj_cmd_success(&repo_path, &["op", "log", "-Tdescription"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ snapshot working copy @ snapshot working copy
o resolve concurrent operations resolve concurrent operations
o new empty commit new empty commit
o new empty commit new empty commit
o describe commit cf911c223d3e24e001fc8264d6dbf0610804fc40 describe commit cf911c223d3e24e001fc8264d6dbf0610804fc40
o snapshot working copy snapshot working copy
o add workspace 'default' add workspace 'default'
o initialize repo initialize repo
"###); "###);
} }

View File

@ -43,10 +43,10 @@ fn test_duplicate() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 17a00fc21654 c @ 17a00fc21654 c
o d370aee184ba b d370aee184ba b
o 2443ea76b0b1 a 2443ea76b0b1 a
o 000000000000 000000000000
"###); "###);
let stderr = test_env.jj_cmd_failure(&repo_path, &["duplicate", "root"]); let stderr = test_env.jj_cmd_failure(&repo_path, &["duplicate", "root"]);
@ -59,14 +59,14 @@ fn test_duplicate() {
Duplicated 2443ea76b0b1 as 2f6dc5a1ffc2 a Duplicated 2443ea76b0b1 as 2f6dc5a1ffc2 a
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 2f6dc5a1ffc2 a 2f6dc5a1ffc2 a
@ 17a00fc21654 c @ 17a00fc21654 c
o d370aee184ba b d370aee184ba b
o 2443ea76b0b1 a 2443ea76b0b1 a
o 000000000000 000000000000
"###); "###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["undo"]), @""); insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["undo"]), @"");
@ -75,14 +75,14 @@ fn test_duplicate() {
Duplicated 17a00fc21654 as 1dd099ea963c c Duplicated 17a00fc21654 as 1dd099ea963c c
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 1dd099ea963c c 1dd099ea963c c
@ 17a00fc21654 c @ 17a00fc21654 c
o d370aee184ba b d370aee184ba b
o 2443ea76b0b1 a 2443ea76b0b1 a
o 000000000000 000000000000
"###); "###);
} }
@ -101,12 +101,12 @@ fn test_duplicate_many() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 921dde6e55c0 e @ 921dde6e55c0 e
o ebd06dba20ec d ebd06dba20ec d
o c0cb3a0b73e7 c c0cb3a0b73e7 c
o 1394f625cbbd b 1394f625cbbd b
o 2443ea76b0b1 a 2443ea76b0b1 a
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["duplicate", "b:"]); let stdout = test_env.jj_cmd_success(&repo_path, &["duplicate", "b:"]);
@ -115,18 +115,18 @@ fn test_duplicate_many() {
Duplicated 921dde6e55c0 as 8348ddcec733 e Duplicated 921dde6e55c0 as 8348ddcec733 e
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 8348ddcec733 e 8348ddcec733 e
o 3b74d9691015 b 3b74d9691015 b
@ 921dde6e55c0 e @ 921dde6e55c0 e
o ebd06dba20ec d ebd06dba20ec d
o c0cb3a0b73e7 c c0cb3a0b73e7 c
o 1394f625cbbd b 1394f625cbbd b
o 2443ea76b0b1 a 2443ea76b0b1 a
o 000000000000 000000000000
"###); "###);
// Try specifying the same commit twice directly // Try specifying the same commit twice directly
@ -136,16 +136,16 @@ fn test_duplicate_many() {
Duplicated 1394f625cbbd as 0276d3d7c24d b Duplicated 1394f625cbbd as 0276d3d7c24d b
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 0276d3d7c24d b 0276d3d7c24d b
@ 921dde6e55c0 e @ 921dde6e55c0 e
o ebd06dba20ec d ebd06dba20ec d
o c0cb3a0b73e7 c c0cb3a0b73e7 c
o 1394f625cbbd b 1394f625cbbd b
o 2443ea76b0b1 a 2443ea76b0b1 a
o 000000000000 000000000000
"###); "###);
// Try specifying the same commit twice indirectly // Try specifying the same commit twice indirectly
@ -157,20 +157,20 @@ fn test_duplicate_many() {
Duplicated 921dde6e55c0 as 0f7430f2727a e Duplicated 921dde6e55c0 as 0f7430f2727a e
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 0f7430f2727a e 0f7430f2727a e
o 2181781b4f81 d 2181781b4f81 d
o fa167d18a83a b fa167d18a83a b
@ 921dde6e55c0 e @ 921dde6e55c0 e
o ebd06dba20ec d ebd06dba20ec d
o c0cb3a0b73e7 c c0cb3a0b73e7 c
o 1394f625cbbd b 1394f625cbbd b
o 2443ea76b0b1 a 2443ea76b0b1 a
o 000000000000 000000000000
"###); "###);
test_env.jj_cmd_success(&repo_path, &["undo"]); test_env.jj_cmd_success(&repo_path, &["undo"]);
@ -178,12 +178,12 @@ fn test_duplicate_many() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 921dde6e55c0 e @ 921dde6e55c0 e
o ebd06dba20ec d ebd06dba20ec d
o c0cb3a0b73e7 c c0cb3a0b73e7 c
o 1394f625cbbd b 1394f625cbbd b
o 2443ea76b0b1 a 2443ea76b0b1 a
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["duplicate", "d:", "a"]); let stdout = test_env.jj_cmd_success(&repo_path, &["duplicate", "d:", "a"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ -192,20 +192,20 @@ fn test_duplicate_many() {
Duplicated 921dde6e55c0 as 9bd4389f5d47 e Duplicated 921dde6e55c0 as 9bd4389f5d47 e
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 9bd4389f5d47 e 9bd4389f5d47 e
o d94e4c55a68b d d94e4c55a68b d
o c6f7f8c4512e a c6f7f8c4512e a
@ 921dde6e55c0 e @ 921dde6e55c0 e
o ebd06dba20ec d ebd06dba20ec d
o c0cb3a0b73e7 c c0cb3a0b73e7 c
o 1394f625cbbd b 1394f625cbbd b
o 2443ea76b0b1 a 2443ea76b0b1 a
o 000000000000 000000000000
"###); "###);
// Check for BUG -- makes too many 'a'-s, etc. // Check for BUG -- makes too many 'a'-s, etc.
@ -219,22 +219,22 @@ fn test_duplicate_many() {
Duplicated 921dde6e55c0 as ee8fe64ed254 e Duplicated 921dde6e55c0 as ee8fe64ed254 e
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o ee8fe64ed254 e ee8fe64ed254 e
o 2f2442db08eb d 2f2442db08eb d
o df53fa589286 c df53fa589286 c
o e13ac0adabdf b e13ac0adabdf b
o 0fe67a05989e a 0fe67a05989e a
@ 921dde6e55c0 e @ 921dde6e55c0 e
o ebd06dba20ec d ebd06dba20ec d
o c0cb3a0b73e7 c c0cb3a0b73e7 c
o 1394f625cbbd b 1394f625cbbd b
o 2443ea76b0b1 a 2443ea76b0b1 a
o 000000000000 000000000000
"###); "###);
} }
@ -248,7 +248,7 @@ fn test_undo_after_duplicate() {
create_commit(&test_env, &repo_path, "a", &[]); create_commit(&test_env, &repo_path, "a", &[]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 2443ea76b0b1 a @ 2443ea76b0b1 a
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["duplicate", "a"]); let stdout = test_env.jj_cmd_success(&repo_path, &["duplicate", "a"]);
@ -256,16 +256,16 @@ fn test_undo_after_duplicate() {
Duplicated 2443ea76b0b1 as f5cefcbb65a4 a Duplicated 2443ea76b0b1 as f5cefcbb65a4 a
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o f5cefcbb65a4 a f5cefcbb65a4 a
@ 2443ea76b0b1 a @ 2443ea76b0b1 a
o 000000000000 000000000000
"###); "###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["undo"]), @""); insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["undo"]), @"");
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 2443ea76b0b1 a @ 2443ea76b0b1 a
o 000000000000 000000000000
"###); "###);
} }
@ -281,8 +281,8 @@ fn test_rebase_duplicates() {
// Test the setup // Test the setup
insta::assert_snapshot!(get_log_output_with_ts(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output_with_ts(&test_env, &repo_path), @r###"
@ 1394f625cbbd b @ 2001-02-03 04:05:11.000 +07:00 @ 1394f625cbbd b @ 2001-02-03 04:05:11.000 +07:00
o 2443ea76b0b1 a @ 2001-02-03 04:05:09.000 +07:00 2443ea76b0b1 a @ 2001-02-03 04:05:09.000 +07:00
o 000000000000 @ 1970-01-01 00:00:00.000 +00:00 000000000000 @ 1970-01-01 00:00:00.000 +00:00
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["duplicate", "b"]); let stdout = test_env.jj_cmd_success(&repo_path, &["duplicate", "b"]);
@ -294,13 +294,13 @@ fn test_rebase_duplicates() {
Duplicated 1394f625cbbd as 870cf438ccbb b Duplicated 1394f625cbbd as 870cf438ccbb b
"###); "###);
insta::assert_snapshot!(get_log_output_with_ts(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output_with_ts(&test_env, &repo_path), @r###"
o 870cf438ccbb b @ 2001-02-03 04:05:14.000 +07:00 870cf438ccbb b @ 2001-02-03 04:05:14.000 +07:00
o fdaaf3950f07 b @ 2001-02-03 04:05:13.000 +07:00 fdaaf3950f07 b @ 2001-02-03 04:05:13.000 +07:00
@ 1394f625cbbd b @ 2001-02-03 04:05:11.000 +07:00 @ 1394f625cbbd b @ 2001-02-03 04:05:11.000 +07:00
o 2443ea76b0b1 a @ 2001-02-03 04:05:09.000 +07:00 2443ea76b0b1 a @ 2001-02-03 04:05:09.000 +07:00
o 000000000000 @ 1970-01-01 00:00:00.000 +00:00 000000000000 @ 1970-01-01 00:00:00.000 +00:00
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-s", "a", "-d", "a-"]); let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-s", "a", "-d", "a-"]);
@ -311,13 +311,13 @@ fn test_rebase_duplicates() {
// Some of the duplicate commits' timestamps were changed a little to make them // Some of the duplicate commits' timestamps were changed a little to make them
// have distinct commit ids. // have distinct commit ids.
insta::assert_snapshot!(get_log_output_with_ts(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output_with_ts(&test_env, &repo_path), @r###"
o b43fe7354758 b @ 2001-02-03 04:05:14.000 +07:00 b43fe7354758 b @ 2001-02-03 04:05:14.000 +07:00
o 08beb14c3ead b @ 2001-02-03 04:05:15.000 +07:00 08beb14c3ead b @ 2001-02-03 04:05:15.000 +07:00
@ 29bd36b60e60 b @ 2001-02-03 04:05:16.000 +07:00 @ 29bd36b60e60 b @ 2001-02-03 04:05:16.000 +07:00
o 2f6dc5a1ffc2 a @ 2001-02-03 04:05:16.000 +07:00 2f6dc5a1ffc2 a @ 2001-02-03 04:05:16.000 +07:00
o 000000000000 @ 1970-01-01 00:00:00.000 +00:00 000000000000 @ 1970-01-01 00:00:00.000 +00:00
"###); "###);
} }

View File

@ -46,9 +46,9 @@ fn test_edit() {
Added 0 files, modified 1 files, removed 0 files Added 0 files, modified 1 files, removed 0 files
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o b2f7e9c549aa second b2f7e9c549aa second
@ f41390a5efbf first @ f41390a5efbf first
o 000000000000 000000000000
"###); "###);
insta::assert_snapshot!(read_file(&repo_path.join("file1")), @"0"); insta::assert_snapshot!(read_file(&repo_path.join("file1")), @"0");
@ -56,9 +56,9 @@ fn test_edit() {
std::fs::write(repo_path.join("file2"), "0").unwrap(); std::fs::write(repo_path.join("file2"), "0").unwrap();
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
Rebased 1 descendant commits onto updated working copy Rebased 1 descendant commits onto updated working copy
o 51d937a3eeb4 second 51d937a3eeb4 second
@ 409306de8f44 first @ 409306de8f44 first
o 000000000000 000000000000
"###); "###);
} }
@ -75,9 +75,9 @@ fn test_edit_current_wc_commit_missing() {
test_env.jj_cmd_success(&repo_path, &["describe", "-m", "second"]); test_env.jj_cmd_success(&repo_path, &["describe", "-m", "second"]);
test_env.jj_cmd_success(&repo_path, &["edit", "@-"]); test_env.jj_cmd_success(&repo_path, &["edit", "@-"]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 5c52832c3483 second 5c52832c3483 second
@ 69542c1984c1 first @ 69542c1984c1 first
o 000000000000 000000000000
"###); "###);
// Make the Git backend fail to read the current working copy commit // Make the Git backend fail to read the current working copy commit

View File

@ -60,8 +60,8 @@ fn test_git_colocated() {
test_env.jj_cmd_success(&workspace_root, &["init", "--git-repo", "."]); test_env.jj_cmd_success(&workspace_root, &["init", "--git-repo", "."]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###" insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ 3e9369cd54227eb88455e1834dbc08aad6a16ac4 @ 3e9369cd54227eb88455e1834dbc08aad6a16ac4
o e61b6729ff4292870702f2f72b2a60165679ef37 master e61b6729ff4292870702f2f72b2a60165679ef37 master
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
insta::assert_snapshot!( insta::assert_snapshot!(
git_repo.head().unwrap().peel_to_commit().unwrap().id().to_string(), git_repo.head().unwrap().peel_to_commit().unwrap().id().to_string(),
@ -73,8 +73,8 @@ fn test_git_colocated() {
std::fs::write(workspace_root.join("file"), "modified").unwrap(); std::fs::write(workspace_root.join("file"), "modified").unwrap();
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###" insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ b26951a9c6f5c270e4d039880208952fd5faae5e @ b26951a9c6f5c270e4d039880208952fd5faae5e
o e61b6729ff4292870702f2f72b2a60165679ef37 master e61b6729ff4292870702f2f72b2a60165679ef37 master
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
insta::assert_snapshot!( insta::assert_snapshot!(
git_repo.head().unwrap().peel_to_commit().unwrap().id().to_string(), git_repo.head().unwrap().peel_to_commit().unwrap().id().to_string(),
@ -85,9 +85,9 @@ fn test_git_colocated() {
test_env.jj_cmd_success(&workspace_root, &["new"]); test_env.jj_cmd_success(&workspace_root, &["new"]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###" insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ 9dbb23ff2ff5e66c43880f1042369d704f7a321e @ 9dbb23ff2ff5e66c43880f1042369d704f7a321e
o b26951a9c6f5c270e4d039880208952fd5faae5e b26951a9c6f5c270e4d039880208952fd5faae5e
o e61b6729ff4292870702f2f72b2a60165679ef37 master e61b6729ff4292870702f2f72b2a60165679ef37 master
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
insta::assert_snapshot!( insta::assert_snapshot!(
git_repo.head().unwrap().target().unwrap().to_string(), git_repo.head().unwrap().target().unwrap().to_string(),
@ -110,7 +110,7 @@ fn test_git_colocated_export_branches_on_snapshot() {
test_env.jj_cmd_success(&workspace_root, &["branch", "create", "foo"]); test_env.jj_cmd_success(&workspace_root, &["branch", "create", "foo"]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###" insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ 438471f3fbf1004298d8fb01eeb13663a051a643 foo @ 438471f3fbf1004298d8fb01eeb13663a051a643 foo
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// The branch gets updated when we modify the working copy, and it should get // The branch gets updated when we modify the working copy, and it should get
@ -118,7 +118,7 @@ fn test_git_colocated_export_branches_on_snapshot() {
std::fs::write(workspace_root.join("file"), "modified").unwrap(); std::fs::write(workspace_root.join("file"), "modified").unwrap();
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###" insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ fab22d1acf5bb9c5aa48cb2c3dd2132072a359ca foo @ fab22d1acf5bb9c5aa48cb2c3dd2132072a359ca foo
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
insta::assert_snapshot!(git_repo insta::assert_snapshot!(git_repo
.find_reference("refs/heads/foo") .find_reference("refs/heads/foo")
@ -159,8 +159,8 @@ fn test_git_colocated_rebase_on_import() {
git_repo.set_head("refs/heads/master").unwrap(); git_repo.set_head("refs/heads/master").unwrap();
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###" insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ 7f96185cfbe36341d0f9a86ebfaeab67a5922c7e @ 7f96185cfbe36341d0f9a86ebfaeab67a5922c7e
o 4bcbeaba9a4b309c5f45a8807fbf5499b9714315 master 4bcbeaba9a4b309c5f45a8807fbf5499b9714315 master
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }
@ -174,10 +174,10 @@ fn test_git_colocated_branches() {
test_env.jj_cmd_success(&workspace_root, &["new", "@-", "-m", "bar"]); test_env.jj_cmd_success(&workspace_root, &["new", "@-", "-m", "bar"]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###" insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ 3560559274ab431feea00b7b7e0b9250ecce951f @ 3560559274ab431feea00b7b7e0b9250ecce951f
o 1e6f0b403ed2ff9713b5d6b1dc601e4804250cda 1e6f0b403ed2ff9713b5d6b1dc601e4804250cda
o 230dd059e1b059aefc0da06a2e5a7dbf22362f22 master 230dd059e1b059aefc0da06a2e5a7dbf22362f22 master
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Create a branch in jj. It should be exported to Git even though it points to // Create a branch in jj. It should be exported to Git even though it points to
@ -204,10 +204,10 @@ fn test_git_colocated_branches() {
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###" insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
Working copy now at: eb08b363bb5e (no description set) Working copy now at: eb08b363bb5e (no description set)
@ eb08b363bb5ef8ee549314260488980d7bbe8f63 @ eb08b363bb5ef8ee549314260488980d7bbe8f63
o 1e6f0b403ed2ff9713b5d6b1dc601e4804250cda master 1e6f0b403ed2ff9713b5d6b1dc601e4804250cda master
o 230dd059e1b059aefc0da06a2e5a7dbf22362f22 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }
@ -249,9 +249,9 @@ fn test_git_colocated_fetch_deleted_branch() {
test_env.jj_cmd_success(&clone_path, &["init", "--git-repo=."]); test_env.jj_cmd_success(&clone_path, &["init", "--git-repo=."]);
insta::assert_snapshot!(get_log_output(&test_env, &clone_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &clone_path), @r###"
@ bc7d08e8de9b7bc248b9358a05e96f1671bbd4d9 @ bc7d08e8de9b7bc248b9358a05e96f1671bbd4d9
o e1f4268fabd2c84e880c5eb5bd87e076180fc8e3 B e1f4268fabd2c84e880c5eb5bd87e076180fc8e3 B
o a86754f975f953fa25da4265764adc0c62e9ce6b A master a86754f975f953fa25da4265764adc0c62e9ce6b A master
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
test_env.jj_cmd_success(&origin_path, &["branch", "delete", "B"]); test_env.jj_cmd_success(&origin_path, &["branch", "delete", "B"]);
@ -260,9 +260,9 @@ fn test_git_colocated_fetch_deleted_branch() {
// TODO: e1f4 should have been abandoned (#864) // TODO: e1f4 should have been abandoned (#864)
insta::assert_snapshot!(get_log_output(&test_env, &clone_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &clone_path), @r###"
@ bc7d08e8de9b7bc248b9358a05e96f1671bbd4d9 @ bc7d08e8de9b7bc248b9358a05e96f1671bbd4d9
o e1f4268fabd2c84e880c5eb5bd87e076180fc8e3 e1f4268fabd2c84e880c5eb5bd87e076180fc8e3
o a86754f975f953fa25da4265764adc0c62e9ce6b A master a86754f975f953fa25da4265764adc0c62e9ce6b A master
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }
@ -276,25 +276,25 @@ fn test_git_colocated_squash_undo() {
// Test the setup // Test the setup
insta::assert_snapshot!(get_log_output_divergence(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output_divergence(&test_env, &repo_path), @r###"
@ rlvkpnrzqnoo 8f71e3b6a3be @ rlvkpnrzqnoo 8f71e3b6a3be
o qpvuntsmwlqt a86754f975f9 A master qpvuntsmwlqt a86754f975f9 A master
o zzzzzzzzzzzz 000000000000 zzzzzzzzzzzz 000000000000
"###); "###);
test_env.jj_cmd_success(&repo_path, &["squash"]); test_env.jj_cmd_success(&repo_path, &["squash"]);
insta::assert_snapshot!(get_log_output_divergence(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output_divergence(&test_env, &repo_path), @r###"
@ zsuskulnrvyr f0c12b0396d9 @ zsuskulnrvyr f0c12b0396d9
o qpvuntsmwlqt 2f376ea1478c A master qpvuntsmwlqt 2f376ea1478c A master
o zzzzzzzzzzzz 000000000000 zzzzzzzzzzzz 000000000000
"###); "###);
test_env.jj_cmd_success(&repo_path, &["undo"]); test_env.jj_cmd_success(&repo_path, &["undo"]);
// TODO: There should be no divergence here; 2f376ea1478c should be hidden // TODO: There should be no divergence here; 2f376ea1478c should be hidden
// (#922) // (#922)
insta::assert_snapshot!(get_log_output_divergence(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output_divergence(&test_env, &repo_path), @r###"
o qpvuntsmwlqt 2f376ea1478c A master !divergence! qpvuntsmwlqt 2f376ea1478c A master !divergence!
@ rlvkpnrzqnoo 8f71e3b6a3be @ rlvkpnrzqnoo 8f71e3b6a3be
o qpvuntsmwlqt a86754f975f9 A !divergence! qpvuntsmwlqt a86754f975f9 A !divergence!
o zzzzzzzzzzzz 000000000000 zzzzzzzzzzzz 000000000000
"###); "###);
} }
@ -373,8 +373,8 @@ fn test_git_colocated_unreachable_commits() {
test_env.jj_cmd_success(&workspace_root, &["init", "--git-repo", "."]); test_env.jj_cmd_success(&workspace_root, &["init", "--git-repo", "."]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###" insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ 66ae47cee4f8c28ee8d7e4f5d9401b03c07e22f2 @ 66ae47cee4f8c28ee8d7e4f5d9401b03c07e22f2
o 2ee37513d2b5e549f7478c671a780053614bff19 master 2ee37513d2b5e549f7478c671a780053614bff19 master
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
insta::assert_snapshot!( insta::assert_snapshot!(
git_repo.head().unwrap().peel_to_commit().unwrap().id().to_string(), git_repo.head().unwrap().peel_to_commit().unwrap().id().to_string(),

View File

@ -308,18 +308,18 @@ fn test_git_fetch_all() {
insta::assert_snapshot!(source_log, @r###" insta::assert_snapshot!(source_log, @r###"
===== Source git repo contents ===== ===== Source git repo contents =====
@ c7d4bdcbc215 descr_for_b b @ c7d4bdcbc215 descr_for_b b
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
o 000000000000 000000000000
"###); "###);
// Nothing in our repo before the fetch // Nothing in our repo before the fetch
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
insta::assert_snapshot!(get_branch_output(&test_env, &target_jj_repo_path), @""); insta::assert_snapshot!(get_branch_output(&test_env, &target_jj_repo_path), @"");
insta::assert_snapshot!(test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch"]), @""); insta::assert_snapshot!(test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch"]), @"");
@ -331,15 +331,15 @@ fn test_git_fetch_all() {
trunk1: ff36dc55760e descr_for_trunk1 trunk1: ff36dc55760e descr_for_trunk1
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o c7d4bdcbc215 descr_for_b b c7d4bdcbc215 descr_for_b b
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
// ==== Change both repos ==== // ==== Change both repos ====
@ -347,14 +347,14 @@ fn test_git_fetch_all() {
let source_log = create_trunk2_and_rebase_branches(&test_env, &source_git_repo_path); let source_log = create_trunk2_and_rebase_branches(&test_env, &source_git_repo_path);
insta::assert_snapshot!(source_log, @r###" insta::assert_snapshot!(source_log, @r###"
===== Source git repo contents ===== ===== Source git repo contents =====
o babc49226c14 descr_for_b b babc49226c14 descr_for_b b
o 91e46b4b2653 descr_for_a2 a2 91e46b4b2653 descr_for_a2 a2
o 0424f6dfc1ff descr_for_a1 a1 0424f6dfc1ff descr_for_a1 a1
@ 8f1f14fbbf42 descr_for_trunk2 trunk2 @ 8f1f14fbbf42 descr_for_trunk2 trunk2
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
o 000000000000 000000000000
"###); "###);
// Change a branch in the source repo as well, so that it becomes conflicted. // Change a branch in the source repo as well, so that it becomes conflicted.
test_env.jj_cmd_success( test_env.jj_cmd_success(
@ -364,15 +364,15 @@ fn test_git_fetch_all() {
// Our repo before and after fetch // Our repo before and after fetch
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o 061eddbb43ab new_descr_for_b_to_create_conflict b* 061eddbb43ab new_descr_for_b_to_create_conflict b*
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
insta::assert_snapshot!(get_branch_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_branch_output(&test_env, &target_jj_repo_path), @r###"
a1: 359a9a02457d descr_for_a1 a1: 359a9a02457d descr_for_a1
@ -396,18 +396,18 @@ fn test_git_fetch_all() {
trunk2: 8f1f14fbbf42 descr_for_trunk2 trunk2: 8f1f14fbbf42 descr_for_trunk2
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o babc49226c14 descr_for_b b?? b@origin babc49226c14 descr_for_b b?? b@origin
o 91e46b4b2653 descr_for_a2 a2 91e46b4b2653 descr_for_a2 a2
o 0424f6dfc1ff descr_for_a1 a1 0424f6dfc1ff descr_for_a1 a1
o 8f1f14fbbf42 descr_for_trunk2 trunk2 8f1f14fbbf42 descr_for_trunk2 trunk2
o 061eddbb43ab new_descr_for_b_to_create_conflict b?? 061eddbb43ab new_descr_for_b_to_create_conflict b??
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
} }
@ -431,12 +431,12 @@ fn test_git_fetch_some_of_many_branches() {
insta::assert_snapshot!(source_log, @r###" insta::assert_snapshot!(source_log, @r###"
===== Source git repo contents ===== ===== Source git repo contents =====
@ c7d4bdcbc215 descr_for_b b @ c7d4bdcbc215 descr_for_b b
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
o 000000000000 000000000000
"###); "###);
// Test an error message // Test an error message
@ -449,17 +449,17 @@ fn test_git_fetch_some_of_many_branches() {
// Nothing in our repo before the fetch // Nothing in our repo before the fetch
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
// Fetch one branch... // Fetch one branch...
let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch", "--branch", "b"]); let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch", "--branch", "b"]);
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o c7d4bdcbc215 descr_for_b b c7d4bdcbc215 descr_for_b b
o ff36dc55760e descr_for_trunk1 ff36dc55760e descr_for_trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
// ...check what the intermediate state looks like... // ...check what the intermediate state looks like...
insta::assert_snapshot!(get_branch_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_branch_output(&test_env, &target_jj_repo_path), @r###"
@ -469,15 +469,15 @@ fn test_git_fetch_some_of_many_branches() {
let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch", "--branch", "a*"]); let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch", "--branch", "a*"]);
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o c7d4bdcbc215 descr_for_b b c7d4bdcbc215 descr_for_b b
o ff36dc55760e descr_for_trunk1 ff36dc55760e descr_for_trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
// Fetching the same branch again // Fetching the same branch again
let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch", "--branch", "a1"]); let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch", "--branch", "a1"]);
@ -485,15 +485,15 @@ fn test_git_fetch_some_of_many_branches() {
Nothing changed. Nothing changed.
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o c7d4bdcbc215 descr_for_b b c7d4bdcbc215 descr_for_b b
o ff36dc55760e descr_for_trunk1 ff36dc55760e descr_for_trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
// ==== Change both repos ==== // ==== Change both repos ====
@ -501,14 +501,14 @@ fn test_git_fetch_some_of_many_branches() {
let source_log = create_trunk2_and_rebase_branches(&test_env, &source_git_repo_path); let source_log = create_trunk2_and_rebase_branches(&test_env, &source_git_repo_path);
insta::assert_snapshot!(source_log, @r###" insta::assert_snapshot!(source_log, @r###"
===== Source git repo contents ===== ===== Source git repo contents =====
o 13ac032802f1 descr_for_b b 13ac032802f1 descr_for_b b
o 010977d69c5b descr_for_a2 a2 010977d69c5b descr_for_a2 a2
o 6f4e1c4dfe29 descr_for_a1 a1 6f4e1c4dfe29 descr_for_a1 a1
@ 09430ba04a82 descr_for_trunk2 trunk2 @ 09430ba04a82 descr_for_trunk2 trunk2
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
o 000000000000 000000000000
"###); "###);
// Change a branch in the source repo as well, so that it becomes conflicted. // Change a branch in the source repo as well, so that it becomes conflicted.
test_env.jj_cmd_success( test_env.jj_cmd_success(
@ -518,15 +518,15 @@ fn test_git_fetch_some_of_many_branches() {
// Our repo before and after fetch of two branches // Our repo before and after fetch of two branches
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o 2be688d8c664 new_descr_for_b_to_create_conflict b* 2be688d8c664 new_descr_for_b_to_create_conflict b*
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o ff36dc55760e descr_for_trunk1 ff36dc55760e descr_for_trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success( let stdout = test_env.jj_cmd_success(
&target_jj_repo_path, &target_jj_repo_path,
@ -534,18 +534,18 @@ fn test_git_fetch_some_of_many_branches() {
); );
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o 13ac032802f1 descr_for_b b?? b@origin 13ac032802f1 descr_for_b b?? b@origin
o 6f4e1c4dfe29 descr_for_a1 a1 6f4e1c4dfe29 descr_for_a1 a1
o 09430ba04a82 descr_for_trunk2 09430ba04a82 descr_for_trunk2
o 2be688d8c664 new_descr_for_b_to_create_conflict b?? 2be688d8c664 new_descr_for_b_to_create_conflict b??
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o ff36dc55760e descr_for_trunk1 ff36dc55760e descr_for_trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
// We left a2 where it was before, let's see how `jj branch list` sees this. // We left a2 where it was before, let's see how `jj branch list` sees this.
@ -566,18 +566,18 @@ fn test_git_fetch_some_of_many_branches() {
); );
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o 010977d69c5b descr_for_a2 a2 010977d69c5b descr_for_a2 a2
o 13ac032802f1 descr_for_b b?? b@origin 13ac032802f1 descr_for_b b?? b@origin
o 6f4e1c4dfe29 descr_for_a1 a1 6f4e1c4dfe29 descr_for_a1 a1
o 09430ba04a82 descr_for_trunk2 09430ba04a82 descr_for_trunk2
o 2be688d8c664 new_descr_for_b_to_create_conflict b?? 2be688d8c664 new_descr_for_b_to_create_conflict b??
o ff36dc55760e descr_for_trunk1 ff36dc55760e descr_for_trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
insta::assert_snapshot!(get_branch_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_branch_output(&test_env, &target_jj_repo_path), @r###"
a1: 6f4e1c4dfe29 descr_for_a1 a1: 6f4e1c4dfe29 descr_for_a1
@ -610,12 +610,12 @@ fn test_git_fetch_undo() {
insta::assert_snapshot!(source_log, @r###" insta::assert_snapshot!(source_log, @r###"
===== Source git repo contents ===== ===== Source git repo contents =====
@ c7d4bdcbc215 descr_for_b b @ c7d4bdcbc215 descr_for_b b
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
o 000000000000 000000000000
"###); "###);
// Fetch 2 branches // Fetch 2 branches
@ -625,29 +625,29 @@ fn test_git_fetch_undo() {
); );
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o c7d4bdcbc215 descr_for_b b c7d4bdcbc215 descr_for_b b
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o ff36dc55760e descr_for_trunk1 ff36dc55760e descr_for_trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
insta::assert_snapshot!(test_env.jj_cmd_success(&target_jj_repo_path, &["undo"]), @""); insta::assert_snapshot!(test_env.jj_cmd_success(&target_jj_repo_path, &["undo"]), @"");
// The undo works as expected // The undo works as expected
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
// Now try to fetch just one branch // Now try to fetch just one branch
let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch", "--branch", "b"]); let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch", "--branch", "b"]);
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o c7d4bdcbc215 descr_for_b b c7d4bdcbc215 descr_for_b b
o ff36dc55760e descr_for_trunk1 ff36dc55760e descr_for_trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
} }
@ -749,27 +749,27 @@ fn test_git_fetch_removed_branch() {
insta::assert_snapshot!(source_log, @r###" insta::assert_snapshot!(source_log, @r###"
===== Source git repo contents ===== ===== Source git repo contents =====
@ c7d4bdcbc215 descr_for_b b @ c7d4bdcbc215 descr_for_b b
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
o 000000000000 000000000000
"###); "###);
// Fetch all branches // Fetch all branches
let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch"]); let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch"]);
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o c7d4bdcbc215 descr_for_b b c7d4bdcbc215 descr_for_b b
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
// Remove a2 branch in origin // Remove a2 branch in origin
@ -781,28 +781,28 @@ fn test_git_fetch_removed_branch() {
Nothing changed. Nothing changed.
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o c7d4bdcbc215 descr_for_b b c7d4bdcbc215 descr_for_b b
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
// Fetch branches a2 from origin, and check that it has been removed locally // Fetch branches a2 from origin, and check that it has been removed locally
let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch", "--branch", "a2"]); let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch", "--branch", "a2"]);
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o c7d4bdcbc215 descr_for_b b c7d4bdcbc215 descr_for_b b
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
} }
@ -826,27 +826,27 @@ fn test_git_fetch_removed_parent_branch() {
insta::assert_snapshot!(source_log, @r###" insta::assert_snapshot!(source_log, @r###"
===== Source git repo contents ===== ===== Source git repo contents =====
@ c7d4bdcbc215 descr_for_b b @ c7d4bdcbc215 descr_for_b b
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
o 000000000000 000000000000
"###); "###);
// Fetch all branches // Fetch all branches
let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch"]); let stdout = test_env.jj_cmd_success(&target_jj_repo_path, &["git", "fetch"]);
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o c7d4bdcbc215 descr_for_b b c7d4bdcbc215 descr_for_b b
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o 359a9a02457d descr_for_a1 a1 359a9a02457d descr_for_a1 a1
o ff36dc55760e descr_for_trunk1 master trunk1 ff36dc55760e descr_for_trunk1 master trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
// Remove all branches in origin. // Remove all branches in origin.
@ -863,12 +863,12 @@ fn test_git_fetch_removed_parent_branch() {
); );
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &target_jj_repo_path), @r###"
o c7d4bdcbc215 descr_for_b b c7d4bdcbc215 descr_for_b b
o decaa3966c83 descr_for_a2 a2 decaa3966c83 descr_for_a2 a2
o ff36dc55760e descr_for_trunk1 ff36dc55760e descr_for_trunk1
@ 230dd059e1b0 @ 230dd059e1b0
o 000000000000 000000000000
"###); "###);
} }

View File

@ -74,7 +74,7 @@ fn test_ignore_working_copy() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ 438471f3fbf1004298d8fb01eeb13663a051a643 @ 438471f3fbf1004298d8fb01eeb13663a051a643
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Modify the file. With --ignore-working-copy, we still get the same commit // Modify the file. With --ignore-working-copy, we still get the same commit
@ -90,7 +90,7 @@ fn test_ignore_working_copy() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ fab22d1acf5bb9c5aa48cb2c3dd2132072a359ca @ fab22d1acf5bb9c5aa48cb2c3dd2132072a359ca
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }
@ -214,7 +214,7 @@ fn test_color_config() {
let stdout = test_env.jj_cmd_success(&repo_path, &["--color=always", "log", "-T", "commit_id"]); let stdout = test_env.jj_cmd_success(&repo_path, &["--color=always", "log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22 @ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Test that color is used if it's requested in the config file // Test that color is used if it's requested in the config file
@ -222,21 +222,21 @@ fn test_color_config() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22 @ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Test that --color=never overrides the config. // Test that --color=never overrides the config.
let stdout = test_env.jj_cmd_success(&repo_path, &["--color=never", "log", "-T", "commit_id"]); let stdout = test_env.jj_cmd_success(&repo_path, &["--color=never", "log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22 @ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Test that --color=auto overrides the config. // Test that --color=auto overrides the config.
let stdout = test_env.jj_cmd_success(&repo_path, &["--color=auto", "log", "-T", "commit_id"]); let stdout = test_env.jj_cmd_success(&repo_path, &["--color=auto", "log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22 @ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Test that --config-toml 'ui.color="never"' overrides the config. // Test that --config-toml 'ui.color="never"' overrides the config.
@ -252,7 +252,7 @@ fn test_color_config() {
); );
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22 @ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// --color overrides --config-toml 'ui.color=...'. // --color overrides --config-toml 'ui.color=...'.
@ -270,7 +270,7 @@ fn test_color_config() {
); );
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22 @ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Test that NO_COLOR does NOT override the request for color in the config file // Test that NO_COLOR does NOT override the request for color in the config file
@ -278,7 +278,7 @@ fn test_color_config() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22 @ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Test that per-repo config overrides the user config. // Test that per-repo config overrides the user config.
@ -290,7 +290,7 @@ fn test_color_config() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22 @ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }

View File

@ -107,7 +107,7 @@ fn test_init_git_external() {
// Check that the Git repo's HEAD got checked out // Check that the Git repo's HEAD got checked out
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "@-"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "@-"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
o mwrttmoslwzp git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a8ee1 mwrttmoslwzp git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a8ee1
My commit message My commit message
~ ~
"###); "###);
@ -151,7 +151,7 @@ fn test_init_git_colocated() {
// Check that the Git repo's HEAD got checked out // Check that the Git repo's HEAD got checked out
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "@-"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "@-"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
o mwrttmoslwzp git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a8ee1 mwrttmoslwzp git.user@example.com 1970-01-01 01:02:03.000 +01:00 my-branch HEAD@git 8d698d4a8ee1
My commit message My commit message
~ ~
"###); "###);

View File

@ -44,8 +44,8 @@ fn test_log_with_or_without_diff() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ a new commit @ a new commit
o add a file add a file
o
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "-p"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "-p"]);
@ -54,10 +54,10 @@ fn test_log_with_or_without_diff() {
Modified regular file file1: Modified regular file file1:
1 1: foo 1 1: foo
2: bar 2: bar
o add a file add a file
Added regular file file1: Added regular file file1:
1: foo 1: foo
o
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "--no-graph"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "--no-graph"]);
@ -74,11 +74,11 @@ fn test_log_with_or_without_diff() {
Modified regular file file1: Modified regular file file1:
1 1: foo 1 1: foo
2: bar 2: bar
o add a file add a file
A file1 A file1
Added regular file file1: Added regular file file1:
1: foo 1: foo
o
"###); "###);
// `-s` for summary, `--git` for git diff (which implies `-p`) // `-s` for summary, `--git` for git diff (which implies `-p`)
@ -93,7 +93,7 @@ fn test_log_with_or_without_diff() {
@@ -1,1 +1,2 @@ @@ -1,1 +1,2 @@
foo foo
+bar +bar
o add a file add a file
A file1 A file1
diff --git a/file1 b/file1 diff --git a/file1 b/file1
new file mode 100644 new file mode 100644
@ -102,7 +102,7 @@ fn test_log_with_or_without_diff() {
+++ b/file1 +++ b/file1
@@ -1,0 +1,1 @@ @@ -1,0 +1,1 @@
+foo +foo
o
"###); "###);
// `-p` enables default "summary" output, so `-s` is noop // `-p` enables default "summary" output, so `-s` is noop
@ -120,9 +120,9 @@ fn test_log_with_or_without_diff() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ a new commit @ a new commit
M file1 M file1
o add a file add a file
A file1 A file1
o
"###); "###);
// `-p` enables default "color-words" diff output, so `--color-words` is noop // `-p` enables default "color-words" diff output, so `--color-words` is noop
@ -135,10 +135,10 @@ fn test_log_with_or_without_diff() {
Modified regular file file1: Modified regular file file1:
1 1: foo 1 1: foo
2: bar 2: bar
o add a file add a file
Added regular file file1: Added regular file file1:
1: foo 1: foo
o
"###); "###);
// `--git` enables git diff, so `-p` is noop // `--git` enables git diff, so `-p` is noop
@ -207,9 +207,9 @@ fn test_log_with_or_without_diff() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ a new commit @ a new commit
M file1 M file1
o add a file add a file
A file1 A file1
o
"###); "###);
let stdout = test_env.jj_cmd_success( let stdout = test_env.jj_cmd_success(
&repo_path, &repo_path,
@ -401,7 +401,7 @@ fn test_log_prefix_highlight_styled() {
insta::assert_snapshot!( insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-r", "original", "-T", &prefix_format(Some(12))]), test_env.jj_cmd_success(&repo_path, &["log", "-r", "original", "-T", &prefix_format(Some(12))]),
@r###" @r###"
o Change qpvuntsmwlqt initial ba1a30916d29 original Change qpvuntsmwlqt initial ba1a30916d29 original
~ ~
"### "###
@ -420,16 +420,16 @@ fn test_log_prefix_highlight_styled() {
insta::assert_snapshot!(stdout, insta::assert_snapshot!(stdout,
@r###" @r###"
@ Change wqnwkozpkust commit9 03f51310b83e @ Change wqnwkozpkust commit9 03f51310b83e
o Change kmkuslswpqwq commit8 f77fb1909080 Change kmkuslswpqwq commit8 f77fb1909080
o Change kpqxywonksrl commit7 e715ad5db646 Change kpqxywonksrl commit7 e715ad5db646
o Change znkkpsqqskkl commit6 38622e54e2e5 Change znkkpsqqskkl commit6 38622e54e2e5
o Change yostqsxwqrlt commit5 0cf42f60199c Change yostqsxwqrlt commit5 0cf42f60199c
o Change vruxwmqvtpmx commit4 9e6015e4e622 Change vruxwmqvtpmx commit4 9e6015e4e622
o Change yqosqzytrlsw commit3 06f34d9b1475 Change yqosqzytrlsw commit3 06f34d9b1475
o Change royxmykxtrkr commit2 1f99a5e19891 Change royxmykxtrkr commit2 1f99a5e19891
o Change mzvwutvlkqwt commit1 7b1f7dee65b4 Change mzvwutvlkqwt commit1 7b1f7dee65b4
o Change qpvuntsmwlqt initial ba1a30916d29 original Change qpvuntsmwlqt initial ba1a30916d29 original
o Change zzzzzzzzzzzz 000000000000 Change zzzzzzzzzzzz 000000000000
"### "###
); );
let stdout = test_env.jj_cmd_success( let stdout = test_env.jj_cmd_success(
@ -446,16 +446,16 @@ fn test_log_prefix_highlight_styled() {
insta::assert_snapshot!(stdout, insta::assert_snapshot!(stdout,
@r###" @r###"
@ Change wqn commit9 03f @ Change wqn commit9 03f
o Change kmk commit8 f77 Change kmk commit8 f77
o Change kpq commit7 e71 Change kpq commit7 e71
o Change znk commit6 386 Change znk commit6 386
o Change yos commit5 0cf Change yos commit5 0cf
o Change vru commit4 9e6 Change vru commit4 9e6
o Change yqo commit3 06f Change yqo commit3 06f
o Change roy commit2 1f9 Change roy commit2 1f9
o Change mzv commit1 7b1 Change mzv commit1 7b1
o Change qpv initial ba1 original Change qpv initial ba1 original
o Change zzz 000 Change zzz 000
"### "###
); );
let stdout = test_env.jj_cmd_success( let stdout = test_env.jj_cmd_success(
@ -472,16 +472,16 @@ fn test_log_prefix_highlight_styled() {
insta::assert_snapshot!(stdout, insta::assert_snapshot!(stdout,
@r###" @r###"
@ Change wq commit9 03 @ Change wq commit9 03
o Change km commit8 f7 Change km commit8 f7
o Change kp commit7 e7 Change kp commit7 e7
o Change zn commit6 38 Change zn commit6 38
o Change yo commit5 0cf Change yo commit5 0cf
o Change vr commit4 9e Change vr commit4 9e
o Change yq commit3 06f Change yq commit3 06f
o Change ro commit2 1f Change ro commit2 1f
o Change mz commit1 7b Change mz commit1 7b
o Change qpv initial ba1 original Change qpv initial ba1 original
o Change zzz 00 Change zzz 00
"### "###
); );
} }
@ -515,7 +515,7 @@ fn test_log_prefix_highlight_counts_hidden_commits() {
test_env.jj_cmd_success(&repo_path, &["log", "-r", "all()", "-T", prefix_format]), test_env.jj_cmd_success(&repo_path, &["log", "-r", "all()", "-T", prefix_format]),
@r###" @r###"
@ Change q[pvuntsmwlqt] initial b[a1a30916d29] original @ Change q[pvuntsmwlqt] initial b[a1a30916d29] original
o Change z[zzzzzzzzzzz] 0[00000000000] Change z[zzzzzzzzzzz] 0[00000000000]
"### "###
); );
@ -531,9 +531,9 @@ fn test_log_prefix_highlight_counts_hidden_commits() {
test_env.jj_cmd_success(&repo_path, &["log", "-T", prefix_format]), test_env.jj_cmd_success(&repo_path, &["log", "-T", prefix_format]),
@r###" @r###"
@ Change w[qnwkozpkust] 44[4c3c5066d3] @ Change w[qnwkozpkust] 44[4c3c5066d3]
o Change q[pvuntsmwlqt] initial ba[1a30916d29] original Change q[pvuntsmwlqt] initial ba[1a30916d29] original
o Change z[zzzzzzzzzzz] 00[0000000000] Change z[zzzzzzzzzzz] 00[0000000000]
"### "###
); );
insta::assert_snapshot!( insta::assert_snapshot!(
@ -545,7 +545,7 @@ fn test_log_prefix_highlight_counts_hidden_commits() {
insta::assert_snapshot!( insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-r", "d0", "-T", prefix_format]), test_env.jj_cmd_success(&repo_path, &["log", "-r", "d0", "-T", prefix_format]),
@r###" @r###"
o Change p[szsrknsmxqw] extra d0[947f34cec4] Change p[szsrknsmxqw] extra d0[947f34cec4]
~ ~
"### "###
@ -561,12 +561,12 @@ fn test_log_shortest_length_parameter() {
insta::assert_snapshot!( insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id.shortest(0)"]), @r###" test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id.shortest(0)"]), @r###"
@ 2 @ 2
o 0 0
"###); "###);
insta::assert_snapshot!( insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id.shortest(100)"]), @r###" test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id.shortest(100)"]), @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22 @ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }
@ -617,7 +617,7 @@ fn test_log_divergence() {
// No divergence // No divergence
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ description 1 @ description 1
o
"###); "###);
// Create divergence // Create divergence
@ -628,10 +628,10 @@ fn test_log_divergence() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
Concurrent modification detected, resolving automatically. Concurrent modification detected, resolving automatically.
o description 2 !divergence! description 2 !divergence!
@ description 1 !divergence! @ description 1 !divergence!
o
"###); "###);
} }
@ -646,8 +646,8 @@ fn test_log_reversed() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "--reversed"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "--reversed"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
o
o first first
@ second @ second
"###); "###);
@ -676,7 +676,7 @@ fn test_log_filtered_by_path() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "file1"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "file1"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ second @ second
o first first
~ ~
"###); "###);
@ -692,7 +692,7 @@ fn test_log_filtered_by_path() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ second @ second
M file1 M file1
o first first
A file1 A file1
~ ~
"###); "###);
@ -869,18 +869,18 @@ fn test_graph_template_color() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ single line @ single line
o first line first line
second line second line
third line third line
o
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["--color=always", "log", "-T", template]); let stdout = test_env.jj_cmd_success(&repo_path, &["--color=always", "log", "-T", template]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ single line @ single line
o first line first line
second line second line
third line third line
o
"###); "###);
} }
@ -908,15 +908,15 @@ fn test_graph_styles() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ merge @ merge
o side branch side branch
with with
long long
description description
o main branch 2 main branch 2
o main branch 1 main branch 1
o initial initial
o
"###); "###);
// ASCII style // ASCII style
@ -961,15 +961,15 @@ fn test_graph_styles() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ merge @ merge
o side branch side branch
with with
long long
description description
o main branch 2 main branch 2
o main branch 1 main branch 1
o initial initial
o
"###); "###);
// Square style // Square style
@ -978,15 +978,15 @@ fn test_graph_styles() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ merge @ merge
o side branch side branch
with with
long long
description description
o main branch 2 main branch 2
o main branch 1 main branch 1
o initial initial
o
"###); "###);
} }
@ -1052,18 +1052,18 @@ fn test_log_word_wrap() {
3 4 5 3 4 5
6 7 8 6 7 8
9 9
o 0 1 2 0 1 2
3 4 5 3 4 5
6 7 8 6 7 8
9 9
o 0 1 2 0 1 2
3 4 5 3 4 5
6 7 8 6 7 8
9 9
o 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7
8 9 8 9
o 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7
8 9 8 9
"###); "###);

View File

@ -58,13 +58,13 @@ fn test_move() {
// Test the setup // Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 0d7353584003 f @ 0d7353584003 f
o e9515f21068c e e9515f21068c e
o bdd835cae844 d bdd835cae844 d
o caa4d0b23201 c caa4d0b23201 c
o 55171e33db26 b 55171e33db26 b
o 3db0a2f5b535 a 3db0a2f5b535 a
o 000000000000 000000000000
"###); "###);
// Errors out without arguments // Errors out without arguments
@ -91,12 +91,12 @@ fn test_move() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 1c03e3d3c63f f @ 1c03e3d3c63f f
o e9515f21068c e e9515f21068c e
o bdd835cae844 d bdd835cae844 d
o 55171e33db26 b c 55171e33db26 b c
o 3db0a2f5b535 a 3db0a2f5b535 a
o 000000000000 000000000000
"###); "###);
// The change from the source has been applied // The change from the source has been applied
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
@ -119,12 +119,12 @@ fn test_move() {
// became empty and was abandoned) // became empty and was abandoned)
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ c8d83075e8c2 f @ c8d83075e8c2 f
o 2c50bfc59c68 e 2c50bfc59c68 e
o caa4d0b23201 c caa4d0b23201 c
o 55171e33db26 b 55171e33db26 b
o 3db0a2f5b535 a d 3db0a2f5b535 a d
o 000000000000 000000000000
"###); "###);
// The change from the source has been applied (the file contents were already // The change from the source has been applied (the file contents were already
// "f", as is typically the case when moving changes from an ancestor) // "f", as is typically the case when moving changes from an ancestor)
@ -144,12 +144,12 @@ fn test_move() {
// became empty and was abandoned) // became empty and was abandoned)
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 2b723b1d6033 f @ 2b723b1d6033 f
o 4293930d6333 d e 4293930d6333 d e
o caa4d0b23201 c caa4d0b23201 c
o 55171e33db26 b 55171e33db26 b
o 3db0a2f5b535 a 3db0a2f5b535 a
o 000000000000 000000000000
"###); "###);
// The change from the source has been applied // The change from the source has been applied
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file2", "-r", "d"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file2", "-r", "d"]);
@ -188,11 +188,11 @@ fn test_move_partial() {
// Test the setup // Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ bdd835cae844 d @ bdd835cae844 d
o 5028db694b6b c 5028db694b6b c
o 55171e33db26 b 55171e33db26 b
o 3db0a2f5b535 a 3db0a2f5b535 a
o 000000000000 000000000000
"###); "###);
let edit_script = test_env.set_up_fake_diff_editor(); let edit_script = test_env.set_up_fake_diff_editor();
@ -205,10 +205,10 @@ fn test_move_partial() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 71b69e433fbc d @ 71b69e433fbc d
o 55171e33db26 b c 55171e33db26 b c
o 3db0a2f5b535 a 3db0a2f5b535 a
o 000000000000 000000000000
"###); "###);
// The changes from the source has been applied // The changes from the source has been applied
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
@ -235,11 +235,11 @@ fn test_move_partial() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 63f1a6e96edb d @ 63f1a6e96edb d
o d027c6e3e6bc c d027c6e3e6bc c
o 55171e33db26 b 55171e33db26 b
o 3db0a2f5b535 a 3db0a2f5b535 a
o 000000000000 000000000000
"###); "###);
// The selected change from the source has been applied // The selected change from the source has been applied
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
@ -268,11 +268,11 @@ fn test_move_partial() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 17c2e6632cc5 d @ 17c2e6632cc5 d
o 6a3ae047a03e c 6a3ae047a03e c
o 55171e33db26 b 55171e33db26 b
o 3db0a2f5b535 a 3db0a2f5b535 a
o 000000000000 000000000000
"###); "###);
// The selected change from the source has been applied // The selected change from the source has been applied
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
@ -300,12 +300,12 @@ fn test_move_partial() {
Rebased 1 descendant commits Rebased 1 descendant commits
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 21253406d416 c 21253406d416 c
o e1cf08aae711 b e1cf08aae711 b
@ bdd835cae844 d @ bdd835cae844 d
o 3db0a2f5b535 a 3db0a2f5b535 a
o 000000000000 000000000000
"###); "###);
// The selected change from the source has been applied // The selected change from the source has been applied
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "b"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "b"]);

View File

@ -29,18 +29,18 @@ fn test_new() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 4f2d6e0a3482a6a34e4856a4a63869c0df109e79 a new commit @ 4f2d6e0a3482a6a34e4856a4a63869c0df109e79 a new commit
o 5d5c60b2aa96b8dbf55710656c50285c66cdcd74 add a file 5d5c60b2aa96b8dbf55710656c50285c66cdcd74 add a file
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Start a new change off of a specific commit (the root commit in this case). // Start a new change off of a specific commit (the root commit in this case).
test_env.jj_cmd_success(&repo_path, &["new", "-m", "off of root", "root"]); test_env.jj_cmd_success(&repo_path, &["new", "-m", "off of root", "root"]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 026537ddb96b801b9cb909985d5443aab44616c1 off of root @ 026537ddb96b801b9cb909985d5443aab44616c1 off of root
o 4f2d6e0a3482a6a34e4856a4a63869c0df109e79 a new commit 4f2d6e0a3482a6a34e4856a4a63869c0df109e79 a new commit
o 5d5c60b2aa96b8dbf55710656c50285c66cdcd74 add a file 5d5c60b2aa96b8dbf55710656c50285c66cdcd74 add a file
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }
@ -61,10 +61,10 @@ fn test_new_merge() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 0c4e5b9b68ae0cbe7ce3c61042619513d09005bf @ 0c4e5b9b68ae0cbe7ce3c61042619513d09005bf
o f399209d9dda06e8a25a0c8e9a0cde9f421ff35d add file2 f399209d9dda06e8a25a0c8e9a0cde9f421ff35d add file2
o 38e8e2f6c92ffb954961fc391b515ff551b41636 add file1 38e8e2f6c92ffb954961fc391b515ff551b41636 add file1
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
insta::assert_snapshot!(stdout, @"a"); insta::assert_snapshot!(stdout, @"a");
@ -77,10 +77,10 @@ fn test_new_merge() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 200ed1a14c8acf09783dafefe5bebf2ff58f12fd @ 200ed1a14c8acf09783dafefe5bebf2ff58f12fd
o f399209d9dda06e8a25a0c8e9a0cde9f421ff35d add file2 f399209d9dda06e8a25a0c8e9a0cde9f421ff35d add file2
o 38e8e2f6c92ffb954961fc391b515ff551b41636 add file1 38e8e2f6c92ffb954961fc391b515ff551b41636 add file1
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// `jj merge` with less than two arguments is an error // `jj merge` with less than two arguments is an error
@ -115,14 +115,14 @@ fn test_new_insert_after() {
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ F @ F
o E E
o D D
o C C
o B B
o A A
o root root
"###); "###);
let stdout = let stdout =
@ -132,18 +132,18 @@ fn test_new_insert_after() {
Working copy now at: ca7c6481a8dd G Working copy now at: ca7c6481a8dd G
"###); "###);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
o C C
o F F
@ G @ G
o E E
o D D
o B B
o A A
o root root
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["new", "--insert-after", "-m", "H", "D"]); let stdout = test_env.jj_cmd_success(&repo_path, &["new", "--insert-after", "-m", "H", "D"]);
@ -152,19 +152,19 @@ fn test_new_insert_after() {
Working copy now at: fcf8281b4135 H Working copy now at: fcf8281b4135 H
"###); "###);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
o C C
o F F
o G G
@ H @ H
o E E
o D D
o B B
o A A
o root root
"###); "###);
} }
@ -177,14 +177,14 @@ fn test_new_insert_after_children() {
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ F @ F
o E E
o D D
o C C
o B B
o A A
o root root
"###); "###);
// Check that inserting G after A and C doesn't try to rebase B (which is // Check that inserting G after A and C doesn't try to rebase B (which is
@ -198,17 +198,17 @@ fn test_new_insert_after_children() {
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ G @ G
o F F
o E E
o D D
o C C
o B B
o A A
o root root
"###); "###);
} }
@ -221,14 +221,14 @@ fn test_new_insert_before() {
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ F @ F
o E E
o D D
o C C
o B B
o A A
o root root
"###); "###);
let stdout = let stdout =
@ -238,18 +238,18 @@ fn test_new_insert_before() {
Working copy now at: ff6bbbc7b8df G Working copy now at: ff6bbbc7b8df G
"###); "###);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
o F F
o C C
@ G @ G
o E E
o D D
o B B
o A A
o root root
"###); "###);
} }
@ -262,14 +262,14 @@ fn test_new_insert_before_root_successors() {
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ F @ F
o E E
o D D
o C C
o B B
o A A
o root root
"###); "###);
let stdout = let stdout =
@ -279,17 +279,17 @@ fn test_new_insert_before_root_successors() {
Working copy now at: 3654197754f8 G Working copy now at: 3654197754f8 G
"###); "###);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
o F F
o C C
o B B
o D D
o A A
@ G @ G
o E E
o root root
"###); "###);
} }
@ -304,14 +304,14 @@ fn test_new_insert_before_no_loop() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ 7705d353bf5d F @ 7705d353bf5d F
o 41a89ffcbba2 E 41a89ffcbba2 E
o c9257eff5bf9 D c9257eff5bf9 D
o ec18c57d72d8 C ec18c57d72d8 C
o 6041917ceeb5 B 6041917ceeb5 B
o 65b1ef43c737 A 65b1ef43c737 A
o 000000000000 root 000000000000 root
"###); "###);
let stderr = let stderr =
@ -330,14 +330,14 @@ fn test_new_insert_before_no_root_merge() {
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ F @ F
o E E
o D D
o C C
o B B
o A A
o root root
"###); "###);
let stdout = let stdout =
@ -347,17 +347,17 @@ fn test_new_insert_before_no_root_merge() {
Working copy now at: bf9fc49331de G Working copy now at: bf9fc49331de G
"###); "###);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
o F F
o C C
o D D
o B B
@ G @ G
o E E
o A A
o root root
"###); "###);
} }
@ -370,14 +370,14 @@ fn test_new_insert_before_root() {
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ F @ F
o E E
o D D
o C C
o B B
o A A
o root root
"###); "###);
let stderr = let stderr =

View File

@ -33,11 +33,11 @@ fn test_obslog_with_or_without_diff() {
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:10.000 +07:00 66b42ad36073 @ rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:10.000 +07:00 66b42ad36073
my description my description
o rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:09.000 +07:00 af536e5af67e conflict rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:09.000 +07:00 af536e5af67e conflict
my description my description
o rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:09.000 +07:00 6fbba7bcb590 rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:09.000 +07:00 6fbba7bcb590
my description my description
o rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:08.000 +07:00 eac0d0dae082 rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:08.000 +07:00 eac0d0dae082
(empty) my description (empty) my description
"###); "###);
@ -54,16 +54,16 @@ fn test_obslog_with_or_without_diff() {
4 : +bar 4 : +bar
5 : +++++++ 5 : +++++++
6 : >>>>>>> 6 : >>>>>>>
o rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:09.000 +07:00 af536e5af67e conflict rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:09.000 +07:00 af536e5af67e conflict
my description my description
o rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:09.000 +07:00 6fbba7bcb590 rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:09.000 +07:00 6fbba7bcb590
my description my description
Modified regular file file1: Modified regular file file1:
1 1: foo 1 1: foo
2: bar 2: bar
Added regular file file2: Added regular file file2:
1: foo 1: foo
o rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:08.000 +07:00 eac0d0dae082 rlvkpnrzqnoo test.user@example.com 2001-02-03 04:05:08.000 +07:00 eac0d0dae082
(empty) my description (empty) my description
"###); "###);
@ -145,7 +145,7 @@ fn test_obslog_word_wrap() {
insta::assert_snapshot!(render(&["obslog"], 40, false), @r###" insta::assert_snapshot!(render(&["obslog"], 40, false), @r###"
@ qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:08.000 +07:00 69542c1984c1 @ qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:08.000 +07:00 69542c1984c1
(empty) first (empty) first
o qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0 qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
(empty) (no description set) (empty) (no description set)
"###); "###);
insta::assert_snapshot!(render(&["obslog"], 40, true), @r###" insta::assert_snapshot!(render(&["obslog"], 40, true), @r###"
@ -153,7 +153,7 @@ fn test_obslog_word_wrap() {
2001-02-03 04:05:08.000 +07:00 2001-02-03 04:05:08.000 +07:00
69542c1984c1 69542c1984c1
(empty) first (empty) first
o qpvuntsmwlqt test.user@example.com qpvuntsmwlqt test.user@example.com
2001-02-03 04:05:07.000 +07:00 2001-02-03 04:05:07.000 +07:00
230dd059e1b0 230dd059e1b0
(empty) (no description set) (empty) (no description set)
@ -193,25 +193,25 @@ fn test_obslog_squash() {
let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "-p", "-r", "@-"]); let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "-p", "-r", "@-"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
o qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:10.000 +07:00 27e721a5ba72 qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:10.000 +07:00 27e721a5ba72
squashed squashed
Modified regular file file1: Modified regular file file1:
1 1: foo 1 1: foo
2: bar 2: bar
o qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:09.000 +07:00 9764e503e1a9 qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:09.000 +07:00 9764e503e1a9
first first
Added regular file file1: Added regular file file1:
1: foo 1: foo
o qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:08.000 +07:00 69542c1984c1 qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:08.000 +07:00 69542c1984c1
(empty) first (empty) first
o qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0 qpvuntsmwlqt test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
(empty) (no description set) (empty) (no description set)
o kkmpptxzrspx test.user@example.com 2001-02-03 04:05:10.000 +07:00 f09a38899f2b kkmpptxzrspx test.user@example.com 2001-02-03 04:05:10.000 +07:00 f09a38899f2b
second second
Modified regular file file1: Modified regular file file1:
1 1: foo 1 1: foo
2: bar 2: bar
o kkmpptxzrspx test.user@example.com 2001-02-03 04:05:09.000 +07:00 579965369703 kkmpptxzrspx test.user@example.com 2001-02-03 04:05:09.000 +07:00 579965369703
(empty) second (empty) second
"###); "###);
} }

View File

@ -40,9 +40,9 @@ fn test_op_log() {
@ 45108169c0f8 test-username@host.example.com 2001-02-03 04:05:08.000 +07:00 - 2001-02-03 04:05:08.000 +07:00 @ 45108169c0f8 test-username@host.example.com 2001-02-03 04:05:08.000 +07:00 - 2001-02-03 04:05:08.000 +07:00
describe commit 230dd059e1b059aefc0da06a2e5a7dbf22362f22 describe commit 230dd059e1b059aefc0da06a2e5a7dbf22362f22
args: jj describe -m 'description 0' args: jj describe -m 'description 0'
o a99a3fd5c51e test-username@host.example.com 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00 a99a3fd5c51e test-username@host.example.com 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00
add workspace 'default' add workspace 'default'
o 56b94dfc38e7 test-username@host.example.com 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00 56b94dfc38e7 test-username@host.example.com 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00
initialize repo initialize repo
"###); "###);
// Test op log with relative dates // Test op log with relative dates
@ -52,9 +52,9 @@ fn test_op_log() {
@ 45108169c0f8 test-username@host.example.com NN years ago, lasted less than a microsecond @ 45108169c0f8 test-username@host.example.com NN years ago, lasted less than a microsecond
describe commit 230dd059e1b059aefc0da06a2e5a7dbf22362f22 describe commit 230dd059e1b059aefc0da06a2e5a7dbf22362f22
args: jj describe -m 'description 0' args: jj describe -m 'description 0'
o a99a3fd5c51e test-username@host.example.com NN years ago, lasted less than a microsecond a99a3fd5c51e test-username@host.example.com NN years ago, lasted less than a microsecond
add workspace 'default' add workspace 'default'
o 56b94dfc38e7 test-username@host.example.com NN years ago, lasted less than a microsecond 56b94dfc38e7 test-username@host.example.com NN years ago, lasted less than a microsecond
initialize repo initialize repo
"###); "###);
let add_workspace_id = "a99a3fd5c51e"; let add_workspace_id = "a99a3fd5c51e";
@ -62,24 +62,24 @@ fn test_op_log() {
// Can load the repo at a specific operation ID // Can load the repo at a specific operation ID
insta::assert_snapshot!(get_log_output(&test_env, &repo_path, initialize_repo_id), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path, initialize_repo_id), @r###"
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path, add_workspace_id), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path, add_workspace_id), @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22 @ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// "@" resolves to the head operation // "@" resolves to the head operation
insta::assert_snapshot!(get_log_output(&test_env, &repo_path, "@"), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path, "@"), @r###"
@ bc8f18aa6f396a93572811632313cbb5625d475d @ bc8f18aa6f396a93572811632313cbb5625d475d
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// "@-" resolves to the parent of the head operation // "@-" resolves to the parent of the head operation
insta::assert_snapshot!(get_log_output(&test_env, &repo_path, "@-"), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path, "@-"), @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22 @ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path, "@--"), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path, "@--"), @r###"
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
insta::assert_snapshot!( insta::assert_snapshot!(
test_env.jj_cmd_failure(&repo_path, &["log", "--at-op", "@---"]), @r###" test_env.jj_cmd_failure(&repo_path, &["log", "--at-op", "@---"]), @r###"
@ -88,7 +88,7 @@ fn test_op_log() {
// "ID-" also resolves to the parent. // "ID-" also resolves to the parent.
insta::assert_snapshot!( insta::assert_snapshot!(
get_log_output(&test_env, &repo_path, &format!("{add_workspace_id}-")), @r###" get_log_output(&test_env, &repo_path, &format!("{add_workspace_id}-")), @r###"
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// We get a reasonable message if an invalid operation ID is specified // We get a reasonable message if an invalid operation ID is specified
@ -137,13 +137,13 @@ fn test_op_log_template() {
insta::assert_snapshot!(render(r#"id ++ "\n""#), @r###" insta::assert_snapshot!(render(r#"id ++ "\n""#), @r###"
@ a99a3fd5c51e8f7ccb9ae2f9fb749612a23f0a7cf25d8c644f36c35c077449ce3c66f49d098a5a704ca5e47089a7f019563a5b8cbc7d451619e0f90c82241ceb @ a99a3fd5c51e8f7ccb9ae2f9fb749612a23f0a7cf25d8c644f36c35c077449ce3c66f49d098a5a704ca5e47089a7f019563a5b8cbc7d451619e0f90c82241ceb
o 56b94dfc38e7d54340377f566e96ab97dc6163ea7841daf49fb2e1d1ceb27e26274db1245835a1a421fb9d06e6e0fe1e4f4aa1b0258c6e86df676ad9111d0dab 56b94dfc38e7d54340377f566e96ab97dc6163ea7841daf49fb2e1d1ceb27e26274db1245835a1a421fb9d06e6e0fe1e4f4aa1b0258c6e86df676ad9111d0dab
"###); "###);
insta::assert_snapshot!( insta::assert_snapshot!(
render(r#"separate(" ", id.short(5), current_operation, user, render(r#"separate(" ", id.short(5), current_operation, user,
time.start(), time.end(), time.duration()) ++ "\n""#), @r###" time.start(), time.end(), time.duration()) ++ "\n""#), @r###"
@ a99a3 true test-username@host.example.com 2001-02-03 04:05:07.000 +07:00 2001-02-03 04:05:07.000 +07:00 less than a microsecond @ a99a3 true test-username@host.example.com 2001-02-03 04:05:07.000 +07:00 2001-02-03 04:05:07.000 +07:00 less than a microsecond
o 56b94 false test-username@host.example.com 2001-02-03 04:05:07.000 +07:00 2001-02-03 04:05:07.000 +07:00 less than a microsecond 56b94 false test-username@host.example.com 2001-02-03 04:05:07.000 +07:00 2001-02-03 04:05:07.000 +07:00 less than a microsecond
"###); "###);
} }
@ -170,7 +170,7 @@ fn test_op_log_word_wrap() {
insta::assert_snapshot!(render(&["op", "log"], 40, false), @r###" insta::assert_snapshot!(render(&["op", "log"], 40, false), @r###"
@ a99a3fd5c51e test-username@host.example.com 22 years ago, lasted less than a microsecond @ a99a3fd5c51e test-username@host.example.com 22 years ago, lasted less than a microsecond
add workspace 'default' add workspace 'default'
o 56b94dfc38e7 test-username@host.example.com 22 years ago, lasted less than a microsecond 56b94dfc38e7 test-username@host.example.com 22 years ago, lasted less than a microsecond
initialize repo initialize repo
"###); "###);
insta::assert_snapshot!(render(&["op", "log"], 40, true), @r###" insta::assert_snapshot!(render(&["op", "log"], 40, true), @r###"
@ -179,7 +179,7 @@ fn test_op_log_word_wrap() {
years ago, lasted less than a years ago, lasted less than a
microsecond microsecond
add workspace 'default' add workspace 'default'
o 56b94dfc38e7 56b94dfc38e7
test-username@host.example.com 22 test-username@host.example.com 22
years ago, lasted less than a years ago, lasted less than a
microsecond microsecond

View File

@ -99,13 +99,13 @@ fn test_rebase_branch() {
// Test the setup // Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e @ e
o d d
o c c
o b b
o a a
o
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-b", "c", "-d", "e"]); let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-b", "c", "-d", "e"]);
@ -113,13 +113,13 @@ fn test_rebase_branch() {
Rebased 3 commits Rebased 3 commits
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o d d
o c c
o b b
@ e @ e
o a a
o
"###); "###);
// Test rebasing multiple branches at once // Test rebasing multiple branches at once
@ -131,14 +131,14 @@ fn test_rebase_branch() {
Added 1 files, modified 0 files, removed 0 files Added 1 files, modified 0 files, removed 0 files
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o d d
@ e @ e
o c c
o b b
o a a
o
"###); "###);
// Same test but with more than one revision per argument and same revision // Same test but with more than one revision per argument and same revision
@ -162,14 +162,14 @@ fn test_rebase_branch() {
Added 1 files, modified 0 files, removed 0 files Added 1 files, modified 0 files, removed 0 files
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o d d
@ e @ e
o c c
o b b
o a a
o
"###); "###);
} }
@ -188,13 +188,13 @@ fn test_rebase_branch_with_merge() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e @ e
o d d
o c c
o b b
o a a
o
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-b", "d", "-d", "b"]); let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-b", "d", "-d", "b"]);
@ -205,11 +205,11 @@ fn test_rebase_branch_with_merge() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e @ e
o d d
o c c
o b b
o a a
o
"###); "###);
test_env.jj_cmd_success(&repo_path, &["undo"]); test_env.jj_cmd_success(&repo_path, &["undo"]);
@ -221,11 +221,11 @@ fn test_rebase_branch_with_merge() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e @ e
o d d
o c c
o b b
o a a
o
"###); "###);
} }
@ -242,12 +242,12 @@ fn test_rebase_single_revision() {
// Test the setup // Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d @ d
o c c
o b b
o a a
o
"###); "###);
// Descendants of the rebased commit "b" should be rebased onto parents. First // Descendants of the rebased commit "b" should be rebased onto parents. First
@ -264,11 +264,11 @@ fn test_rebase_single_revision() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d @ d
o c c
o b b
o a a
o
"###); "###);
test_env.jj_cmd_success(&repo_path, &["undo"]); test_env.jj_cmd_success(&repo_path, &["undo"]);
@ -283,12 +283,12 @@ fn test_rebase_single_revision() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d @ d
o c c
o b b
o a a
o
"###); "###);
} }
@ -306,11 +306,11 @@ fn test_rebase_single_revision_merge_parent() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d @ d
o c c
o b b
o a a
o
"###); "###);
// Descendants of the rebased commit should be rebased onto parents, and if // Descendants of the rebased commit should be rebased onto parents, and if
@ -324,12 +324,12 @@ fn test_rebase_single_revision_merge_parent() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d @ d
o c c
o b b
o a a
o
"###); "###);
} }
@ -345,22 +345,22 @@ fn test_rebase_multiple_destinations() {
// Test the setup // Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ c @ c
o b b
o a a
o
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-r", "a", "-d", "b", "-d", "c"]); let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-r", "a", "-d", "b", "-d", "c"]);
insta::assert_snapshot!(stdout, @r###""###); insta::assert_snapshot!(stdout, @r###""###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o a a
@ c @ c
o b b
o
"###); "###);
let stderr = test_env.jj_cmd_failure(&repo_path, &["rebase", "-r", "a", "-d", "b|c"]); let stderr = test_env.jj_cmd_failure(&repo_path, &["rebase", "-r", "a", "-d", "b|c"]);
@ -377,12 +377,12 @@ fn test_rebase_multiple_destinations() {
); );
insta::assert_snapshot!(stdout, @r###""###); insta::assert_snapshot!(stdout, @r###""###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o a a
@ c @ c
o b b
o
"###); "###);
let stderr = test_env.jj_cmd_failure(&repo_path, &["rebase", "-r", "a", "-d", "b", "-d", "b"]); let stderr = test_env.jj_cmd_failure(&repo_path, &["rebase", "-r", "a", "-d", "b", "-d", "b"]);
@ -407,11 +407,11 @@ fn test_rebase_multiple_destinations() {
); );
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o a a
@ c @ c
o b b
o
"###); "###);
let stdout = test_env.jj_cmd_success( let stdout = test_env.jj_cmd_success(
&repo_path, &repo_path,
@ -428,12 +428,12 @@ fn test_rebase_multiple_destinations() {
); );
insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o a a
@ c @ c
o b b
o
"###); "###);
let stderr = let stderr =
@ -456,12 +456,12 @@ fn test_rebase_with_descendants() {
// Test the setup // Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d @ d
o c c
o b b
o a a
o
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-s", "b", "-d", "a"]); let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-s", "b", "-d", "a"]);
@ -471,10 +471,10 @@ fn test_rebase_with_descendants() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d @ d
o c c
o b b
o a a
o
"###); "###);
// Rebase several subtrees at once. // Rebase several subtrees at once.
@ -487,24 +487,24 @@ fn test_rebase_with_descendants() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d @ d
o c c
o b b
o a a
o
"###); "###);
test_env.jj_cmd_success(&repo_path, &["undo"]); test_env.jj_cmd_success(&repo_path, &["undo"]);
// Reminder of the setup // Reminder of the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d @ d
o c c
o b b
o a a
o
"###); "###);
// `d` was a descendant of `b`, and both are moved to be direct descendants of // `d` was a descendant of `b`, and both are moved to be direct descendants of
@ -516,12 +516,12 @@ fn test_rebase_with_descendants() {
Added 0 files, modified 0 files, removed 2 files Added 0 files, modified 0 files, removed 2 files
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o c c
@ d @ d
o b b
o a a
o
"###); "###);
// Same test as above, but with duplicate commits and multiple commits per // Same test as above, but with duplicate commits and multiple commits per
@ -545,12 +545,12 @@ fn test_rebase_with_descendants() {
Added 0 files, modified 0 files, removed 2 files Added 0 files, modified 0 files, removed 2 files
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o c c
o b b
@ d @ d
o a a
o
"###); "###);
} }

View File

@ -56,11 +56,11 @@ fn test_resolution() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict @ conflict
o b b
o a a
o base base
o
"###); "###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]), insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]),
@r###" @r###"
@ -301,11 +301,11 @@ fn test_normal_conflict_input_files() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict @ conflict
o b b
o a a
o base base
o
"###); "###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]), insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]),
@r###" @r###"
@ -342,11 +342,11 @@ fn test_baseless_conflict_input_files() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict @ conflict
o b b
o a a
o base base
o
"###); "###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]), insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]),
@r###" @r###"
@ -411,11 +411,11 @@ fn test_edit_delete_conflict_input_files() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict @ conflict
o b b
o a a
o base base
o
"###); "###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]), insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]),
@r###" @r###"
@ -454,11 +454,11 @@ fn test_file_vs_dir() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict @ conflict
o b b
o a a
o base base
o
"###); "###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]), insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]),
@ -501,13 +501,13 @@ fn test_description_with_dir_and_deletion() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict @ conflict
o del del
o dir dir
o edit edit
o base base
o
"###); "###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]), insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]),
@ -581,11 +581,11 @@ fn test_multiple_conflicts() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict @ conflict
o b b
o a a
o base base
o
"###); "###);
insta::assert_snapshot!( insta::assert_snapshot!(
std::fs::read_to_string(repo_path.join("this_file_has_a_very_long_name_to_test_padding")).unwrap() std::fs::read_to_string(repo_path.join("this_file_has_a_very_long_name_to_test_padding")).unwrap()

View File

@ -118,11 +118,11 @@ fn test_restore_conflicted_merge() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict @ conflict
o b b
o a a
o base base
o
"###); "###);
insta::assert_snapshot!( insta::assert_snapshot!(
std::fs::read_to_string(repo_path.join("file")).unwrap() std::fs::read_to_string(repo_path.join("file")).unwrap()

View File

@ -205,13 +205,13 @@ fn test_alias() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "my-root"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "my-root"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
o zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000 zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set) (empty) (no description set)
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "identity(my-root)"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "identity(my-root)"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
o zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000 zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set) (empty) (no description set)
"###); "###);
@ -307,7 +307,7 @@ fn test_bad_alias_decl() {
.assert() .assert()
.success(); .success();
insta::assert_snapshot!(get_stdout_string(&assert), @r###" insta::assert_snapshot!(get_stdout_string(&assert), @r###"
o zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000 zzzzzzzzzzzz 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set) (empty) (no description set)
"###); "###);
insta::assert_snapshot!(get_stderr_string(&assert), @r###" insta::assert_snapshot!(get_stderr_string(&assert), @r###"

View File

@ -30,7 +30,7 @@ fn test_split_by_paths() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ qpvuntsmwlqt false @ qpvuntsmwlqt false
o zzzzzzzzzzzz true zzzzzzzzzzzz true
"###); "###);
let edit_script = test_env.set_up_fake_editor(); let edit_script = test_env.set_up_fake_editor();
@ -67,8 +67,8 @@ fn test_split_by_paths() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ kkmpptxzrspx false @ kkmpptxzrspx false
o qpvuntsmwlqt false qpvuntsmwlqt false
o zzzzzzzzzzzz true zzzzzzzzzzzz true
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s", "-r", "@-"]); let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s", "-r", "@-"]);
@ -93,9 +93,9 @@ fn test_split_by_paths() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ kkmpptxzrspx false @ kkmpptxzrspx false
o yqosqzytrlsw true yqosqzytrlsw true
o qpvuntsmwlqt false qpvuntsmwlqt false
o zzzzzzzzzzzz true zzzzzzzzzzzz true
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s", "-r", "@--"]); let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s", "-r", "@--"]);
@ -124,9 +124,9 @@ fn test_split_by_paths() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ kkmpptxzrspx false @ kkmpptxzrspx false
o kpqxywonksrl false kpqxywonksrl false
o qpvuntsmwlqt true qpvuntsmwlqt true
o zzzzzzzzzzzz true zzzzzzzzzzzz true
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s", "-r", "@-"]); let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s", "-r", "@-"]);

View File

@ -35,9 +35,9 @@ fn test_squash() {
// Test the setup // Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 90fe0a96fc90 c @ 90fe0a96fc90 c
o fa5efbdf533c b fa5efbdf533c b
o 90aeefd03044 a 90aeefd03044 a
o 000000000000 000000000000
"###); "###);
// Squashes the working copy into the parent by default // Squashes the working copy into the parent by default
@ -47,9 +47,9 @@ fn test_squash() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ b9280a9898cb @ b9280a9898cb
o 6ca29c9d2e7c b c 6ca29c9d2e7c b c
o 90aeefd03044 a 90aeefd03044 a
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ -65,8 +65,8 @@ fn test_squash() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e87cf8ebc7e1 c @ e87cf8ebc7e1 c
o 893c93ae2a87 a b 893c93ae2a87 a b
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "b"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "b"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ -89,12 +89,12 @@ fn test_squash() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ c7a11b36d333 e @ c7a11b36d333 e
o 5658521e0f8b d 5658521e0f8b d
o 90fe0a96fc90 c 90fe0a96fc90 c
o fa5efbdf533c b fa5efbdf533c b
o 90aeefd03044 a 90aeefd03044 a
o 000000000000 000000000000
"###); "###);
let stderr = test_env.jj_cmd_failure(&repo_path, &["squash"]); let stderr = test_env.jj_cmd_failure(&repo_path, &["squash"]);
insta::assert_snapshot!(stderr, @r###" insta::assert_snapshot!(stderr, @r###"
@ -110,14 +110,14 @@ fn test_squash() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 959145c11426 @ 959145c11426
o 80960125bb96 e 80960125bb96 e
o 5658521e0f8b d 5658521e0f8b d
o 90fe0a96fc90 c 90fe0a96fc90 c
o fa5efbdf533c b fa5efbdf533c b
o 90aeefd03044 a 90aeefd03044 a
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "e"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "e"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ -145,9 +145,9 @@ fn test_squash_partial() {
// Test the setup // Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d989314f3df0 c @ d989314f3df0 c
o 2a2d19a3283f b 2a2d19a3283f b
o 47a1e795d146 a 47a1e795d146 a
o 000000000000 000000000000
"###); "###);
// If we don't make any changes in the diff-editor, the whole change is moved // If we don't make any changes in the diff-editor, the whole change is moved
@ -160,8 +160,8 @@ fn test_squash_partial() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ f03d5ce4a973 c @ f03d5ce4a973 c
o c9f931cd78af a b c9f931cd78af a b
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ -178,9 +178,9 @@ fn test_squash_partial() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e7a40106bee6 c @ e7a40106bee6 c
o 05d951646873 b 05d951646873 b
o 0c5ddc685260 a 0c5ddc685260 a
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ -210,9 +210,9 @@ fn test_squash_partial() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ a911fa1d0627 c @ a911fa1d0627 c
o fb73ad17899f b fb73ad17899f b
o 70621f4c7a42 a 70621f4c7a42 a
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"

View File

@ -66,13 +66,13 @@ fn test_templater_branches() {
let template = r#"commit_id.short() ++ " " ++ branches"#; let template = r#"commit_id.short() ++ " " ++ branches"#;
let output = test_env.jj_cmd_success(&workspace_root, &["log", "-T", template]); let output = test_env.jj_cmd_success(&workspace_root, &["log", "-T", template]);
insta::assert_snapshot!(output, @r###" insta::assert_snapshot!(output, @r###"
o b1bb3766d584 branch3?? b1bb3766d584 branch3??
@ a5b4d15489cc branch2* new-branch @ a5b4d15489cc branch2* new-branch
o 21c33875443e branch1* 21c33875443e branch1*
o 8476341eb395 branch2@origin 8476341eb395 branch2@origin
o 000000000000 000000000000
"###); "###);
} }

View File

@ -32,8 +32,8 @@ fn test_undo_rewrite_with_child() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ child @ child
o modified modified
o
"###); "###);
test_env.jj_cmd_success(&repo_path, &["undo", &op_id_hex]); test_env.jj_cmd_success(&repo_path, &["undo", &op_id_hex]);
@ -42,7 +42,7 @@ fn test_undo_rewrite_with_child() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description"]); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ child @ child
o initial initial
o
"###); "###);
} }

View File

@ -35,9 +35,9 @@ fn test_unsquash() {
// Test the setup // Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 90fe0a96fc90 c @ 90fe0a96fc90 c
o fa5efbdf533c b fa5efbdf533c b
o 90aeefd03044 a 90aeefd03044 a
o 000000000000 000000000000
"###); "###);
// Unsquashes into the working copy from its parent by default // Unsquashes into the working copy from its parent by default
@ -47,8 +47,8 @@ fn test_unsquash() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 1b10d78f6136 c @ 1b10d78f6136 c
o 90aeefd03044 a b 90aeefd03044 a b
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ -64,8 +64,8 @@ fn test_unsquash() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 45b8b3ddc25a c @ 45b8b3ddc25a c
o 9146bcc8d996 b 9146bcc8d996 b
o 000000000000 a 000000000000 a
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "b"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "b"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ -88,12 +88,12 @@ fn test_unsquash() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 1f8f152ff48e e @ 1f8f152ff48e e
o 5658521e0f8b d 5658521e0f8b d
o 90fe0a96fc90 c 90fe0a96fc90 c
o fa5efbdf533c b fa5efbdf533c b
o 90aeefd03044 a 90aeefd03044 a
o 000000000000 000000000000
"###); "###);
let stderr = test_env.jj_cmd_failure(&repo_path, &["unsquash"]); let stderr = test_env.jj_cmd_failure(&repo_path, &["unsquash"]);
insta::assert_snapshot!(stderr, @r###" insta::assert_snapshot!(stderr, @r###"
@ -110,12 +110,12 @@ fn test_unsquash() {
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 3217340cb761 @ 3217340cb761
o 5658521e0f8b d e?? 5658521e0f8b d e??
o 90fe0a96fc90 c e?? 90fe0a96fc90 c e??
o fa5efbdf533c b fa5efbdf533c b
o 90aeefd03044 a 90aeefd03044 a
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ -143,9 +143,9 @@ fn test_unsquash_partial() {
// Test the setup // Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d989314f3df0 c @ d989314f3df0 c
o 2a2d19a3283f b 2a2d19a3283f b
o 47a1e795d146 a 47a1e795d146 a
o 000000000000 000000000000
"###); "###);
// If we don't make any changes in the diff-editor, the whole change is moved // If we don't make any changes in the diff-editor, the whole change is moved
@ -158,9 +158,9 @@ fn test_unsquash_partial() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 37c961d0d1e2 c @ 37c961d0d1e2 c
o 000af22057b9 b 000af22057b9 b
o ee67504598b6 a ee67504598b6 a
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ -176,9 +176,9 @@ fn test_unsquash_partial() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ a8e8fded1021 c @ a8e8fded1021 c
o 46cc06672a99 b 46cc06672a99 b
o 47a1e795d146 a 47a1e795d146 a
o 000000000000 000000000000
"###); "###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "b"]); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "b"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"

View File

@ -47,18 +47,18 @@ fn test_workspaces_add_second_workspace() {
// Can see the working-copy commit in each workspace in the log output. The "@" // Can see the working-copy commit in each workspace in the log output. The "@"
// node in the graph indicates the current workspace's working-copy commit. // node in the graph indicates the current workspace's working-copy commit.
insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###"
o 397eac932ad3c349b2659fd2eb035a4dd3da4193 second@ 397eac932ad3c349b2659fd2eb035a4dd3da4193 second@
@ e0e6d5672858dc9a57ec5b772b7c4f3270ed0223 default@ @ e0e6d5672858dc9a57ec5b772b7c4f3270ed0223 default@
o 7d308bc9d934c53c6cc52935192e2d6ac5d78cfd 7d308bc9d934c53c6cc52935192e2d6ac5d78cfd
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &secondary_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &secondary_path), @r###"
@ 397eac932ad3c349b2659fd2eb035a4dd3da4193 second@ @ 397eac932ad3c349b2659fd2eb035a4dd3da4193 second@
o e0e6d5672858dc9a57ec5b772b7c4f3270ed0223 default@ e0e6d5672858dc9a57ec5b772b7c4f3270ed0223 default@
o 7d308bc9d934c53c6cc52935192e2d6ac5d78cfd 7d308bc9d934c53c6cc52935192e2d6ac5d78cfd
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Both workspaces show up when we list them // Both workspaces show up when we list them
@ -84,11 +84,11 @@ fn test_workspaces_conflicting_edits() {
test_env.jj_cmd_success(&main_path, &["workspace", "add", "../secondary"]); test_env.jj_cmd_success(&main_path, &["workspace", "add", "../secondary"]);
insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###"
o 265af0cdbcc7bb33e3734ad72565c943ce3fb0d4 secondary@ 265af0cdbcc7bb33e3734ad72565c943ce3fb0d4 secondary@
@ 351099fa72cfbb1b34e410e89821efc623295974 default@ @ 351099fa72cfbb1b34e410e89821efc623295974 default@
o cf911c223d3e24e001fc8264d6dbf0610804fc40 cf911c223d3e24e001fc8264d6dbf0610804fc40
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Make changes in both working copies // Make changes in both working copies
@ -105,10 +105,10 @@ fn test_workspaces_conflicting_edits() {
// The secondary workspace's working-copy commit was updated // The secondary workspace's working-copy commit was updated
insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###"
@ fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@ @ fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@
o a1896a17282f19089a5cec44358d6609910e0513 secondary@ a1896a17282f19089a5cec44358d6609910e0513 secondary@
o c0d4a99ef98ada7da8dc73a778bbb747c4178385 c0d4a99ef98ada7da8dc73a778bbb747c4178385
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
let stderr = test_env.jj_cmd_failure(&secondary_path, &["st"]); let stderr = test_env.jj_cmd_failure(&secondary_path, &["st"]);
insta::assert_snapshot!(stderr, @r###" insta::assert_snapshot!(stderr, @r###"
@ -133,25 +133,25 @@ fn test_workspaces_conflicting_edits() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &secondary_path), insta::assert_snapshot!(get_log_output(&test_env, &secondary_path),
@r###" @r###"
o 8d90dc175c874af0dff032d611029dc722d4e108 (divergent) 8d90dc175c874af0dff032d611029dc722d4e108 (divergent)
o fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@ fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@
@ a1896a17282f19089a5cec44358d6609910e0513 secondary@ (divergent) @ a1896a17282f19089a5cec44358d6609910e0513 secondary@ (divergent)
o c0d4a99ef98ada7da8dc73a778bbb747c4178385 c0d4a99ef98ada7da8dc73a778bbb747c4178385
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// The stale working copy should have been resolved by the previous command // The stale working copy should have been resolved by the previous command
let stdout = get_log_output(&test_env, &secondary_path); let stdout = get_log_output(&test_env, &secondary_path);
assert!(!stdout.starts_with("The working copy is stale")); assert!(!stdout.starts_with("The working copy is stale"));
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
o 8d90dc175c874af0dff032d611029dc722d4e108 (divergent) 8d90dc175c874af0dff032d611029dc722d4e108 (divergent)
o fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@ fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@
@ a1896a17282f19089a5cec44358d6609910e0513 secondary@ (divergent) @ a1896a17282f19089a5cec44358d6609910e0513 secondary@ (divergent)
o c0d4a99ef98ada7da8dc73a778bbb747c4178385 c0d4a99ef98ada7da8dc73a778bbb747c4178385
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }
@ -169,11 +169,11 @@ fn test_workspaces_updated_by_other() {
test_env.jj_cmd_success(&main_path, &["workspace", "add", "../secondary"]); test_env.jj_cmd_success(&main_path, &["workspace", "add", "../secondary"]);
insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###"
o 265af0cdbcc7bb33e3734ad72565c943ce3fb0d4 secondary@ 265af0cdbcc7bb33e3734ad72565c943ce3fb0d4 secondary@
@ 351099fa72cfbb1b34e410e89821efc623295974 default@ @ 351099fa72cfbb1b34e410e89821efc623295974 default@
o cf911c223d3e24e001fc8264d6dbf0610804fc40 cf911c223d3e24e001fc8264d6dbf0610804fc40
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Rewrite the check-out commit in one workspace. // Rewrite the check-out commit in one workspace.
@ -187,10 +187,10 @@ fn test_workspaces_updated_by_other() {
// The secondary workspace's working-copy commit was updated. // The secondary workspace's working-copy commit was updated.
insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###"
@ fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@ @ fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@
o a1896a17282f19089a5cec44358d6609910e0513 secondary@ a1896a17282f19089a5cec44358d6609910e0513 secondary@
o c0d4a99ef98ada7da8dc73a778bbb747c4178385 c0d4a99ef98ada7da8dc73a778bbb747c4178385
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
let stderr = test_env.jj_cmd_failure(&secondary_path, &["st"]); let stderr = test_env.jj_cmd_failure(&secondary_path, &["st"]);
insta::assert_snapshot!(stderr, @r###" insta::assert_snapshot!(stderr, @r###"
@ -206,11 +206,11 @@ fn test_workspaces_updated_by_other() {
"###); "###);
insta::assert_snapshot!(get_log_output(&test_env, &secondary_path), insta::assert_snapshot!(get_log_output(&test_env, &secondary_path),
@r###" @r###"
o fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@ fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@
@ a1896a17282f19089a5cec44358d6609910e0513 secondary@ @ a1896a17282f19089a5cec44358d6609910e0513 secondary@
o c0d4a99ef98ada7da8dc73a778bbb747c4178385 c0d4a99ef98ada7da8dc73a778bbb747c4178385
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }
@ -237,7 +237,7 @@ fn test_workspaces_update_stale_noop() {
let stdout = test_env.jj_cmd_success(&main_path, &["op", "log", "-Tdescription"]); let stdout = test_env.jj_cmd_success(&main_path, &["op", "log", "-Tdescription"]);
insta::assert_snapshot!(stdout, @r###" insta::assert_snapshot!(stdout, @r###"
@ add workspace 'default' @ add workspace 'default'
o initialize repo initialize repo
"###); "###);
} }
@ -267,11 +267,11 @@ fn test_workspaces_update_stale_snapshot() {
insta::assert_snapshot!(get_log_output(&test_env, &secondary_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &secondary_path), @r###"
@ 4976dfa88529814c4dd8c06253fbd82d076b79f8 secondary@ @ 4976dfa88529814c4dd8c06253fbd82d076b79f8 secondary@
o 8357b22214ba8adb6d2d378fa5b85274f1c7967c default@ 8357b22214ba8adb6d2d378fa5b85274f1c7967c default@
o 1a769966ed69fa7abadbd2d899e2be1025cb04fb 1a769966ed69fa7abadbd2d899e2be1025cb04fb
o b4a6c25e777817db67fdcbd50f1dd3b74b46b5f1 b4a6c25e777817db67fdcbd50f1dd3b74b46b5f1
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
} }
@ -307,11 +307,11 @@ fn test_workspaces_forget() {
// there's only one workspace. We should show it when the command is not run // there's only one workspace. We should show it when the command is not run
// from that workspace. // from that workspace.
insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###" insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###"
o feda1c4e5ffe63fb16818ccdd8c21483537e31f2 feda1c4e5ffe63fb16818ccdd8c21483537e31f2
o e949be04e93e830fcce23fefac985c1deee52eea e949be04e93e830fcce23fefac985c1deee52eea
o 123ed18e4c4c0d77428df41112bc02ffc83fb935 123ed18e4c4c0d77428df41112bc02ffc83fb935
o 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
"###); "###);
// Revision "@" cannot be used // Revision "@" cannot be used