mirror of
https://github.com/martinvonz/jj.git
synced 2025-02-01 00:50:57 +00:00
cli change id templates: make "hidden" override "divergent"
See the test changes in `test_undo.rs` for motivation. This matters rarely, but seems to be better.
This commit is contained in:
parent
1733ae22c7
commit
eeb93cc8be
4 changed files with 17 additions and 14 deletions
|
@ -15,9 +15,6 @@
|
||||||
"divergent rest" = "red"
|
"divergent rest" = "red"
|
||||||
"divergent prefix" = {fg = "red", underline=true}
|
"divergent prefix" = {fg = "red", underline=true}
|
||||||
"hidden prefix" = "default"
|
"hidden prefix" = "default"
|
||||||
"divergent hidden" = {fg = "default", bold = true}
|
|
||||||
"divergent hidden prefix" = {fg = "default", underline = false}
|
|
||||||
"divergent hidden rest" = {fg ="bright black", bold = false}
|
|
||||||
|
|
||||||
"email" = "yellow"
|
"email" = "yellow"
|
||||||
"username" = "yellow"
|
"username" = "yellow"
|
||||||
|
|
|
@ -133,10 +133,16 @@ commit_summary_separator = 'label("separator", " | ")'
|
||||||
time_range.start().ago() ++ label("time", ", lasted ") ++ time_range.duration()'''
|
time_range.start().ago() ++ label("time", ", lasted ") ++ time_range.duration()'''
|
||||||
'format_timestamp(timestamp)' = 'timestamp'
|
'format_timestamp(timestamp)' = 'timestamp'
|
||||||
|
|
||||||
|
# We have "hidden" override "divergent", since a hidden revision does not cause
|
||||||
|
# change id conflicts and is not affected by such conflicts; you have to use the
|
||||||
|
# commit id to refer to a hidden revision regardless.
|
||||||
builtin_change_id_with_hidden_and_divergent_info = '''
|
builtin_change_id_with_hidden_and_divergent_info = '''
|
||||||
label(
|
if(hidden,
|
||||||
separate(" ", if(divergent, "divergent"), if(hidden, "hidden")),
|
label("hidden",
|
||||||
separate(" ",
|
format_short_change_id(change_id) ++ " hidden"
|
||||||
format_short_change_id(change_id) ++ if(divergent, "??"),
|
),
|
||||||
if(hidden, "hidden")))
|
label(if(divergent, "divergent"),
|
||||||
|
format_short_change_id(change_id) ++ if(divergent,"??")
|
||||||
|
)
|
||||||
|
)
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -344,9 +344,9 @@ fn test_log_obslog_divergence() {
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
@ qpvuntsm?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e
|
@ qpvuntsm?? test.user@example.com 2001-02-03 04:05:08.000 +07:00 7a17d52e
|
||||||
│ description 1
|
│ description 1
|
||||||
◉ qpvuntsm?? hidden test.user@example.com 2001-02-03 04:05:08.000 +07:00 3b68ce25
|
◉ qpvuntsm hidden test.user@example.com 2001-02-03 04:05:08.000 +07:00 3b68ce25
|
||||||
│ (no description set)
|
│ (no description set)
|
||||||
◉ qpvuntsm?? hidden test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059
|
◉ qpvuntsm hidden test.user@example.com 2001-02-03 04:05:07.000 +07:00 230dd059
|
||||||
(empty) (no description set)
|
(empty) (no description set)
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
|
@ -355,9 +355,9 @@ fn test_log_obslog_divergence() {
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
@ [1m[4m[38;5;1mq[24mpvuntsm[38;5;9m??[39m [38;5;3mtest.user@example.com[39m [38;5;14m2001-02-03 04:05:08.000 +07:00[39m [38;5;12m7[38;5;8ma17d52e[39m[0m
|
@ [1m[4m[38;5;1mq[24mpvuntsm[38;5;9m??[39m [38;5;3mtest.user@example.com[39m [38;5;14m2001-02-03 04:05:08.000 +07:00[39m [38;5;12m7[38;5;8ma17d52e[39m[0m
|
||||||
│ [1mdescription 1[0m
|
│ [1mdescription 1[0m
|
||||||
◉ [1m[24m[39mq[0m[38;5;8mpvuntsm[1m[39m?? hidden[0m [38;5;3mtest.user@example.com[39m [38;5;6m2001-02-03 04:05:08.000 +07:00[39m [1m[38;5;4m3[0m[38;5;8mb68ce25[39m
|
◉ [1m[39mq[0m[38;5;8mpvuntsm[39m hidden [38;5;3mtest.user@example.com[39m [38;5;6m2001-02-03 04:05:08.000 +07:00[39m [1m[38;5;4m3[0m[38;5;8mb68ce25[39m
|
||||||
│ [38;5;3m(no description set)[39m
|
│ [38;5;3m(no description set)[39m
|
||||||
◉ [1m[24m[39mq[0m[38;5;8mpvuntsm[1m[39m?? hidden[0m [38;5;3mtest.user@example.com[39m [38;5;6m2001-02-03 04:05:07.000 +07:00[39m [1m[38;5;4m2[0m[38;5;8m30dd059[39m
|
◉ [1m[39mq[0m[38;5;8mpvuntsm[39m hidden [38;5;3mtest.user@example.com[39m [38;5;6m2001-02-03 04:05:07.000 +07:00[39m [1m[38;5;4m2[0m[38;5;8m30dd059[39m
|
||||||
[38;5;2m(empty)[39m [38;5;2m(no description set)[39m
|
[38;5;2m(empty)[39m [38;5;2m(no description set)[39m
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ fn test_git_push_undo() {
|
||||||
// git fetch && jj undo && jj git fetch` would become a no-op.
|
// git fetch && jj undo && jj git fetch` would become a no-op.
|
||||||
insta::assert_snapshot!(get_branch_output(&test_env, &repo_path), @r###"
|
insta::assert_snapshot!(get_branch_output(&test_env, &repo_path), @r###"
|
||||||
main (conflicted):
|
main (conflicted):
|
||||||
- qpvuntsm?? hidden 0cffb614 (empty) AA
|
- qpvuntsm hidden 0cffb614 (empty) AA
|
||||||
+ qpvuntsm?? 0a3e99f0 (empty) CC
|
+ qpvuntsm?? 0a3e99f0 (empty) CC
|
||||||
+ qpvuntsm?? 8c05de15 (empty) BB
|
+ qpvuntsm?? 8c05de15 (empty) BB
|
||||||
@origin (behind by 1 commits): qpvuntsm?? 8c05de15 (empty) BB
|
@origin (behind by 1 commits): qpvuntsm?? 8c05de15 (empty) BB
|
||||||
|
@ -270,7 +270,7 @@ fn test_git_push_undo_colocated() {
|
||||||
// same result in a seemingly different way?
|
// same result in a seemingly different way?
|
||||||
insta::assert_snapshot!(get_branch_output(&test_env, &repo_path), @r###"
|
insta::assert_snapshot!(get_branch_output(&test_env, &repo_path), @r###"
|
||||||
main (conflicted):
|
main (conflicted):
|
||||||
- qpvuntsm?? hidden 0cffb614 (empty) AA
|
- qpvuntsm hidden 0cffb614 (empty) AA
|
||||||
+ qpvuntsm?? 0a3e99f0 (empty) CC
|
+ qpvuntsm?? 0a3e99f0 (empty) CC
|
||||||
+ qpvuntsm?? 8c05de15 (empty) BB
|
+ qpvuntsm?? 8c05de15 (empty) BB
|
||||||
@git (behind by 1 commits): qpvuntsm?? 0a3e99f0 (empty) CC
|
@git (behind by 1 commits): qpvuntsm?? 0a3e99f0 (empty) CC
|
||||||
|
|
Loading…
Reference in a new issue