-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make node symbols templatable in the graphs.
Adds config options * ui.graph.commit-node-template * ui.graph.op-node-template * ui.graph.elided-node-template
- Loading branch information
Showing
9 changed files
with
146 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,39 @@ fn test_obslog_with_or_without_diff() { | |
"###); | ||
} | ||
|
||
#[test] | ||
fn test_obslog_with_custom_symbols() { | ||
let test_env = TestEnvironment::default(); | ||
test_env.jj_cmd_ok(test_env.env_root(), &["init", "repo", "--git"]); | ||
let repo_path = test_env.env_root().join("repo"); | ||
|
||
std::fs::write(repo_path.join("file1"), "foo\n").unwrap(); | ||
test_env.jj_cmd_ok(&repo_path, &["new", "-m", "my description"]); | ||
std::fs::write(repo_path.join("file1"), "foo\nbar\n").unwrap(); | ||
std::fs::write(repo_path.join("file2"), "foo\n").unwrap(); | ||
test_env.jj_cmd_ok(&repo_path, &["rebase", "-r", "@", "-d", "root()"]); | ||
std::fs::write(repo_path.join("file1"), "resolved\n").unwrap(); | ||
|
||
let toml = concat!( | ||
"ui.log-synthetic-elided-nodes = true\n", | ||
"ui.graph.commit-node-template = 'if(current_working_copy, \"$\", if(root, \"┴\", \ | ||
\"┝\"))'\n", | ||
); | ||
|
||
let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "--config-toml", toml]); | ||
|
||
insta::assert_snapshot!(stdout, @r###" | ||
$ rlvkpnrz [email protected] 2001-02-03 04:05:10.000 +07:00 66b42ad3 | ||
│ my description | ||
┝ rlvkpnrz hidden [email protected] 2001-02-03 04:05:09.000 +07:00 ebc23d4b conflict | ||
│ my description | ||
┝ rlvkpnrz hidden [email protected] 2001-02-03 04:05:09.000 +07:00 6fbba7bc | ||
│ my description | ||
┝ rlvkpnrz hidden [email protected] 2001-02-03 04:05:08.000 +07:00 eac0d0da | ||
(empty) my description | ||
"###); | ||
} | ||
|
||
#[test] | ||
fn test_obslog_word_wrap() { | ||
let test_env = TestEnvironment::default(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,38 @@ fn test_op_log() { | |
"###); | ||
} | ||
|
||
#[test] | ||
fn test_op_log_with_custom_symbols() { | ||
let test_env = TestEnvironment::default(); | ||
test_env.jj_cmd_ok(test_env.env_root(), &["init", "repo", "--git"]); | ||
let repo_path = test_env.env_root().join("repo"); | ||
test_env.jj_cmd_ok(&repo_path, &["describe", "-m", "description 0"]); | ||
|
||
let stdout = test_env.jj_cmd_success( | ||
&repo_path, | ||
&[ | ||
"op", | ||
"log", | ||
"--config-toml", | ||
concat!( | ||
"template-aliases.'format_time_range(x)' = 'x'\n", | ||
"ui.graph.op-node-template = 'if(current_operation, \"$\", if(root, \"┴\", \ | ||
\"┝\"))'", | ||
), | ||
], | ||
); | ||
insta::assert_snapshot!(&stdout, @r###" | ||
$ 52ac15d375ba [email protected] 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' | ||
┝ b51416386f26 [email protected] 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00 | ||
│ add workspace 'default' | ||
┝ 9a7d829846af [email protected] 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00 | ||
│ initialize repo | ||
┴ 000000000000 root() | ||
"###); | ||
} | ||
|
||
#[test] | ||
fn test_op_log_with_no_template() { | ||
let test_env = TestEnvironment::default(); | ||
|
Oops, something went wrong.