cli: switch default graph style to be Sapling's curved style

We seem to quite unanimously prefer this style, so let's make the
default.
This commit is contained in:
Martin von Zweigbergk 2023-02-08 18:53:47 -08:00 committed by Martin von Zweigbergk
parent 990d87fad5
commit a67fbb6714
28 changed files with 1258 additions and 1254 deletions

View file

@ -107,9 +107,9 @@ ui.diff.format = "git"
### Graph style
```toml
# Possible values: "curved", "square", "ascii", "ascii-large",
# "legacy" (default)
ui.graph.style = "curved"
# Possible values: "curved" (default), "square", "ascii", "ascii-large",
# "legacy"
ui.graph.style = "square"
```
### Display of commit and change ids

View file

@ -194,7 +194,7 @@ impl UserSettings {
pub fn graph_style(&self) -> String {
self.config
.get_string("ui.graph.style")
.unwrap_or_else(|_| "legacy".to_string())
.unwrap_or_else(|_| "curved".to_string())
}
}

View file

@ -43,15 +43,15 @@ fn test_rebase_branch_with_merge() {
create_commit(&test_env, &repo_path, "e", &["a", "d"]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e
|\
o | d
o | c
| | o b
| |/
| o a
|/
o
@ e
o d
o c
o b
o a
o
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["abandon", "d"]);
@ -62,14 +62,14 @@ fn test_rebase_branch_with_merge() {
Added 0 files, modified 0 files, removed 1 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e
|\
o | c d
| | o b
| |/
| o a
|/
o
@ e
o c d
o b
o a
o
"###);
test_env.jj_cmd_success(&repo_path, &["undo"]);
@ -80,15 +80,14 @@ fn test_rebase_branch_with_merge() {
Added 0 files, modified 0 files, removed 3 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@
| o d e??
| o c
| | o b
| |/
|/|
o | a e??
|/
o
@
o d e??
o c
o b
o a e??
o
"###);
test_env.jj_cmd_success(&repo_path, &["undo"]);
@ -102,11 +101,11 @@ fn test_rebase_branch_with_merge() {
Added 0 files, modified 0 files, removed 3 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@
| o b
|/
o a e??
o c d e??
@
o b
o a e??
o c d e??
"###);
// Test abandoning the same commit twice directly
@ -116,13 +115,13 @@ fn test_rebase_branch_with_merge() {
Abandoned commit 1394f625cbbd b
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e
|\
o | d
o | c
| o a b
|/
o
@ e
o d
o c
o a b
o
"###);
// Test abandoning the same commit twice indirectly
@ -138,10 +137,10 @@ fn test_rebase_branch_with_merge() {
Added 0 files, modified 0 files, removed 4 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@
| o c d e??
|/
o a b e??
@
o c d e??
o a b e??
"###);
let stderr = test_env.jj_cmd_failure(&repo_path, &["abandon", "root"]);

View file

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

View file

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

View file

@ -33,20 +33,20 @@ fn test_checkout() {
Working copy now at: 05ce7118568d (no description set)
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 05ce7118568d3007efc9163b055f9cb4a6becfde
o 5c52832c3483e0ace06d047a806024984f28f1d7 second
o 69542c1984c1f9d91f7c6c9c9e6941782c944bd9 first
o 0000000000000000000000000000000000000000
@ 05ce7118568d3007efc9163b055f9cb4a6becfde
o 5c52832c3483e0ace06d047a806024984f28f1d7 second
o 69542c1984c1f9d91f7c6c9c9e6941782c944bd9 first
o 0000000000000000000000000000000000000000
"###);
// Can provide a description
test_env.jj_cmd_success(&repo_path, &["checkout", "@--", "-m", "my message"]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 1191baaf276e3d0b96b1747e885b3a517be80d6f my message
| o 5c52832c3483e0ace06d047a806024984f28f1d7 second
|/
o 69542c1984c1f9d91f7c6c9c9e6941782c944bd9 first
o 0000000000000000000000000000000000000000
@ 1191baaf276e3d0b96b1747e885b3a517be80d6f my message
o 5c52832c3483e0ace06d047a806024984f28f1d7 second
o 69542c1984c1f9d91f7c6c9c9e6941782c944bd9 first
o 0000000000000000000000000000000000000000
"###);
}

View file

@ -27,9 +27,9 @@ fn test_commit_with_description_from_cli() {
// Description applies to the current working-copy (not the new one)
test_env.jj_cmd_success(&workspace_path, &["commit", "-m=first"]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_path), @r###"
@ b88fb4e51bdd
o 69542c1984c1 first
o 000000000000
@ b88fb4e51bdd
o 69542c1984c1 first
o 000000000000
"###);
}
@ -46,9 +46,9 @@ fn test_commit_with_editor() {
std::fs::write(&edit_script, ["dump editor0", "write\nmodified"].join("\0")).unwrap();
test_env.jj_cmd_success(&workspace_path, &["commit"]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_path), @r###"
@ 3df78bc2b9b5
o 30a8c2b3d6eb modified
o 000000000000
@ 3df78bc2b9b5
o 30a8c2b3d6eb modified
o 000000000000
"###);
insta::assert_snapshot!(
std::fs::read_to_string(test_env.env_root().join("editor0")).unwrap(), @r###"

View file

@ -28,9 +28,9 @@ fn test_log_author_timestamp() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "author.timestamp()"]);
insta::assert_snapshot!(stdout, @r###"
@ 2001-02-03 04:05:09.000 +07:00
o 2001-02-03 04:05:07.000 +07:00
o 1970-01-01 00:00:00.000 +00:00
@ 2001-02-03 04:05:09.000 +07:00
o 2001-02-03 04:05:07.000 +07:00
o 1970-01-01 00:00:00.000 +00:00
"###);
}
@ -73,12 +73,12 @@ fn test_log_default() {
// Test default log output format
let stdout = test_env.jj_cmd_success(&repo_path, &["log"]);
insta::assert_snapshot!(stdout, @r###"
@ ffdaa62087a2 test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178d59d
| (empty) description 1
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97
| add a file
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
@ ffdaa62087a2 test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178d59d
(empty) description 1
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97
add a file
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
"###);
// Test default log output format with bracket prefixes
@ -87,12 +87,12 @@ fn test_log_default() {
&["log", "--config-toml", "ui.unique-prefixes='brackets'"],
);
insta::assert_snapshot!(stdout, @r###"
@ f[fdaa62087a2] test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9d[e54178d59d]
| (empty) description 1
o 9a[45c67d3e96] test.user@example.com 2001-02-03 04:05:08.000 +07:00 4[291e264ae97]
| add a file
o 0[00000000000] 1970-01-01 00:00:00.000 +00:00 0[00000000000]
(empty) (no description set)
@ f[fdaa62087a2] test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9d[e54178d59d]
(empty) description 1
o 9a[45c67d3e96] test.user@example.com 2001-02-03 04:05:08.000 +07:00 4[291e264ae97]
add a file
o 0[00000000000] 1970-01-01 00:00:00.000 +00:00 0[00000000000]
(empty) (no description set)
"###);
let stdout = test_env.jj_cmd_success(
&repo_path,
@ -105,12 +105,12 @@ fn test_log_default() {
],
);
insta::assert_snapshot!(stdout, @r###"
@ f[f] test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9d
| (empty) description 1
o 9a test.user@example.com 2001-02-03 04:05:08.000 +07:00 4[2]
| add a file
o 0[0] 1970-01-01 00:00:00.000 +00:00 0[0]
(empty) (no description set)
@ f[f] test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9d
(empty) description 1
o 9a test.user@example.com 2001-02-03 04:05:08.000 +07:00 4[2]
add a file
o 0[0] 1970-01-01 00:00:00.000 +00:00 0[0]
(empty) (no description set)
"###);
// Test default log output format with styled prefixes and color
@ -124,12 +124,12 @@ fn test_log_default() {
],
);
insta::assert_snapshot!(stdout, @r###"
@ ffdaa62087a2 test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178d59d
| (empty) description 1
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97
| add a file
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
@ ffdaa62087a2 test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178d59d
(empty) description 1
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97
add a file
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
"###);
let stdout = test_env.jj_cmd_success(
&repo_path,
@ -143,12 +143,12 @@ fn test_log_default() {
],
);
insta::assert_snapshot!(stdout, @r###"
@ f test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9d
| (empty) description 1
o 9a test.user@example.com 2001-02-03 04:05:08.000 +07:00 4
| add a file
o 0 1970-01-01 00:00:00.000 +00:00 0
(empty) (no description set)
@ f test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9d
(empty) description 1
o 9a test.user@example.com 2001-02-03 04:05:08.000 +07:00 4
add a file
o 0 1970-01-01 00:00:00.000 +00:00 0
(empty) (no description set)
"###);
// Test default log output format with prefixes explicitly disabled
@ -157,12 +157,12 @@ fn test_log_default() {
&["log", "--config-toml", "ui.unique-prefixes='none'"],
);
insta::assert_snapshot!(stdout, @r###"
@ ffdaa62087a2 test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178d59d
| (empty) description 1
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97
| add a file
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
@ ffdaa62087a2 test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178d59d
(empty) description 1
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97
add a file
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
"###);
let stdout = test_env.jj_cmd_success(
&repo_path,
@ -175,23 +175,23 @@ fn test_log_default() {
],
);
insta::assert_snapshot!(stdout, @r###"
@ f test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9
| (empty) description 1
o 9 test.user@example.com 2001-02-03 04:05:08.000 +07:00 4
| add a file
o 0 1970-01-01 00:00:00.000 +00:00 0
(empty) (no description set)
@ f test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9
(empty) description 1
o 9 test.user@example.com 2001-02-03 04:05:08.000 +07:00 4
add a file
o 0 1970-01-01 00:00:00.000 +00:00 0
(empty) (no description set)
"###);
// Color
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "--color=always"]);
insta::assert_snapshot!(stdout, @r###"
@ ffdaa62087a2 test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178d59d
| (empty) description 1
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97
| add a file
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
@ ffdaa62087a2 test.user@example.com 2001-02-03 04:05:09.000 +07:00 my-branch 9de54178d59d
(empty) description 1
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 4291e264ae97
add a file
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
"###);
// Color without graph
@ -217,10 +217,10 @@ fn test_log_default_divergence() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log"]);
// No divergence
insta::assert_snapshot!(stdout, @r###"
@ 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c
| description 1
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
@ 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c
description 1
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
"###);
// Create divergence
@ -231,23 +231,23 @@ fn test_log_default_divergence() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log"]);
insta::assert_snapshot!(stdout, @r###"
Concurrent modification detected, resolving automatically.
o 9a45c67d3e96?? test.user@example.com 2001-02-03 04:05:10.000 +07:00 8979953d4c67
| description 2
| @ 9a45c67d3e96?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c
|/ description 1
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
o 9a45c67d3e96?? test.user@example.com 2001-02-03 04:05:10.000 +07:00 8979953d4c67
description 2
@ 9a45c67d3e96?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c
description 1
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
"###);
// Color
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "--color=always"]);
insta::assert_snapshot!(stdout, @r###"
o 9a45c67d3e96?? test.user@example.com 2001-02-03 04:05:10.000 +07:00 8979953d4c67
| description 2
| @ 9a45c67d3e96?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c
|/ description 1
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
o 9a45c67d3e96?? test.user@example.com 2001-02-03 04:05:10.000 +07:00 8979953d4c67
description 2
@ 9a45c67d3e96?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e633c
description 1
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
"###);
}
@ -262,11 +262,11 @@ fn test_log_git_head() {
std::fs::write(repo_path.join("file"), "foo\n").unwrap();
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "--color=always"]);
insta::assert_snapshot!(stdout, @r###"
@ 8e4fac809cbb test.user@example.com 2001-02-03 04:05:09.000 +07:00 50aaf4754c1e
| initial
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:07.000 +07:00 master HEAD@git 230dd059e1b0
| (empty) (no description set)
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
@ 8e4fac809cbb test.user@example.com 2001-02-03 04:05:09.000 +07:00 50aaf4754c1e
initial
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:07.000 +07:00 master HEAD@git 230dd059e1b0
(empty) (no description set)
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(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"]);
insta::assert_snapshot!(stdout, @r###"
Concurrent modification detected, resolving automatically.
o message 2
| @ message 1
|/
o
o message 2
@ message 1
o
"###);
}
@ -51,17 +51,17 @@ fn test_concurrent_operations_auto_rebase() {
test_env.jj_cmd_success(&repo_path, &["describe", "-m", "initial"]);
let stdout = test_env.jj_cmd_success(&repo_path, &["op", "log"]);
insta::assert_snapshot!(stdout, @r###"
@ eac5ad986688 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 123ed18e4c4c0d77428df41112bc02ffc83fb935
| args: jj describe -m initial
o 09a674690d20 test-username@host.example.com 2001-02-03 04:05:08.000 +07:00 - 2001-02-03 04:05:08.000 +07:00
| snapshot working copy
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
| 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
initialize repo
@ eac5ad986688 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 123ed18e4c4c0d77428df41112bc02ffc83fb935
args: jj describe -m initial
o 09a674690d20 test-username@host.example.com 2001-02-03 04:05:08.000 +07:00 - 2001-02-03 04:05:08.000 +07:00
snapshot working copy
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
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
initialize repo
"###);
let op_id_hex = stdout[2..14].to_string();
let op_id_hex = stdout[3..15].to_string();
test_env.jj_cmd_success(&repo_path, &["describe", "-m", "rewritten"]);
test_env.jj_cmd_success(
@ -74,9 +74,9 @@ fn test_concurrent_operations_auto_rebase() {
insta::assert_snapshot!(stdout, @r###"
Concurrent modification detected, resolving automatically.
Rebased 1 descendant commits onto commits rewritten by other operation
o 3f06323826b4a293a9ee6d24cc0e07ad2961b5d5 new child
@ d91437157468ec86bbbc9e6a14a60d3e8d1790ac rewritten
o 0000000000000000000000000000000000000000
o 3f06323826b4a293a9ee6d24cc0e07ad2961b5d5 new child
@ d91437157468ec86bbbc9e6a14a60d3e8d1790ac rewritten
o 0000000000000000000000000000000000000000
"###);
}
@ -89,7 +89,7 @@ fn test_concurrent_operations_wc_modified() {
std::fs::write(repo_path.join("file"), "contents\n").unwrap();
test_env.jj_cmd_success(&repo_path, &["describe", "-m", "initial"]);
let stdout = test_env.jj_cmd_success(&repo_path, &["op", "log"]);
let op_id_hex = stdout[2..14].to_string();
let op_id_hex = stdout[3..15].to_string();
test_env.jj_cmd_success(
&repo_path,
@ -105,11 +105,11 @@ fn test_concurrent_operations_wc_modified() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id \" \" description"]);
insta::assert_snapshot!(stdout, @r###"
Concurrent modification detected, resolving automatically.
@ 4eb0610031b7cd148ff9f729a673a3f815033170 new child1
| o 4b20e61d23ee7d7c4d5e61e11e97c26e716f9c30 new child2
|/
o 52c893bf3cd201e215b23e084e8a871244ca14d5 initial
o 0000000000000000000000000000000000000000
@ 4eb0610031b7cd148ff9f729a673a3f815033170 new child1
o 4b20e61d23ee7d7c4d5e61e11e97c26e716f9c30 new child2
o 52c893bf3cd201e215b23e084e8a871244ca14d5 initial
o 0000000000000000000000000000000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "--git"]);
insta::assert_snapshot!(stdout, @r###"
@ -125,26 +125,26 @@ fn test_concurrent_operations_wc_modified() {
// The working copy should be committed after merging the operations
let stdout = test_env.jj_cmd_success(&repo_path, &["op", "log"]);
insta::assert_snapshot!(redact_op_log(&stdout), @r###"
@
| snapshot working copy
o
|\ resolve concurrent operations
| |
o |
| | new empty commit
| |
| o
|/ new empty commit
|
o
| describe commit cf911c223d3e24e001fc8264d6dbf0610804fc40
|
o
| snapshot working copy
o
|
o
initialize repo
@
snapshot working copy
o
resolve concurrent operations
o
new empty commit
o
new empty commit
o
describe commit cf911c223d3e24e001fc8264d6dbf0610804fc40
o
snapshot working copy
o
o
initialize repo
"###);
}

View file

@ -41,12 +41,12 @@ fn test_duplicate() {
create_commit(&test_env, &repo_path, "c", &["a", "b"]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 17a00fc21654 c
|\
o | d370aee184ba b
| o 2443ea76b0b1 a
|/
o 000000000000
@ 17a00fc21654 c
o d370aee184ba b
o 2443ea76b0b1 a
o 000000000000
"###);
let stderr = test_env.jj_cmd_failure(&repo_path, &["duplicate", "root"]);
@ -59,14 +59,14 @@ fn test_duplicate() {
Duplicated 2443ea76b0b1 as 2f6dc5a1ffc2 a
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 2f6dc5a1ffc2 a
| @ 17a00fc21654 c
| |\
| o | d370aee184ba b
|/ /
| o 2443ea76b0b1 a
|/
o 000000000000
o 2f6dc5a1ffc2 a
@ 17a00fc21654 c
o d370aee184ba b
o 2443ea76b0b1 a
o 000000000000
"###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["undo"]), @"");
@ -75,17 +75,14 @@ fn test_duplicate() {
Duplicated 17a00fc21654 as 1dd099ea963c c
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 1dd099ea963c c
|\
| | @ 17a00fc21654 c
| | |\
| |/ /
|/| |
| |/
o | d370aee184ba b
| o 2443ea76b0b1 a
|/
o 000000000000
o 1dd099ea963c c
@ 17a00fc21654 c
o d370aee184ba b
o 2443ea76b0b1 a
o 000000000000
"###);
}
@ -102,14 +99,14 @@ fn test_duplicate_many() {
create_commit(&test_env, &repo_path, "e", &["b", "d"]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 921dde6e55c0 e
|\
o | ebd06dba20ec d
o | c0cb3a0b73e7 c
| o 1394f625cbbd b
|/
o 2443ea76b0b1 a
o 000000000000
@ 921dde6e55c0 e
o ebd06dba20ec d
o c0cb3a0b73e7 c
o 1394f625cbbd b
o 2443ea76b0b1 a
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["duplicate", "b:"]);
@ -118,19 +115,18 @@ fn test_duplicate_many() {
Duplicated 921dde6e55c0 as 8348ddcec733 e
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 8348ddcec733 e
|\
o | 3b74d9691015 b
| | @ 921dde6e55c0 e
| | |\
| |/ /
| o | ebd06dba20ec d
| o | c0cb3a0b73e7 c
|/ /
| o 1394f625cbbd b
|/
o 2443ea76b0b1 a
o 000000000000
o 8348ddcec733 e
o 3b74d9691015 b
@ 921dde6e55c0 e
o ebd06dba20ec d
o c0cb3a0b73e7 c
o 1394f625cbbd b
o 2443ea76b0b1 a
o 000000000000
"###);
// Try specifying the same commit twice directly
@ -140,16 +136,16 @@ fn test_duplicate_many() {
Duplicated 1394f625cbbd as 0276d3d7c24d b
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 0276d3d7c24d b
| @ 921dde6e55c0 e
| |\
| o | ebd06dba20ec d
| o | c0cb3a0b73e7 c
|/ /
| o 1394f625cbbd b
|/
o 2443ea76b0b1 a
o 000000000000
o 0276d3d7c24d b
@ 921dde6e55c0 e
o ebd06dba20ec d
o c0cb3a0b73e7 c
o 1394f625cbbd b
o 2443ea76b0b1 a
o 000000000000
"###);
// Try specifying the same commit twice indirectly
@ -161,34 +157,33 @@ fn test_duplicate_many() {
Duplicated 921dde6e55c0 as 0f7430f2727a e
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 0f7430f2727a e
|\
o | 2181781b4f81 d
| o fa167d18a83a b
| | @ 921dde6e55c0 e
| | |\
| | o | ebd06dba20ec d
| |/ /
|/| |
o | | c0cb3a0b73e7 c
|/ /
| o 1394f625cbbd b
|/
o 2443ea76b0b1 a
o 000000000000
o 0f7430f2727a e
o 2181781b4f81 d
o fa167d18a83a b
@ 921dde6e55c0 e
o ebd06dba20ec d
o c0cb3a0b73e7 c
o 1394f625cbbd b
o 2443ea76b0b1 a
o 000000000000
"###);
test_env.jj_cmd_success(&repo_path, &["undo"]);
// Reminder of the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 921dde6e55c0 e
|\
o | ebd06dba20ec d
o | c0cb3a0b73e7 c
| o 1394f625cbbd b
|/
o 2443ea76b0b1 a
o 000000000000
@ 921dde6e55c0 e
o ebd06dba20ec d
o c0cb3a0b73e7 c
o 1394f625cbbd b
o 2443ea76b0b1 a
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["duplicate", "d:", "a"]);
insta::assert_snapshot!(stdout, @r###"
@ -197,23 +192,20 @@ fn test_duplicate_many() {
Duplicated 921dde6e55c0 as 9bd4389f5d47 e
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 9bd4389f5d47 e
|\
o | d94e4c55a68b d
| | o c6f7f8c4512e a
| | | @ 921dde6e55c0 e
| | | |\
| | |_|/
| |/| |
| | | o ebd06dba20ec d
| |_|/
|/| |
o | | c0cb3a0b73e7 c
| o | 1394f625cbbd b
|/ /
o | 2443ea76b0b1 a
|/
o 000000000000
o 9bd4389f5d47 e
o d94e4c55a68b d
o c6f7f8c4512e a
@ 921dde6e55c0 e
o ebd06dba20ec d
o c0cb3a0b73e7 c
o 1394f625cbbd b
o 2443ea76b0b1 a
o 000000000000
"###);
// Check for BUG -- makes too many 'a'-s, etc.
@ -227,22 +219,22 @@ fn test_duplicate_many() {
Duplicated 921dde6e55c0 as ee8fe64ed254 e
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o ee8fe64ed254 e
|\
o | 2f2442db08eb d
o | df53fa589286 c
| o e13ac0adabdf b
|/
o 0fe67a05989e a
| @ 921dde6e55c0 e
| |\
| o | ebd06dba20ec d
| o | c0cb3a0b73e7 c
| | o 1394f625cbbd b
| |/
| o 2443ea76b0b1 a
|/
o 000000000000
o ee8fe64ed254 e
o 2f2442db08eb d
o df53fa589286 c
o e13ac0adabdf b
o 0fe67a05989e a
@ 921dde6e55c0 e
o ebd06dba20ec d
o c0cb3a0b73e7 c
o 1394f625cbbd b
o 2443ea76b0b1 a
o 000000000000
"###);
}
@ -255,8 +247,8 @@ fn test_undo_after_duplicate() {
create_commit(&test_env, &repo_path, "a", &[]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 2443ea76b0b1 a
o 000000000000
@ 2443ea76b0b1 a
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["duplicate", "a"]);
@ -264,16 +256,16 @@ fn test_undo_after_duplicate() {
Duplicated 2443ea76b0b1 as f5cefcbb65a4 a
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o f5cefcbb65a4 a
| @ 2443ea76b0b1 a
|/
o 000000000000
o f5cefcbb65a4 a
@ 2443ea76b0b1 a
o 000000000000
"###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["undo"]), @"");
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 2443ea76b0b1 a
o 000000000000
@ 2443ea76b0b1 a
o 000000000000
"###);
}
@ -288,9 +280,9 @@ fn test_rebase_duplicates() {
create_commit(&test_env, &repo_path, "b", &["a"]);
// Test the setup
insta::assert_snapshot!(get_log_output_with_ts(&test_env, &repo_path), @r###"
@ 1394f625cbbd b @ 2001-02-03 04:05:11.000 +07:00
o 2443ea76b0b1 a @ 2001-02-03 04:05:09.000 +07:00
o 000000000000 @ 1970-01-01 00:00:00.000 +00:00
@ 1394f625cbbd b @ 2001-02-03 04:05:11.000 +07:00
o 2443ea76b0b1 a @ 2001-02-03 04:05:09.000 +07:00
o 000000000000 @ 1970-01-01 00:00:00.000 +00:00
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["duplicate", "b"]);
@ -302,13 +294,13 @@ fn test_rebase_duplicates() {
Duplicated 1394f625cbbd as 870cf438ccbb b
"###);
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
| o fdaaf3950f07 b @ 2001-02-03 04:05:13.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
o 000000000000 @ 1970-01-01 00:00:00.000 +00:00
o 870cf438ccbb b @ 2001-02-03 04:05:14.000 +07:00
o fdaaf3950f07 b @ 2001-02-03 04:05:13.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
o 000000000000 @ 1970-01-01 00:00:00.000 +00:00
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-s", "a", "-d", "a-"]);
@ -319,13 +311,13 @@ fn test_rebase_duplicates() {
// Some of the duplicate commits' timestamps were changed a little to make them
// have distinct commit ids.
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
| o 08beb14c3ead b @ 2001-02-03 04:05:15.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
o 000000000000 @ 1970-01-01 00:00:00.000 +00:00
o b43fe7354758 b @ 2001-02-03 04:05:14.000 +07:00
o 08beb14c3ead b @ 2001-02-03 04:05:15.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
o 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
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o b2f7e9c549aa second
@ f41390a5efbf first
o 000000000000
o b2f7e9c549aa second
@ f41390a5efbf first
o 000000000000
"###);
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();
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
Rebased 1 descendant commits onto updated working copy
o 51d937a3eeb4 second
@ 409306de8f44 first
o 000000000000
o 51d937a3eeb4 second
@ 409306de8f44 first
o 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, &["edit", "@-"]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 5c52832c3483 second
@ 69542c1984c1 first
o 000000000000
o 5c52832c3483 second
@ 69542c1984c1 first
o 000000000000
"###);
// Make the Git backend fail to read the current working copy commit

View file

@ -59,9 +59,9 @@ fn test_git_colocated() {
// Import the repo
test_env.jj_cmd_success(&workspace_root, &["init", "--git-repo", "."]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ 3e9369cd54227eb88455e1834dbc08aad6a16ac4
o e61b6729ff4292870702f2f72b2a60165679ef37 master
o 0000000000000000000000000000000000000000
@ 3e9369cd54227eb88455e1834dbc08aad6a16ac4
o e61b6729ff4292870702f2f72b2a60165679ef37 master
o 0000000000000000000000000000000000000000
"###);
insta::assert_snapshot!(
git_repo.head().unwrap().peel_to_commit().unwrap().id().to_string(),
@ -72,9 +72,9 @@ fn test_git_colocated() {
// HEAD commit should not
std::fs::write(workspace_root.join("file"), "modified").unwrap();
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ b26951a9c6f5c270e4d039880208952fd5faae5e
o e61b6729ff4292870702f2f72b2a60165679ef37 master
o 0000000000000000000000000000000000000000
@ b26951a9c6f5c270e4d039880208952fd5faae5e
o e61b6729ff4292870702f2f72b2a60165679ef37 master
o 0000000000000000000000000000000000000000
"###);
insta::assert_snapshot!(
git_repo.head().unwrap().peel_to_commit().unwrap().id().to_string(),
@ -84,10 +84,10 @@ fn test_git_colocated() {
// Create a new change from jj and check that it's reflected in Git
test_env.jj_cmd_success(&workspace_root, &["new"]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ 9dbb23ff2ff5e66c43880f1042369d704f7a321e
o b26951a9c6f5c270e4d039880208952fd5faae5e
o e61b6729ff4292870702f2f72b2a60165679ef37 master
o 0000000000000000000000000000000000000000
@ 9dbb23ff2ff5e66c43880f1042369d704f7a321e
o b26951a9c6f5c270e4d039880208952fd5faae5e
o e61b6729ff4292870702f2f72b2a60165679ef37 master
o 0000000000000000000000000000000000000000
"###);
insta::assert_snapshot!(
git_repo.head().unwrap().target().unwrap().to_string(),
@ -109,16 +109,16 @@ fn test_git_colocated_export_branches_on_snapshot() {
std::fs::write(workspace_root.join("file"), "initial").unwrap();
test_env.jj_cmd_success(&workspace_root, &["branch", "create", "foo"]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ 438471f3fbf1004298d8fb01eeb13663a051a643 foo
o 0000000000000000000000000000000000000000
@ 438471f3fbf1004298d8fb01eeb13663a051a643 foo
o 0000000000000000000000000000000000000000
"###);
// The branch gets updated when we modify the working copy, and it should get
// exported to Git without requiring any other changes
std::fs::write(workspace_root.join("file"), "modified").unwrap();
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ fab22d1acf5bb9c5aa48cb2c3dd2132072a359ca foo
o 0000000000000000000000000000000000000000
@ fab22d1acf5bb9c5aa48cb2c3dd2132072a359ca foo
o 0000000000000000000000000000000000000000
"###);
insta::assert_snapshot!(git_repo
.find_reference("refs/heads/foo")
@ -158,9 +158,9 @@ fn test_git_colocated_rebase_on_import() {
git_repo.branch("master", &commit1, true).unwrap();
git_repo.set_head("refs/heads/master").unwrap();
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ 7f96185cfbe36341d0f9a86ebfaeab67a5922c7e
o 4bcbeaba9a4b309c5f45a8807fbf5499b9714315 master
o 0000000000000000000000000000000000000000
@ 7f96185cfbe36341d0f9a86ebfaeab67a5922c7e
o 4bcbeaba9a4b309c5f45a8807fbf5499b9714315 master
o 0000000000000000000000000000000000000000
"###);
}
@ -173,11 +173,11 @@ fn test_git_colocated_branches() {
test_env.jj_cmd_success(&workspace_root, &["new", "-m", "foo"]);
test_env.jj_cmd_success(&workspace_root, &["new", "@-", "-m", "bar"]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ 3560559274ab431feea00b7b7e0b9250ecce951f
| o 1e6f0b403ed2ff9713b5d6b1dc601e4804250cda
|/
o 230dd059e1b059aefc0da06a2e5a7dbf22362f22 master
o 0000000000000000000000000000000000000000
@ 3560559274ab431feea00b7b7e0b9250ecce951f
o 1e6f0b403ed2ff9713b5d6b1dc601e4804250cda
o 230dd059e1b059aefc0da06a2e5a7dbf22362f22 master
o 0000000000000000000000000000000000000000
"###);
// Create a branch in jj. It should be exported to Git even though it points to
@ -203,11 +203,11 @@ fn test_git_colocated_branches() {
.unwrap();
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
Working copy now at: eb08b363bb5e (no description set)
@ eb08b363bb5ef8ee549314260488980d7bbe8f63
| o 1e6f0b403ed2ff9713b5d6b1dc601e4804250cda master
|/
o 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
@ eb08b363bb5ef8ee549314260488980d7bbe8f63
o 1e6f0b403ed2ff9713b5d6b1dc601e4804250cda master
o 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
"###);
}
@ -248,10 +248,10 @@ fn test_git_colocated_fetch_deleted_branch() {
git2::Repository::clone(origin_path.to_str().unwrap(), &clone_path).unwrap();
test_env.jj_cmd_success(&clone_path, &["init", "--git-repo=."]);
insta::assert_snapshot!(get_log_output(&test_env, &clone_path), @r###"
@ bc7d08e8de9b7bc248b9358a05e96f1671bbd4d9
o e1f4268fabd2c84e880c5eb5bd87e076180fc8e3 B
o a86754f975f953fa25da4265764adc0c62e9ce6b A master
o 0000000000000000000000000000000000000000
@ bc7d08e8de9b7bc248b9358a05e96f1671bbd4d9
o e1f4268fabd2c84e880c5eb5bd87e076180fc8e3 B
o a86754f975f953fa25da4265764adc0c62e9ce6b A master
o 0000000000000000000000000000000000000000
"###);
test_env.jj_cmd_success(&origin_path, &["branch", "delete", "B"]);
@ -259,10 +259,10 @@ fn test_git_colocated_fetch_deleted_branch() {
insta::assert_snapshot!(stdout, @"");
// TODO: e1f4 should have been abandoned (#864)
insta::assert_snapshot!(get_log_output(&test_env, &clone_path), @r###"
@ bc7d08e8de9b7bc248b9358a05e96f1671bbd4d9
o e1f4268fabd2c84e880c5eb5bd87e076180fc8e3
o a86754f975f953fa25da4265764adc0c62e9ce6b A master
o 0000000000000000000000000000000000000000
@ bc7d08e8de9b7bc248b9358a05e96f1671bbd4d9
o e1f4268fabd2c84e880c5eb5bd87e076180fc8e3
o a86754f975f953fa25da4265764adc0c62e9ce6b A master
o 0000000000000000000000000000000000000000
"###);
}
@ -275,26 +275,26 @@ fn test_git_colocated_squash_undo() {
test_env.jj_cmd_success(&repo_path, &["ci", "-m=A"]);
// Test the setup
insta::assert_snapshot!(get_log_output_divergence(&test_env, &repo_path), @r###"
@ 8e4fac809cbb 8f71e3b6a3be
o 9a45c67d3e96 a86754f975f9 A master
o 000000000000 000000000000
@ 8e4fac809cbb 8f71e3b6a3be
o 9a45c67d3e96 a86754f975f9 A master
o 000000000000 000000000000
"###);
test_env.jj_cmd_success(&repo_path, &["squash"]);
insta::assert_snapshot!(get_log_output_divergence(&test_env, &repo_path), @r###"
@ 0757f5ec8418 f0c12b0396d9
o 9a45c67d3e96 2f376ea1478c A master
o 000000000000 000000000000
@ 0757f5ec8418 f0c12b0396d9
o 9a45c67d3e96 2f376ea1478c A master
o 000000000000 000000000000
"###);
test_env.jj_cmd_success(&repo_path, &["undo"]);
// TODO: There should be no divergence here; 2f376ea1478c should be hidden
// (#922)
insta::assert_snapshot!(get_log_output_divergence(&test_env, &repo_path), @r###"
o 9a45c67d3e96 2f376ea1478c A master !divergence!
| @ 8e4fac809cbb 8f71e3b6a3be
| o 9a45c67d3e96 a86754f975f9 A !divergence!
|/
o 000000000000 000000000000
o 9a45c67d3e96 2f376ea1478c A master !divergence!
@ 8e4fac809cbb 8f71e3b6a3be
o 9a45c67d3e96 a86754f975f9 A !divergence!
o 000000000000 000000000000
"###);
}
@ -372,9 +372,9 @@ fn test_git_colocated_unreachable_commits() {
// Import the repo while there is no path to the second commit
test_env.jj_cmd_success(&workspace_root, &["init", "--git-repo", "."]);
insta::assert_snapshot!(get_log_output(&test_env, &workspace_root), @r###"
@ 66ae47cee4f8c28ee8d7e4f5d9401b03c07e22f2
o 2ee37513d2b5e549f7478c671a780053614bff19 master
o 0000000000000000000000000000000000000000
@ 66ae47cee4f8c28ee8d7e4f5d9401b03c07e22f2
o 2ee37513d2b5e549f7478c671a780053614bff19 master
o 0000000000000000000000000000000000000000
"###);
insta::assert_snapshot!(
git_repo.head().unwrap().peel_to_commit().unwrap().id().to_string(),

View file

@ -71,8 +71,8 @@ fn test_ignore_working_copy() {
std::fs::write(repo_path.join("file"), "initial").unwrap();
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###"
@ 438471f3fbf1004298d8fb01eeb13663a051a643
o 0000000000000000000000000000000000000000
@ 438471f3fbf1004298d8fb01eeb13663a051a643
o 0000000000000000000000000000000000000000
"###);
// Modify the file. With --ignore-working-copy, we still get the same commit
@ -87,8 +87,8 @@ fn test_ignore_working_copy() {
// But without --ignore-working-copy, we get a new commit ID.
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###"
@ fab22d1acf5bb9c5aa48cb2c3dd2132072a359ca
o 0000000000000000000000000000000000000000
@ fab22d1acf5bb9c5aa48cb2c3dd2132072a359ca
o 0000000000000000000000000000000000000000
"###);
}
@ -182,30 +182,30 @@ fn test_color_config() {
// Test that --color=always is respected.
let stdout = test_env.jj_cmd_success(&repo_path, &["--color=always", "log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
"###);
// Test that color is used if it's requested in the config file
test_env.add_config(r#"ui.color="always""#);
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
"###);
// Test that --color=never overrides the config.
let stdout = test_env.jj_cmd_success(&repo_path, &["--color=never", "log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
"###);
// Test that --color=auto overrides the config.
let stdout = test_env.jj_cmd_success(&repo_path, &["--color=auto", "log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
"###);
// Test that --config-toml 'ui.color="never"' overrides the config.
@ -220,8 +220,8 @@ fn test_color_config() {
],
);
insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
"###);
// --color overrides --config-toml 'ui.color=...'.
@ -238,16 +238,16 @@ fn test_color_config() {
],
);
insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
"###);
// Test that NO_COLOR does NOT override the request for color in the config file
test_env.add_env_var("NO_COLOR", "");
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
"###);
// Test that per-repo config overrides the user config.
@ -258,8 +258,8 @@ fn test_color_config() {
.unwrap();
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]);
insta::assert_snapshot!(stdout, @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
"###);
}

View file

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

View file

@ -43,21 +43,21 @@ fn test_log_with_or_without_diff() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description"]);
insta::assert_snapshot!(stdout, @r###"
@ a new commit
o add a file
o
@ a new commit
o add a file
o
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "-p"]);
insta::assert_snapshot!(stdout, @r###"
@ a new commit
| Modified regular file file1:
| 1 1: foo
| 2: bar
o add a file
| Added regular file file1:
| 1: foo
o
@ a new commit
Modified regular file file1:
1 1: foo
2: bar
o add a file
Added regular file file1:
1: foo
o
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "--no-graph"]);
@ -69,40 +69,40 @@ fn test_log_with_or_without_diff() {
// `-p` for default diff output, `-s` for summary
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "-p", "-s"]);
insta::assert_snapshot!(stdout, @r###"
@ a new commit
| M file1
| Modified regular file file1:
| 1 1: foo
| 2: bar
o add a file
| A file1
| Added regular file file1:
| 1: foo
o
@ a new commit
M file1
Modified regular file file1:
1 1: foo
2: bar
o add a file
A file1
Added regular file file1:
1: foo
o
"###);
// `-s` for summary, `--git` for git diff (which implies `-p`)
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "-s", "--git"]);
insta::assert_snapshot!(stdout, @r###"
@ a new commit
| M file1
| diff --git a/file1 b/file1
| index 257cc5642c...3bd1f0e297 100644
| --- a/file1
| +++ b/file1
| @@ -1,1 +1,2 @@
| foo
| +bar
o add a file
| A file1
| diff --git a/file1 b/file1
| new file mode 100644
| index 0000000000..257cc5642c
| --- /dev/null
| +++ b/file1
| @@ -1,0 +1,1 @@
| +foo
o
@ a new commit
M file1
diff --git a/file1 b/file1
index 257cc5642c...3bd1f0e297 100644
--- a/file1
+++ b/file1
@@ -1,1 +1,2 @@
foo
+bar
o add a file
A file1
diff --git a/file1 b/file1
new file mode 100644
index 0000000000..257cc5642c
--- /dev/null
+++ b/file1
@@ -1,0 +1,1 @@
+foo
o
"###);
// `-p` enables default "summary" output, so `-s` is noop
@ -118,11 +118,11 @@ fn test_log_with_or_without_diff() {
],
);
insta::assert_snapshot!(stdout, @r###"
@ a new commit
| M file1
o add a file
| A file1
o
@ a new commit
M file1
o add a file
A file1
o
"###);
// `-p` enables default "color-words" diff output, so `--color-words` is noop
@ -131,14 +131,14 @@ fn test_log_with_or_without_diff() {
&["log", "-T", "description", "-p", "--color-words"],
);
insta::assert_snapshot!(stdout, @r###"
@ a new commit
| Modified regular file file1:
| 1 1: foo
| 2: bar
o add a file
| Added regular file file1:
| 1: foo
o
@ a new commit
Modified regular file file1:
1 1: foo
2: bar
o add a file
Added regular file file1:
1: foo
o
"###);
// `--git` enables git diff, so `-p` is noop
@ -205,11 +205,11 @@ fn test_log_with_or_without_diff() {
// `-s` with or without graph
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "-s"]);
insta::assert_snapshot!(stdout, @r###"
@ a new commit
| M file1
o add a file
| A file1
o
@ a new commit
M file1
o add a file
A file1
o
"###);
let stdout = test_env.jj_cmd_success(
&repo_path,
@ -228,14 +228,14 @@ fn test_log_with_or_without_diff() {
&["log", "-T", "description", "-r", "@", "--git"],
);
insta::assert_snapshot!(stdout, @r###"
@ a new commit
~ diff --git a/file1 b/file1
index 257cc5642c...3bd1f0e297 100644
--- a/file1
+++ b/file1
@@ -1,1 +1,2 @@
foo
+bar
@ a new commit
diff --git a/file1 b/file1
~ index 257cc5642c...3bd1f0e297 100644
--- a/file1
+++ b/file1
@@ -1,1 +1,2 @@
foo
+bar
"###);
let stdout = test_env.jj_cmd_success(
&repo_path,
@ -258,10 +258,10 @@ fn test_log_with_or_without_diff() {
&["log", "-T", "description", "-r", "@", "--color-words"],
);
insta::assert_snapshot!(stdout, @r###"
@ a new commit
~ Modified regular file file1:
1 1: foo
2: bar
@ a new commit
Modified regular file file1:
~ 1 1: foo
2: bar
"###);
let stdout = test_env.jj_cmd_success(
&repo_path,
@ -305,8 +305,9 @@ fn test_log_prefix_highlight_brackets() {
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-r", "original", "-T", &prefix_format(Some(12))]),
@r###"
@ Change 9[a45c67d3e96] initial b[a1a30916d29] original
~
@ Change 9[a45c67d3e96] initial b[a1a30916d29] original
~
"###
);
@ -323,56 +324,57 @@ fn test_log_prefix_highlight_brackets() {
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-r", "original", "-T", &prefix_format(Some(12))]),
@r###"
o Change 9a4[5c67d3e96] initial ba1[a30916d29] original
~
o Change 9a4[5c67d3e96] initial ba1[a30916d29] original
~
"###
);
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-r", ":@", "-T", &prefix_format(Some(12))]),
@r###"
@ Change 39c[3fb0af576] commit9 03f[51310b83e]
o Change fd[f57e73a939] commit8 f7[7fb1909080]
o Change fa9[213bcf78e] commit7 e7[15ad5db646]
o Change 0cff[a7997ffe] commit6 38[622e54e2e5]
o Change 1b[76972398e6] commit5 0cf4[2f60199c]
o Change 48[523d946ad2] commit4 9e[6015e4e622]
o Change 19[b790168e73] commit3 06f[34d9b1475]
o Change 8b12[d1f268f8] commit2 1f[99a5e19891]
o Change d0[43564ef936] commit1 7b[1f7dee65b4]
o Change 9a4[5c67d3e96] initial ba1[a30916d29] original
o Change 000[000000000] 000[000000000]
@ Change 39c[3fb0af576] commit9 03f[51310b83e]
o Change fd[f57e73a939] commit8 f7[7fb1909080]
o Change fa9[213bcf78e] commit7 e7[15ad5db646]
o Change 0cff[a7997ffe] commit6 38[622e54e2e5]
o Change 1b[76972398e6] commit5 0cf4[2f60199c]
o Change 48[523d946ad2] commit4 9e[6015e4e622]
o Change 19[b790168e73] commit3 06f[34d9b1475]
o Change 8b12[d1f268f8] commit2 1f[99a5e19891]
o Change d0[43564ef936] commit1 7b[1f7dee65b4]
o Change 9a4[5c67d3e96] initial ba1[a30916d29] original
o Change 000[000000000] 000[000000000]
"###
);
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-r", ":@", "-T", &prefix_format(Some(3))]),
@r###"
@ Change 39c commit9 03f
o Change fd[f] commit8 f7[7]
o Change fa9 commit7 e7[1]
o Change 0cff commit6 38[6]
o Change 1b[7] commit5 0cf4
o Change 48[5] commit4 9e[6]
o Change 19[b] commit3 06f
o Change 8b12 commit2 1f[9]
o Change d0[4] commit1 7b[1]
o Change 9a4 initial ba1 original
o Change 000 000
@ Change 39c commit9 03f
o Change fd[f] commit8 f7[7]
o Change fa9 commit7 e7[1]
o Change 0cff commit6 38[6]
o Change 1b[7] commit5 0cf4
o Change 48[5] commit4 9e[6]
o Change 19[b] commit3 06f
o Change 8b12 commit2 1f[9]
o Change d0[4] commit1 7b[1]
o Change 9a4 initial ba1 original
o Change 000 000
"###
);
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-r", ":@", "-T", &prefix_format(None)]),
@r###"
@ Change 39c commit9 03f
o Change fd commit8 f7
o Change fa9 commit7 e7
o Change 0cff commit6 38
o Change 1b commit5 0cf4
o Change 48 commit4 9e
o Change 19 commit3 06f
o Change 8b12 commit2 1f
o Change d0 commit1 7b
o Change 9a4 initial ba1 original
o Change 000 000
@ Change 39c commit9 03f
o Change fd commit8 f7
o Change fa9 commit7 e7
o Change 0cff commit6 38
o Change 1b commit5 0cf4
o Change 48 commit4 9e
o Change 19 commit3 06f
o Change 8b12 commit2 1f
o Change d0 commit1 7b
o Change 9a4 initial ba1 original
o Change 000 000
"###
);
}
@ -399,8 +401,9 @@ fn test_log_prefix_highlight_styled() {
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-r", "original", "-T", &prefix_format(Some(12))]),
@r###"
@ Change 9a45c67d3e96 initial ba1a30916d29 original
~
@ Change 9a45c67d3e96 initial ba1a30916d29 original
~
"###
);
@ -417,8 +420,9 @@ fn test_log_prefix_highlight_styled() {
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-r", "original", "-T", &prefix_format(Some(12))]),
@r###"
o Change 9a45c67d3e96 initial ba1a30916d29 original
~
o Change 9a45c67d3e96 initial ba1a30916d29 original
~
"###
);
let stdout = test_env.jj_cmd_success(
@ -434,17 +438,17 @@ fn test_log_prefix_highlight_styled() {
);
insta::assert_snapshot!(stdout,
@r###"
@ Change 39c3fb0af576 commit9 03f51310b83e
o Change fdf57e73a939 commit8 f77fb1909080
o Change fa9213bcf78e commit7 e715ad5db646
o Change 0cffa7997ffe commit6 38622e54e2e5
o Change 1b76972398e6 commit5 0cf42f60199c
o Change 48523d946ad2 commit4 9e6015e4e622
o Change 19b790168e73 commit3 06f34d9b1475
o Change 8b12d1f268f8 commit2 1f99a5e19891
o Change d043564ef936 commit1 7b1f7dee65b4
o Change 9a45c67d3e96 initial ba1a30916d29 original
o Change 000000000000 000000000000
@ Change 39c3fb0af576 commit9 03f51310b83e
o Change fdf57e73a939 commit8 f77fb1909080
o Change fa9213bcf78e commit7 e715ad5db646
o Change 0cffa7997ffe commit6 38622e54e2e5
o Change 1b76972398e6 commit5 0cf42f60199c
o Change 48523d946ad2 commit4 9e6015e4e622
o Change 19b790168e73 commit3 06f34d9b1475
o Change 8b12d1f268f8 commit2 1f99a5e19891
o Change d043564ef936 commit1 7b1f7dee65b4
o Change 9a45c67d3e96 initial ba1a30916d29 original
o Change 000000000000 000000000000
"###
);
let stdout = test_env.jj_cmd_success(
@ -460,17 +464,17 @@ fn test_log_prefix_highlight_styled() {
);
insta::assert_snapshot!(stdout,
@r###"
@ Change 39c commit9 03f
o Change fdf commit8 f77
o Change fa9 commit7 e71
o Change 0cff commit6 386
o Change 1b7 commit5 0cf4
o Change 485 commit4 9e6
o Change 19b commit3 06f
o Change 8b12 commit2 1f9
o Change d04 commit1 7b1
o Change 9a4 initial ba1 original
o Change 000 000
@ Change 39c commit9 03f
o Change fdf commit8 f77
o Change fa9 commit7 e71
o Change 0cff commit6 386
o Change 1b7 commit5 0cf4
o Change 485 commit4 9e6
o Change 19b commit3 06f
o Change 8b12 commit2 1f9
o Change d04 commit1 7b1
o Change 9a4 initial ba1 original
o Change 000 000
"###
);
let stdout = test_env.jj_cmd_success(
@ -486,17 +490,17 @@ fn test_log_prefix_highlight_styled() {
);
insta::assert_snapshot!(stdout,
@r###"
@ Change 39c commit9 03f
o Change fd commit8 f7
o Change fa9 commit7 e7
o Change 0cff commit6 38
o Change 1b commit5 0cf4
o Change 48 commit4 9e
o Change 19 commit3 06f
o Change 8b12 commit2 1f
o Change d0 commit1 7b
o Change 9a4 initial ba1 original
o Change 000 000
@ Change 39c commit9 03f
o Change fd commit8 f7
o Change fa9 commit7 e7
o Change 0cff commit6 38
o Change 1b commit5 0cf4
o Change 48 commit4 9e
o Change 19 commit3 06f
o Change 8b12 commit2 1f
o Change d0 commit1 7b
o Change 9a4 initial ba1 original
o Change 000 000
"###
);
}
@ -518,8 +522,8 @@ fn test_log_prefix_highlight_counts_hidden_commits() {
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-r", "all()", "-T", prefix_format]),
@r###"
@ Change 9[a45c67d3e96] initial b[a1a30916d29] original
o Change 0[00000000000] 0[00000000000]
@ Change 9[a45c67d3e96] initial b[a1a30916d29] original
o Change 0[00000000000] 0[00000000000]
"###
);
@ -534,10 +538,10 @@ fn test_log_prefix_highlight_counts_hidden_commits() {
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-T", prefix_format]),
@r###"
@ Change 39c3[fb0af576] 44[4c3c5066d3]
| o Change 9a[45c67d3e96] initial ba[1a30916d29] original
|/
o Change 00[0000000000] 00[0000000000]
@ Change 39c3[fb0af576] 44[4c3c5066d3]
o Change 9a[45c67d3e96] initial ba[1a30916d29] original
o Change 00[0000000000] 00[0000000000]
"###
);
insta::assert_snapshot!(
@ -549,8 +553,9 @@ fn test_log_prefix_highlight_counts_hidden_commits() {
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-r", "d0", "-T", prefix_format]),
@r###"
o Change a70[78fc7d293] extra d0[947f34cec4]
~
o Change a70[78fc7d293] extra d0[947f34cec4]
~
"###
);
}
@ -563,13 +568,13 @@ fn test_log_shortest_length_parameter() {
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id.shortest(0)"]), @r###"
@ 2
o 0
@ 2
o 0
"###);
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id.shortest(100)"]), @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
"###);
}
@ -582,9 +587,10 @@ fn test_log_author_format_in_default_template() {
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["log", "--revisions=@"]),
@r###"
@ 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
~ (empty) (no description set)
"###
@ 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
(empty) (no description set)
~
"###
);
insta::assert_snapshot!(
test_env.jj_cmd_success(
@ -596,9 +602,10 @@ fn test_log_author_format_in_default_template() {
],
),
@r###"
@ 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
~ (empty) (no description set)
"###
@ 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
(empty) (no description set)
~
"###
);
insta::assert_snapshot!(
test_env.jj_cmd_success(
@ -610,9 +617,10 @@ fn test_log_author_format_in_default_template() {
],
),
@r###"
@ 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
~ (empty) (no description set)
"###
@ 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
(empty) (no description set)
~
"###
);
insta::assert_snapshot!(
test_env.jj_cmd_success(
@ -624,9 +632,10 @@ fn test_log_author_format_in_default_template() {
],
),
@r###"
@ 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
~ (empty) (no description set)
"###
@ 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
(empty) (no description set)
~
"###
);
insta::assert_snapshot!(
test_env.jj_cmd_success(
@ -638,9 +647,10 @@ fn test_log_author_format_in_default_template() {
],
),
@r###"
@ 9a45c67d3e96 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
~ (empty) (no description set)
"###
@ 9a45c67d3e96 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
(empty) (no description set)
~
"###
);
insta::assert_snapshot!(
test_env.jj_cmd_success(
@ -652,9 +662,10 @@ fn test_log_author_format_in_default_template() {
],
),
@r###"
@ 9a45c67d3e96 Test User 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
~ (empty) (no description set)
"###
@ 9a45c67d3e96 Test User 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
(empty) (no description set)
~
"###
);
insta::assert_snapshot!(
test_env.jj_cmd_success(
@ -666,9 +677,10 @@ fn test_log_author_format_in_default_template() {
],
),
@r###"
@ 9a45c67d3e96 test.user 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
~ (empty) (no description set)
"###
@ 9a45c67d3e96 test.user 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
(empty) (no description set)
~
"###
);
}
@ -690,8 +702,8 @@ fn test_log_divergence() {
);
// No divergence
insta::assert_snapshot!(stdout, @r###"
@ description 1
o
@ description 1
o
"###);
// Create divergence
@ -709,10 +721,10 @@ fn test_log_divergence() {
);
insta::assert_snapshot!(stdout, @r###"
Concurrent modification detected, resolving automatically.
o description 2 !divergence!
| @ description 1 !divergence!
|/
o
o description 2 !divergence!
@ description 1 !divergence!
o
"###);
}
@ -727,9 +739,9 @@ fn test_log_reversed() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "--reversed"]);
insta::assert_snapshot!(stdout, @r###"
o
o first
@ second
o
o first
@ second
"###);
let stdout = test_env.jj_cmd_success(
@ -756,23 +768,26 @@ fn test_log_filtered_by_path() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "file1"]);
insta::assert_snapshot!(stdout, @r###"
@ second
o first
~
@ second
o first
~
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "file2"]);
insta::assert_snapshot!(stdout, @r###"
@ second
~
@ second
~
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "-s", "file1"]);
insta::assert_snapshot!(stdout, @r###"
@ second
| M file1
o first
~ A file1
@ second
M file1
o first
A file1
~
"###);
let stdout = test_env.jj_cmd_success(
@ -817,8 +832,9 @@ fn test_log_warn_path_might_be_revset() {
.assert()
.success();
insta::assert_snapshot!(get_stdout_string(&assert), @r###"
@
~
@
~
"###);
insta::assert_snapshot!(get_stderr_string(&assert), @"");
@ -828,8 +844,9 @@ fn test_log_warn_path_might_be_revset() {
.assert()
.success();
insta::assert_snapshot!(get_stdout_string(&assert), @r###"
@
~
@
~
"###);
insta::assert_snapshot!(get_stderr_string(&assert), @r###"warning: The argument "." is being interpreted as a path, but this is often not useful because all non-empty commits touch '.'. If you meant to show the working copy commit, pass -r '@' instead."###);
@ -944,19 +961,19 @@ fn test_graph_template_color() {
let template = r#"label(if(current_working_copy, "working_copy"), description)"#;
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
insta::assert_snapshot!(stdout, @r###"
@ single line
o first line
| second line
| third line
o
@ single line
o first line
second line
third line
o
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["--color=always", "log", "-T", template]);
insta::assert_snapshot!(stdout, @r###"
@ single line
o first line
| second line
| third line
o
@ single line
o first line
second line
third line
o
"###);
}
@ -982,17 +999,17 @@ fn test_graph_styles() {
// Default (legacy) style
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T=description"]);
insta::assert_snapshot!(stdout, @r###"
@ merge
|\
o | side branch
| | with
| | long
| | description
o | main branch 2
|/
o main branch 1
o initial
o
@ merge
o side branch
with
long
description
o main branch 2
o main branch 1
o initial
o
"###);
// ASCII style

View file

@ -57,14 +57,14 @@ fn test_move() {
std::fs::write(repo_path.join("file2"), "f\n").unwrap();
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 0d7353584003 f
o e9515f21068c e
o bdd835cae844 d
| o caa4d0b23201 c
| o 55171e33db26 b
|/
o 3db0a2f5b535 a
o 000000000000
@ 0d7353584003 f
o e9515f21068c e
o bdd835cae844 d
o caa4d0b23201 c
o 55171e33db26 b
o 3db0a2f5b535 a
o 000000000000
"###);
// Errors out without arguments
@ -90,13 +90,13 @@ fn test_move() {
Added 0 files, modified 1 files, removed 0 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 1c03e3d3c63f f
o e9515f21068c e
o bdd835cae844 d
| o 55171e33db26 b c
|/
o 3db0a2f5b535 a
o 000000000000
@ 1c03e3d3c63f f
o e9515f21068c e
o bdd835cae844 d
o 55171e33db26 b c
o 3db0a2f5b535 a
o 000000000000
"###);
// The change from the source has been applied
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
@ -118,13 +118,13 @@ fn test_move() {
// The change has been removed from the source (the change pointed to by 'd'
// became empty and was abandoned)
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ c8d83075e8c2 f
o 2c50bfc59c68 e
| o caa4d0b23201 c
| o 55171e33db26 b
|/
o 3db0a2f5b535 a d
o 000000000000
@ c8d83075e8c2 f
o 2c50bfc59c68 e
o caa4d0b23201 c
o 55171e33db26 b
o 3db0a2f5b535 a d
o 000000000000
"###);
// 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)
@ -143,13 +143,13 @@ fn test_move() {
// The change has been removed from the source (the change pointed to by 'e'
// became empty and was abandoned)
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 2b723b1d6033 f
o 4293930d6333 d e
| o caa4d0b23201 c
| o 55171e33db26 b
|/
o 3db0a2f5b535 a
o 000000000000
@ 2b723b1d6033 f
o 4293930d6333 d e
o caa4d0b23201 c
o 55171e33db26 b
o 3db0a2f5b535 a
o 000000000000
"###);
// The change from the source has been applied
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file2", "-r", "d"]);
@ -187,12 +187,12 @@ fn test_move_partial() {
std::fs::write(repo_path.join("file3"), "d\n").unwrap();
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ bdd835cae844 d
| o 5028db694b6b c
| o 55171e33db26 b
|/
o 3db0a2f5b535 a
o 000000000000
@ bdd835cae844 d
o 5028db694b6b c
o 55171e33db26 b
o 3db0a2f5b535 a
o 000000000000
"###);
let edit_script = test_env.set_up_fake_diff_editor();
@ -204,11 +204,11 @@ fn test_move_partial() {
Added 0 files, modified 2 files, removed 0 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 71b69e433fbc d
| o 55171e33db26 b c
|/
o 3db0a2f5b535 a
o 000000000000
@ 71b69e433fbc d
o 55171e33db26 b c
o 3db0a2f5b535 a
o 000000000000
"###);
// The changes from the source has been applied
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
@ -234,12 +234,12 @@ fn test_move_partial() {
Added 0 files, modified 1 files, removed 0 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 63f1a6e96edb d
| o d027c6e3e6bc c
| o 55171e33db26 b
|/
o 3db0a2f5b535 a
o 000000000000
@ 63f1a6e96edb d
o d027c6e3e6bc c
o 55171e33db26 b
o 3db0a2f5b535 a
o 000000000000
"###);
// The selected change from the source has been applied
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
@ -267,12 +267,12 @@ fn test_move_partial() {
Added 0 files, modified 1 files, removed 0 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 17c2e6632cc5 d
| o 6a3ae047a03e c
| o 55171e33db26 b
|/
o 3db0a2f5b535 a
o 000000000000
@ 17c2e6632cc5 d
o 6a3ae047a03e c
o 55171e33db26 b
o 3db0a2f5b535 a
o 000000000000
"###);
// The selected change from the source has been applied
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
@ -300,12 +300,12 @@ fn test_move_partial() {
Rebased 1 descendant commits
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o 21253406d416 c
o e1cf08aae711 b
| @ bdd835cae844 d
|/
o 3db0a2f5b535 a
o 000000000000
o 21253406d416 c
o e1cf08aae711 b
@ bdd835cae844 d
o 3db0a2f5b535 a
o 000000000000
"###);
// The selected change from the source has been applied
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "b"]);

View file

@ -28,19 +28,19 @@ fn test_new() {
test_env.jj_cmd_success(&repo_path, &["new", "-m", "a new commit"]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 4f2d6e0a3482a6a34e4856a4a63869c0df109e79 a new commit
o 5d5c60b2aa96b8dbf55710656c50285c66cdcd74 add a file
o 0000000000000000000000000000000000000000
@ 4f2d6e0a3482a6a34e4856a4a63869c0df109e79 a new commit
o 5d5c60b2aa96b8dbf55710656c50285c66cdcd74 add a file
o 0000000000000000000000000000000000000000
"###);
// 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"]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 026537ddb96b801b9cb909985d5443aab44616c1 off of root
| o 4f2d6e0a3482a6a34e4856a4a63869c0df109e79 a new commit
| o 5d5c60b2aa96b8dbf55710656c50285c66cdcd74 add a file
|/
o 0000000000000000000000000000000000000000
@ 026537ddb96b801b9cb909985d5443aab44616c1 off of root
o 4f2d6e0a3482a6a34e4856a4a63869c0df109e79 a new commit
o 5d5c60b2aa96b8dbf55710656c50285c66cdcd74 add a file
o 0000000000000000000000000000000000000000
"###);
}
@ -59,12 +59,12 @@ fn test_new_merge() {
// Create a merge commit
test_env.jj_cmd_success(&repo_path, &["new", "main", "@"]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 0c4e5b9b68ae0cbe7ce3c61042619513d09005bf
|\
o | f399209d9dda06e8a25a0c8e9a0cde9f421ff35d add file2
| o 38e8e2f6c92ffb954961fc391b515ff551b41636 add file1
|/
o 0000000000000000000000000000000000000000
@ 0c4e5b9b68ae0cbe7ce3c61042619513d09005bf
o f399209d9dda06e8a25a0c8e9a0cde9f421ff35d add file2
o 38e8e2f6c92ffb954961fc391b515ff551b41636 add file1
o 0000000000000000000000000000000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
insta::assert_snapshot!(stdout, @"a");
@ -75,12 +75,12 @@ fn test_new_merge() {
test_env.jj_cmd_success(&repo_path, &["undo"]);
test_env.jj_cmd_success(&repo_path, &["merge", "main", "@"]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 200ed1a14c8acf09783dafefe5bebf2ff58f12fd
|\
o | f399209d9dda06e8a25a0c8e9a0cde9f421ff35d add file2
| o 38e8e2f6c92ffb954961fc391b515ff551b41636 add file1
|/
o 0000000000000000000000000000000000000000
@ 200ed1a14c8acf09783dafefe5bebf2ff58f12fd
o f399209d9dda06e8a25a0c8e9a0cde9f421ff35d add file2
o 38e8e2f6c92ffb954961fc391b515ff551b41636 add file1
o 0000000000000000000000000000000000000000
"###);
// `jj merge` with less than two arguments is an error
@ -113,16 +113,16 @@ fn test_new_insert_after() {
let repo_path = test_env.env_root().join("repo");
setup_before_insertion(&test_env, &repo_path);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ F
|\
o | E
| o D
|/
| o C
| o B
| o A
|/
o root
@ F
o E
o D
o C
o B
o A
o root
"###);
let stdout =
@ -132,20 +132,18 @@ fn test_new_insert_after() {
Working copy now at: ca7c6481a8dd G
"###);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
o C
| o F
| |\
|/ /
@ | G
|\ \
| | o E
o | | D
| |/
|/|
| o B
| o A
|/
o root
o C
o F
@ G
o E
o D
o B
o A
o root
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["new", "--insert-after", "-m", "H", "D"]);
@ -154,21 +152,19 @@ fn test_new_insert_after() {
Working copy now at: fcf8281b4135 H
"###);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
o C
| o F
| |\
|/ /
o | G
|\ \
@ | | H
| | o E
o | | D
| |/
|/|
| o B
| o A
|/
o root
o C
o F
o G
@ H
o E
o D
o B
o A
o root
"###);
}
@ -179,16 +175,16 @@ fn test_new_insert_after_children() {
let repo_path = test_env.env_root().join("repo");
setup_before_insertion(&test_env, &repo_path);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ F
|\
o | E
| o D
|/
| o C
| o B
| o A
|/
o root
@ F
o E
o D
o C
o B
o A
o root
"###);
// Check that inserting G after A and C doesn't try to rebase B (which is
@ -200,19 +196,19 @@ fn test_new_insert_after_children() {
Working copy now at: b48d4d73a39c G
"###);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ G
|\
| | o F
| | |\
| | o | E
| | | o D
| | |/
o | | C
o | | B
|/ /
o | A
|/
o root
@ G
o F
o E
o D
o C
o B
o A
o root
"###);
}
@ -223,16 +219,16 @@ fn test_new_insert_before() {
let repo_path = test_env.env_root().join("repo");
setup_before_insertion(&test_env, &repo_path);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ F
|\
o | E
| o D
|/
| o C
| o B
| o A
|/
o root
@ F
o E
o D
o C
o B
o A
o root
"###);
let stdout =
@ -242,18 +238,18 @@ fn test_new_insert_before() {
Working copy now at: ff6bbbc7b8df G
"###);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
o F
| o C
|/
@-. G
|\ \
o | | E
| o | D
|/ /
| o B
| o A
|/
o root
o F
o C
@ G
o E
o D
o B
o A
o root
"###);
}
@ -264,16 +260,16 @@ fn test_new_insert_before_root_successors() {
let repo_path = test_env.env_root().join("repo");
setup_before_insertion(&test_env, &repo_path);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ F
|\
o | E
| o D
|/
| o C
| o B
| o A
|/
o root
@ F
o E
o D
o C
o B
o A
o root
"###);
let stdout =
@ -283,18 +279,17 @@ fn test_new_insert_before_root_successors() {
Working copy now at: 3654197754f8 G
"###);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
o F
|\
| | o C
| | o B
o | | D
| | o A
| |/
|/|
@ | G
| o E
|/
o root
o F
o C
o B
o D
o A
@ G
o E
o root
"###);
}
@ -313,16 +308,16 @@ fn test_new_insert_before_no_loop() {
],
);
insta::assert_snapshot!(stdout, @r###"
@ 7705d353bf5d F
|\
o | 41a89ffcbba2 E
| o c9257eff5bf9 D
|/
| o ec18c57d72d8 C
| o 6041917ceeb5 B
| o 65b1ef43c737 A
|/
o 000000000000 root
@ 7705d353bf5d F
o 41a89ffcbba2 E
o c9257eff5bf9 D
o ec18c57d72d8 C
o 6041917ceeb5 B
o 65b1ef43c737 A
o 000000000000 root
"###);
let stderr =
@ -339,16 +334,16 @@ fn test_new_insert_before_no_root_merge() {
let repo_path = test_env.env_root().join("repo");
setup_before_insertion(&test_env, &repo_path);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ F
|\
o | E
| o D
|/
| o C
| o B
| o A
|/
o root
@ F
o E
o D
o C
o B
o A
o root
"###);
let stdout =
@ -358,18 +353,17 @@ fn test_new_insert_before_no_root_merge() {
Working copy now at: bf9fc49331de G
"###);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
o F
|\
| | o C
o | | D
| | o B
| |/
|/|
@ | G
| o E
o | A
|/
o root
o F
o C
o D
o B
@ G
o E
o A
o root
"###);
}
@ -380,16 +374,16 @@ fn test_new_insert_before_root() {
let repo_path = test_env.env_root().join("repo");
setup_before_insertion(&test_env, &repo_path);
insta::assert_snapshot!(get_short_log_output(&test_env, &repo_path), @r###"
@ F
|\
o | E
| o D
|/
| o C
| o B
| o A
|/
o root
@ F
o E
o D
o C
o B
o A
o root
"###);
let stderr =

View file

@ -30,38 +30,38 @@ fn test_obslog_with_or_without_diff() {
let stdout = test_env.jj_cmd_success(&repo_path, &["obslog"]);
insta::assert_snapshot!(stdout, @r###"
@ 8e4fac809cbb test.user@example.com 2001-02-03 04:05:10.000 +07:00 66b42ad36073
| my description
o 8e4fac809cbb test.user@example.com 2001-02-03 04:05:09.000 +07:00 af536e5af67e conflict
| my description
o 8e4fac809cbb test.user@example.com 2001-02-03 04:05:09.000 +07:00 6fbba7bcb590
| my description
o 8e4fac809cbb test.user@example.com 2001-02-03 04:05:08.000 +07:00 eac0d0dae082
(empty) my description
@ 8e4fac809cbb test.user@example.com 2001-02-03 04:05:10.000 +07:00 66b42ad36073
my description
o 8e4fac809cbb test.user@example.com 2001-02-03 04:05:09.000 +07:00 af536e5af67e conflict
my description
o 8e4fac809cbb test.user@example.com 2001-02-03 04:05:09.000 +07:00 6fbba7bcb590
my description
o 8e4fac809cbb test.user@example.com 2001-02-03 04:05:08.000 +07:00 eac0d0dae082
(empty) my description
"###);
// There should be no diff caused by the rebase because it was a pure rebase
// (even even though it resulted in a conflict).
let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "-p"]);
insta::assert_snapshot!(stdout, @r###"
@ 8e4fac809cbb test.user@example.com 2001-02-03 04:05:10.000 +07:00 66b42ad36073
| my description
| Resolved conflict in file1:
| 1 1: <<<<<<<resolved
| 2 : %%%%%%%
| 3 : +bar
| 4 : >>>>>>>
o 8e4fac809cbb test.user@example.com 2001-02-03 04:05:09.000 +07:00 af536e5af67e conflict
| my description
o 8e4fac809cbb test.user@example.com 2001-02-03 04:05:09.000 +07:00 6fbba7bcb590
| my description
| Modified regular file file1:
| 1 1: foo
| 2: bar
| Added regular file file2:
| 1: foo
o 8e4fac809cbb test.user@example.com 2001-02-03 04:05:08.000 +07:00 eac0d0dae082
(empty) my description
@ 8e4fac809cbb test.user@example.com 2001-02-03 04:05:10.000 +07:00 66b42ad36073
my description
Resolved conflict in file1:
1 1: <<<<<<<resolved
2 : %%%%%%%
3 : +bar
4 : >>>>>>>
o 8e4fac809cbb test.user@example.com 2001-02-03 04:05:09.000 +07:00 af536e5af67e conflict
my description
o 8e4fac809cbb test.user@example.com 2001-02-03 04:05:09.000 +07:00 6fbba7bcb590
my description
Modified regular file file1:
1 1: foo
2: bar
Added regular file file2:
1: foo
o 8e4fac809cbb test.user@example.com 2001-02-03 04:05:08.000 +07:00 eac0d0dae082
(empty) my description
"###);
// Test `--no-graph`
@ -132,25 +132,25 @@ fn test_obslog_squash() {
let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "-p", "-r", "@-"]);
insta::assert_snapshot!(stdout, @r###"
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:10.000 +07:00 27e721a5ba72
|\ squashed
| | Modified regular file file1:
| | 1 1: foo
| | 2: bar
o | 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:09.000 +07:00 9764e503e1a9
| | first
| | Added regular file file1:
| | 1: foo
o | 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 69542c1984c1
| | (empty) first
o | 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
/ (empty) (no description set)
o ffdaa62087a2 test.user@example.com 2001-02-03 04:05:10.000 +07:00 f09a38899f2b
| second
| Modified regular file file1:
| 1 1: foo
| 2: bar
o ffdaa62087a2 test.user@example.com 2001-02-03 04:05:09.000 +07:00 579965369703
(empty) second
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:10.000 +07:00 27e721a5ba72
squashed
Modified regular file file1:
1 1: foo
2: bar
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:09.000 +07:00 9764e503e1a9
first
Added regular file file1:
1: foo
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:08.000 +07:00 69542c1984c1
(empty) first
o 9a45c67d3e96 test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059e1b0
(empty) (no description set)
o ffdaa62087a2 test.user@example.com 2001-02-03 04:05:10.000 +07:00 f09a38899f2b
second
Modified regular file file1:
1 1: foo
2: bar
o ffdaa62087a2 test.user@example.com 2001-02-03 04:05:09.000 +07:00 579965369703
(empty) second
"###);
}

View file

@ -29,13 +29,13 @@ fn test_op_log() {
let stdout = test_env.jj_cmd_success(&repo_path, &["op", "log"]);
insta::assert_snapshot!(&stdout, @r###"
@ 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
| 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
| 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
initialize repo
@ 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
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
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
initialize repo
"###);
// Test op log with relative dates
let stdout = test_env.jj_cmd_success(
@ -44,37 +44,37 @@ fn test_op_log() {
);
let regex = Regex::new(r"\d\d years").unwrap();
insta::assert_snapshot!(regex.replace_all(&stdout, "NN years"), @r###"
@ 45108169c0f8 test-username@host.example.com NN years ago, lasted less than a microsecond
| describe commit 230dd059e1b059aefc0da06a2e5a7dbf22362f22
| args: jj describe -m 'description 0'
o a99a3fd5c51e test-username@host.example.com NN years ago, lasted less than a microsecond
| add workspace 'default'
o 56b94dfc38e7 test-username@host.example.com NN years ago, lasted less than a microsecond
initialize repo
@ 45108169c0f8 test-username@host.example.com NN years ago, lasted less than a microsecond
describe commit 230dd059e1b059aefc0da06a2e5a7dbf22362f22
args: jj describe -m 'description 0'
o a99a3fd5c51e test-username@host.example.com NN years ago, lasted less than a microsecond
add workspace 'default'
o 56b94dfc38e7 test-username@host.example.com NN years ago, lasted less than a microsecond
initialize repo
"###);
let add_workspace_id = "a99a3fd5c51e";
let initialize_repo_id = "56b94dfc38e7";
// Can load the repo at a specific operation ID
insta::assert_snapshot!(get_log_output(&test_env, &repo_path, initialize_repo_id), @r###"
o 0000000000000000000000000000000000000000
o 0000000000000000000000000000000000000000
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path, add_workspace_id), @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
"###);
// "@" resolves to the head operation
insta::assert_snapshot!(get_log_output(&test_env, &repo_path, "@"), @r###"
@ bc8f18aa6f396a93572811632313cbb5625d475d
o 0000000000000000000000000000000000000000
@ bc8f18aa6f396a93572811632313cbb5625d475d
o 0000000000000000000000000000000000000000
"###);
// "@-" resolves to the parent of the head operation
insta::assert_snapshot!(get_log_output(&test_env, &repo_path, "@-"), @r###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
o 0000000000000000000000000000000000000000
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path, "@--"), @r###"
o 0000000000000000000000000000000000000000
o 0000000000000000000000000000000000000000
"###);
insta::assert_snapshot!(
test_env.jj_cmd_failure(&repo_path, &["log", "--at-op", "@---"]), @r###"
@ -83,7 +83,7 @@ fn test_op_log() {
// "ID-" also resolves to the parent.
insta::assert_snapshot!(
get_log_output(&test_env, &repo_path, &format!("{add_workspace_id}-")), @r###"
o 0000000000000000000000000000000000000000
o 0000000000000000000000000000000000000000
"###);
// We get a reasonable message if an invalid operation ID is specified

View file

@ -98,14 +98,14 @@ fn test_rebase_branch() {
create_commit(&test_env, &repo_path, "e", &["a"]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e
| o d
| | o c
| |/
| o b
|/
o a
o
@ e
o d
o c
o b
o a
o
"###);
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
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o d
| o c
|/
o b
@ e
o a
o
o d
o c
o b
@ e
o a
o
"###);
}
@ -136,15 +136,15 @@ fn test_rebase_branch_with_merge() {
create_commit(&test_env, &repo_path, "e", &["a", "d"]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e
|\
o | d
o | c
| | o b
| |/
| o a
|/
o
@ e
o d
o c
o b
o a
o
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-b", "d", "-d", "b"]);
@ -154,12 +154,12 @@ fn test_rebase_branch_with_merge() {
Added 1 files, modified 0 files, removed 0 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e
o d
o c
o b
o a
o
@ e
o d
o c
o b
o a
o
"###);
test_env.jj_cmd_success(&repo_path, &["undo"]);
@ -170,12 +170,12 @@ fn test_rebase_branch_with_merge() {
Added 1 files, modified 0 files, removed 0 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e
o d
o c
o b
o a
o
@ e
o d
o c
o b
o a
o
"###);
}
@ -191,13 +191,13 @@ fn test_rebase_single_revision() {
create_commit(&test_env, &repo_path, "d", &["c"]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d
o c
|\
o | b
| o a
|/
o
@ d
o c
o b
o a
o
"###);
// Descendants of the rebased commit "b" should be rebased onto parents. First
@ -213,12 +213,12 @@ fn test_rebase_single_revision() {
Added 0 files, modified 0 files, removed 1 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d
o c
| o b
|/
o a
o
@ d
o c
o b
o a
o
"###);
test_env.jj_cmd_success(&repo_path, &["undo"]);
@ -231,15 +231,14 @@ fn test_rebase_single_revision() {
Added 0 files, modified 0 files, removed 1 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d
|\
| | o c
o | | b
| |/
|/|
| o a
|/
o
@ d
o c
o b
o a
o
"###);
}
@ -255,13 +254,13 @@ fn test_rebase_single_revision_merge_parent() {
create_commit(&test_env, &repo_path, "d", &["a", "c"]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d
|\
o | c
o | b
| o a
|/
o
@ d
o c
o b
o a
o
"###);
// Descendants of the rebased commit should be rebased onto parents, and if
@ -273,14 +272,14 @@ fn test_rebase_single_revision_merge_parent() {
Added 0 files, modified 0 files, removed 1 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d
|\
| | o c
| |/
o | b
| o a
|/
o
@ d
o c
o b
o a
o
"###);
}
@ -295,23 +294,23 @@ fn test_rebase_multiple_destinations() {
create_commit(&test_env, &repo_path, "c", &[]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ c
| o b
|/
| o a
|/
o
@ c
o b
o a
o
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-r", "a", "-d", "b", "-d", "c"]);
insta::assert_snapshot!(stdout, @r###""###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o a
|\
@ | c
| o b
|/
o
o a
@ c
o b
o
"###);
let stderr = test_env.jj_cmd_failure(&repo_path, &["rebase", "-r", "a", "-d", "b|c"]);
@ -328,12 +327,12 @@ fn test_rebase_multiple_destinations() {
);
insta::assert_snapshot!(stdout, @r###""###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o a
|\
@ | c
| o b
|/
o
o a
@ c
o b
o
"###);
let stderr = test_env.jj_cmd_failure(&repo_path, &["rebase", "-r", "a", "-d", "b", "-d", "b"]);
@ -358,11 +357,11 @@ fn test_rebase_multiple_destinations() {
);
insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o a
| @ c
o | b
|/
o
o a
@ c
o b
o
"###);
let stdout = test_env.jj_cmd_success(
&repo_path,
@ -379,12 +378,12 @@ fn test_rebase_multiple_destinations() {
);
insta::assert_snapshot!(stdout, @"");
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
o a
|\
@ | c
| o b
|/
o
o a
@ c
o b
o
"###);
let stderr =
@ -406,13 +405,13 @@ fn test_rebase_with_descendants() {
create_commit(&test_env, &repo_path, "d", &["c"]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d
o c
|\
o | b
| o a
|/
o
@ d
o c
o b
o a
o
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-s", "b", "-d", "a"]);
@ -421,11 +420,11 @@ fn test_rebase_with_descendants() {
Working copy now at: 309336ffce22 d
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d
o c
o b
o a
o
@ d
o c
o b
o a
o
"###);
}

View file

@ -54,14 +54,14 @@ fn test_resolution() {
create_commit(&test_env, &repo_path, "conflict", &["a", "b"], &[]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict
|\
o | b
| o a
|/
o base
o
"###);
@ conflict
o b
o a
o base
o
"###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]),
@r###"
file 2-sided conflict
@ -299,14 +299,14 @@ fn test_normal_conflict_input_files() {
create_commit(&test_env, &repo_path, "conflict", &["a", "b"], &[]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict
|\
o | b
| o a
|/
o base
o
"###);
@ conflict
o b
o a
o base
o
"###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]),
@r###"
file 2-sided conflict
@ -340,14 +340,14 @@ fn test_baseless_conflict_input_files() {
create_commit(&test_env, &repo_path, "conflict", &["a", "b"], &[]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict
|\
o | b
| o a
|/
o base
o
"###);
@ conflict
o b
o a
o base
o
"###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]),
@r###"
file 2-sided conflict
@ -409,14 +409,14 @@ fn test_edit_delete_conflict_input_files() {
create_commit(&test_env, &repo_path, "conflict", &["a", "b"], &[]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict
|\
o | b
| o a
|/
o base
o
"###);
@ conflict
o b
o a
o base
o
"###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]),
@r###"
file 2-sided conflict including 1 deletion
@ -453,14 +453,14 @@ fn test_file_vs_dir() {
std::fs::write(repo_path.join("file").join("placeholder"), "").unwrap();
create_commit(&test_env, &repo_path, "conflict", &["a", "b"], &[]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict
|\
o | b
| o a
|/
o base
o
"###);
@ conflict
o b
o a
o base
o
"###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]),
@r###"
@ -500,15 +500,15 @@ fn test_description_with_dir_and_deletion() {
&[],
);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@-. conflict
|\ \
o | | del
| o | dir
|/ /
| o edit
|/
o base
o
@ conflict
o del
o dir
o edit
o base
o
"###);
insta::assert_snapshot!(test_env.jj_cmd_success(&repo_path, &["resolve", "--list"]),
@ -580,14 +580,14 @@ fn test_multiple_conflicts() {
create_commit(&test_env, &repo_path, "conflict", &["a", "b"], &[]);
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ conflict
|\
o | b
| o a
|/
o base
o
"###);
@ conflict
o b
o a
o base
o
"###);
insta::assert_snapshot!(
std::fs::read_to_string(repo_path.join("this_file_has_a_very_long_name_to_test_padding")).unwrap()
, @r###"

View file

@ -205,14 +205,14 @@ fn test_alias() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "my-root"]);
insta::assert_snapshot!(stdout, @r###"
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "identity(my-root)"]);
insta::assert_snapshot!(stdout, @r###"
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
"###);
let stderr = test_env.jj_cmd_failure(&repo_path, &["log", "-r", "root & syntax-error"]);
@ -307,8 +307,8 @@ fn test_bad_alias_decl() {
.assert()
.success();
insta::assert_snapshot!(get_stdout_string(&assert), @r###"
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
o 000000000000 1970-01-01 00:00:00.000 +00:00 000000000000
(empty) (no description set)
"###);
insta::assert_snapshot!(get_stderr_string(&assert), @r###"
Failed to load "revset-aliases."bad"": --> 1:1

View file

@ -28,8 +28,8 @@ fn test_split_by_paths() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "change_id.short()"]);
insta::assert_snapshot!(stdout, @r###"
@ 9a45c67d3e96
o 000000000000
@ 9a45c67d3e96
o 000000000000
"###);
let edit_script = test_env.set_up_fake_editor();
@ -66,9 +66,9 @@ fn test_split_by_paths() {
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "change_id.short()"]);
insta::assert_snapshot!(stdout, @r###"
@ ffdaa62087a2
o 9a45c67d3e96
o 000000000000
@ ffdaa62087a2
o 9a45c67d3e96
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s", "-r", "@-"]);
@ -94,10 +94,10 @@ fn test_split_by_paths() {
let stdout =
test_env.jj_cmd_success(&repo_path, &["log", "-T", r#"change_id.short() " " empty"#]);
insta::assert_snapshot!(stdout, @r###"
@ ffdaa62087a2 false
o 19b790168e73 true
o 9a45c67d3e96 false
o 000000000000 true
@ ffdaa62087a2 false
o 19b790168e73 true
o 9a45c67d3e96 false
o 000000000000 true
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s", "-r", "@--"]);
@ -127,10 +127,10 @@ fn test_split_by_paths() {
let stdout =
test_env.jj_cmd_success(&repo_path, &["log", "-T", r#"change_id.short() " " empty"#]);
insta::assert_snapshot!(stdout, @r###"
@ ffdaa62087a2 false
o fa9213bcf78e false
o 9a45c67d3e96 true
o 000000000000 true
@ ffdaa62087a2 false
o fa9213bcf78e false
o 9a45c67d3e96 true
o 000000000000 true
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s", "-r", "@-"]);

View file

@ -34,10 +34,10 @@ fn test_squash() {
std::fs::write(repo_path.join("file1"), "c\n").unwrap();
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 90fe0a96fc90 c
o fa5efbdf533c b
o 90aeefd03044 a
o 000000000000
@ 90fe0a96fc90 c
o fa5efbdf533c b
o 90aeefd03044 a
o 000000000000
"###);
// Squashes the working copy into the parent by default
@ -46,10 +46,10 @@ fn test_squash() {
Working copy now at: b9280a9898cb (no description set)
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ b9280a9898cb
o 6ca29c9d2e7c b c
o 90aeefd03044 a
o 000000000000
@ b9280a9898cb
o 6ca29c9d2e7c b c
o 90aeefd03044 a
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
insta::assert_snapshot!(stdout, @r###"
@ -64,9 +64,9 @@ fn test_squash() {
Working copy now at: e87cf8ebc7e1 (no description set)
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e87cf8ebc7e1 c
o 893c93ae2a87 a b
o 000000000000
@ e87cf8ebc7e1 c
o 893c93ae2a87 a b
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "b"]);
insta::assert_snapshot!(stdout, @r###"
@ -87,14 +87,14 @@ fn test_squash() {
test_env.jj_cmd_success(&repo_path, &["new", "c", "d"]);
test_env.jj_cmd_success(&repo_path, &["branch", "create", "e"]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ c7a11b36d333 e
|\
o | 5658521e0f8b d
| o 90fe0a96fc90 c
|/
o fa5efbdf533c b
o 90aeefd03044 a
o 000000000000
@ c7a11b36d333 e
o 5658521e0f8b d
o 90fe0a96fc90 c
o fa5efbdf533c b
o 90aeefd03044 a
o 000000000000
"###);
let stderr = test_env.jj_cmd_failure(&repo_path, &["squash"]);
insta::assert_snapshot!(stderr, @r###"
@ -109,15 +109,15 @@ fn test_squash() {
Working copy now at: 959145c11426 (no description set)
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 959145c11426
o 80960125bb96 e
|\
o | 5658521e0f8b d
| o 90fe0a96fc90 c
|/
o fa5efbdf533c b
o 90aeefd03044 a
o 000000000000
@ 959145c11426
o 80960125bb96 e
o 5658521e0f8b d
o 90fe0a96fc90 c
o fa5efbdf533c b
o 90aeefd03044 a
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "e"]);
insta::assert_snapshot!(stdout, @r###"
@ -144,10 +144,10 @@ fn test_squash_partial() {
std::fs::write(repo_path.join("file2"), "c\n").unwrap();
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d989314f3df0 c
o 2a2d19a3283f b
o 47a1e795d146 a
o 000000000000
@ d989314f3df0 c
o 2a2d19a3283f b
o 47a1e795d146 a
o 000000000000
"###);
// If we don't make any changes in the diff-editor, the whole change is moved
@ -159,9 +159,9 @@ fn test_squash_partial() {
Working copy now at: f03d5ce4a973 (no description set)
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ f03d5ce4a973 c
o c9f931cd78af a b
o 000000000000
@ f03d5ce4a973 c
o c9f931cd78af a b
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]);
insta::assert_snapshot!(stdout, @r###"
@ -177,10 +177,10 @@ fn test_squash_partial() {
Working copy now at: e7a40106bee6 (no description set)
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ e7a40106bee6 c
o 05d951646873 b
o 0c5ddc685260 a
o 000000000000
@ e7a40106bee6 c
o 05d951646873 b
o 0c5ddc685260 a
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]);
insta::assert_snapshot!(stdout, @r###"
@ -209,10 +209,10 @@ fn test_squash_partial() {
Working copy now at: a911fa1d0627 (no description set)
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ a911fa1d0627 c
o fb73ad17899f b
o 70621f4c7a42 a
o 000000000000
@ a911fa1d0627 c
o fb73ad17899f b
o 70621f4c7a42 a
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]);
insta::assert_snapshot!(stdout, @r###"

View file

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

View file

@ -27,13 +27,13 @@ fn test_undo_rewrite_with_child() {
test_env.jj_cmd_success(&repo_path, &["describe", "-m", "initial"]);
test_env.jj_cmd_success(&repo_path, &["describe", "-m", "modified"]);
let stdout = test_env.jj_cmd_success(&repo_path, &["op", "log"]);
let op_id_hex = stdout[2..14].to_string();
let op_id_hex = stdout[3..15].to_string();
test_env.jj_cmd_success(&repo_path, &["new", "-m", "child"]);
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description"]);
insta::assert_snapshot!(stdout, @r###"
@ child
o modified
o
@ child
o modified
o
"###);
test_env.jj_cmd_success(&repo_path, &["undo", &op_id_hex]);
@ -41,8 +41,8 @@ fn test_undo_rewrite_with_child() {
// of the initial commit
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description"]);
insta::assert_snapshot!(stdout, @r###"
@ child
o initial
o
@ child
o initial
o
"###);
}

View file

@ -34,10 +34,10 @@ fn test_unsquash() {
std::fs::write(repo_path.join("file1"), "c\n").unwrap();
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 90fe0a96fc90 c
o fa5efbdf533c b
o 90aeefd03044 a
o 000000000000
@ 90fe0a96fc90 c
o fa5efbdf533c b
o 90aeefd03044 a
o 000000000000
"###);
// Unsquashes into the working copy from its parent by default
@ -46,9 +46,9 @@ fn test_unsquash() {
Working copy now at: 1b10d78f6136 (no description set)
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 1b10d78f6136 c
o 90aeefd03044 a b
o 000000000000
@ 1b10d78f6136 c
o 90aeefd03044 a b
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
insta::assert_snapshot!(stdout, @r###"
@ -63,9 +63,9 @@ fn test_unsquash() {
Working copy now at: 45b8b3ddc25a (no description set)
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 45b8b3ddc25a c
o 9146bcc8d996 b
o 000000000000 a
@ 45b8b3ddc25a c
o 9146bcc8d996 b
o 000000000000 a
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "b"]);
insta::assert_snapshot!(stdout, @r###"
@ -86,14 +86,14 @@ fn test_unsquash() {
test_env.jj_cmd_success(&repo_path, &["new", "-m", "merge", "c", "d"]);
test_env.jj_cmd_success(&repo_path, &["branch", "create", "e"]);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 1f8f152ff48e e
|\
o | 5658521e0f8b d
| o 90fe0a96fc90 c
|/
o fa5efbdf533c b
o 90aeefd03044 a
o 000000000000
@ 1f8f152ff48e e
o 5658521e0f8b d
o 90fe0a96fc90 c
o fa5efbdf533c b
o 90aeefd03044 a
o 000000000000
"###);
let stderr = test_env.jj_cmd_failure(&repo_path, &["unsquash"]);
insta::assert_snapshot!(stderr, @r###"
@ -108,14 +108,14 @@ fn test_unsquash() {
Working copy now at: 3217340cb761 merge
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 3217340cb761
|\
o | 5658521e0f8b d e??
| o 90fe0a96fc90 c e??
|/
o fa5efbdf533c b
o 90aeefd03044 a
o 000000000000
@ 3217340cb761
o 5658521e0f8b d e??
o 90fe0a96fc90 c e??
o fa5efbdf533c b
o 90aeefd03044 a
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1"]);
insta::assert_snapshot!(stdout, @r###"
@ -142,10 +142,10 @@ fn test_unsquash_partial() {
std::fs::write(repo_path.join("file2"), "c\n").unwrap();
// Test the setup
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ d989314f3df0 c
o 2a2d19a3283f b
o 47a1e795d146 a
o 000000000000
@ d989314f3df0 c
o 2a2d19a3283f b
o 47a1e795d146 a
o 000000000000
"###);
// If we don't make any changes in the diff-editor, the whole change is moved
@ -157,10 +157,10 @@ fn test_unsquash_partial() {
Working copy now at: 37c961d0d1e2 (no description set)
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ 37c961d0d1e2 c
o 000af22057b9 b
o ee67504598b6 a
o 000000000000
@ 37c961d0d1e2 c
o 000af22057b9 b
o ee67504598b6 a
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]);
insta::assert_snapshot!(stdout, @r###"
@ -175,10 +175,10 @@ fn test_unsquash_partial() {
Working copy now at: a8e8fded1021 (no description set)
"###);
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
@ a8e8fded1021 c
o 46cc06672a99 b
o 47a1e795d146 a
o 000000000000
@ a8e8fded1021 c
o 46cc06672a99 b
o 47a1e795d146 a
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "b"]);
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 "@"
// node in the graph indicates the current workspace's working-copy commit.
insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###"
o 397eac932ad3c349b2659fd2eb035a4dd3da4193 second@
| @ e0e6d5672858dc9a57ec5b772b7c4f3270ed0223 default@
|/
o 7d308bc9d934c53c6cc52935192e2d6ac5d78cfd
o 0000000000000000000000000000000000000000
o 397eac932ad3c349b2659fd2eb035a4dd3da4193 second@
@ e0e6d5672858dc9a57ec5b772b7c4f3270ed0223 default@
o 7d308bc9d934c53c6cc52935192e2d6ac5d78cfd
o 0000000000000000000000000000000000000000
"###);
insta::assert_snapshot!(get_log_output(&test_env, &secondary_path), @r###"
@ 397eac932ad3c349b2659fd2eb035a4dd3da4193 second@
| o e0e6d5672858dc9a57ec5b772b7c4f3270ed0223 default@
|/
o 7d308bc9d934c53c6cc52935192e2d6ac5d78cfd
o 0000000000000000000000000000000000000000
@ 397eac932ad3c349b2659fd2eb035a4dd3da4193 second@
o e0e6d5672858dc9a57ec5b772b7c4f3270ed0223 default@
o 7d308bc9d934c53c6cc52935192e2d6ac5d78cfd
o 0000000000000000000000000000000000000000
"###);
// 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"]);
insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###"
o 265af0cdbcc7bb33e3734ad72565c943ce3fb0d4 secondary@
| @ 351099fa72cfbb1b34e410e89821efc623295974 default@
|/
o cf911c223d3e24e001fc8264d6dbf0610804fc40
o 0000000000000000000000000000000000000000
o 265af0cdbcc7bb33e3734ad72565c943ce3fb0d4 secondary@
@ 351099fa72cfbb1b34e410e89821efc623295974 default@
o cf911c223d3e24e001fc8264d6dbf0610804fc40
o 0000000000000000000000000000000000000000
"###);
// Make changes in both working copies
@ -104,11 +104,11 @@ fn test_workspaces_conflicting_edits() {
// The secondary workspace's working-copy commit was updated
insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###"
@ fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@
| o a1896a17282f19089a5cec44358d6609910e0513 secondary@
|/
o c0d4a99ef98ada7da8dc73a778bbb747c4178385
o 0000000000000000000000000000000000000000
@ fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@
o a1896a17282f19089a5cec44358d6609910e0513 secondary@
o c0d4a99ef98ada7da8dc73a778bbb747c4178385
o 0000000000000000000000000000000000000000
"###);
let stderr = test_env.jj_cmd_failure(&secondary_path, &["st"]);
insta::assert_snapshot!(stderr, @r###"
@ -131,21 +131,21 @@ fn test_workspaces_conflicting_edits() {
"###);
insta::assert_snapshot!(get_log_output(&test_env, &secondary_path),
@r###"
o fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@
| @ a1896a17282f19089a5cec44358d6609910e0513 secondary@
|/
o c0d4a99ef98ada7da8dc73a778bbb747c4178385
o 0000000000000000000000000000000000000000
o fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@
@ a1896a17282f19089a5cec44358d6609910e0513 secondary@
o c0d4a99ef98ada7da8dc73a778bbb747c4178385
o 0000000000000000000000000000000000000000
"###);
// The stale working copy should have been resolved by the previous command
let stdout = get_log_output(&test_env, &secondary_path);
assert!(!stdout.starts_with("The working copy is stale"));
insta::assert_snapshot!(stdout, @r###"
o fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@
| @ a1896a17282f19089a5cec44358d6609910e0513 secondary@
|/
o c0d4a99ef98ada7da8dc73a778bbb747c4178385
o 0000000000000000000000000000000000000000
o fe8f41ed01d693b2d4365cd89e42ad9c531a939b default@
@ a1896a17282f19089a5cec44358d6609910e0513 secondary@
o c0d4a99ef98ada7da8dc73a778bbb747c4178385
o 0000000000000000000000000000000000000000
"###);
}
@ -181,11 +181,11 @@ fn test_workspaces_forget() {
// there's only one workspace. We should show it when the command is not run
// from that workspace.
insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###"
o feda1c4e5ffe63fb16818ccdd8c21483537e31f2
| o e949be04e93e830fcce23fefac985c1deee52eea
|/
o 123ed18e4c4c0d77428df41112bc02ffc83fb935
o 0000000000000000000000000000000000000000
o feda1c4e5ffe63fb16818ccdd8c21483537e31f2
o e949be04e93e830fcce23fefac985c1deee52eea
o 123ed18e4c4c0d77428df41112bc02ffc83fb935
o 0000000000000000000000000000000000000000
"###);
// Revision "@" cannot be used