cli templates: include info on divergent change ids in short commit template

Fixes #2411
This commit is contained in:
Ilya Grigoriev 2023-08-07 14:45:01 -07:00
parent a91b6d9dd9
commit 1733ae22c7
4 changed files with 14 additions and 22 deletions

View file

@ -1,11 +1,7 @@
[templates]
commit_summary = '''
separate(" ",
label(
if(hidden, "hidden"),
separate(" ",
format_short_change_id(change_id),
if(hidden, "hidden"))),
builtin_change_id_with_hidden_and_divergent_info,
format_short_commit_id(commit_id),
separate(commit_summary_separator,
branches,
@ -20,11 +16,7 @@ separate(" ",
commit_summary_no_branches = '''
separate(" ",
label(
if(hidden, "hidden"),
separate(" ",
format_short_change_id(change_id),
if(hidden, "hidden"))),
builtin_change_id_with_hidden_and_divergent_info,
format_short_commit_id(commit_id),
if(conflict, label("conflict", "(conflict)")),
if(empty, label("empty", "(empty)")),

View file

@ -152,8 +152,8 @@ fn test_checkout_conflicting_change_ids() {
insta::assert_snapshot!(stderr, @r###"
Error: Revset "qpvuntsm" resolved to more than one revision
Hint: The revset "qpvuntsm" resolved to these revisions:
qpvuntsm d2ae6806 (empty) two
qpvuntsm a9330854 (empty) one
qpvuntsm?? d2ae6806 (empty) two
qpvuntsm?? a9330854 (empty) one
Some of these commits have the same change id. Abandon one of them with `jj abandon -r <REVISION>`.
"###);
}

View file

@ -112,10 +112,10 @@ fn test_git_push_undo() {
// git fetch && jj undo && jj git fetch` would become a no-op.
insta::assert_snapshot!(get_branch_output(&test_env, &repo_path), @r###"
main (conflicted):
- qpvuntsm hidden 0cffb614 (empty) AA
+ qpvuntsm 0a3e99f0 (empty) CC
+ qpvuntsm 8c05de15 (empty) BB
@origin (behind by 1 commits): qpvuntsm 8c05de15 (empty) BB
- qpvuntsm?? hidden 0cffb614 (empty) AA
+ qpvuntsm?? 0a3e99f0 (empty) CC
+ qpvuntsm?? 8c05de15 (empty) BB
@origin (behind by 1 commits): qpvuntsm?? 8c05de15 (empty) BB
"###);
}
@ -270,11 +270,11 @@ fn test_git_push_undo_colocated() {
// same result in a seemingly different way?
insta::assert_snapshot!(get_branch_output(&test_env, &repo_path), @r###"
main (conflicted):
- qpvuntsm hidden 0cffb614 (empty) AA
+ qpvuntsm 0a3e99f0 (empty) CC
+ qpvuntsm 8c05de15 (empty) BB
@git (behind by 1 commits): qpvuntsm 0a3e99f0 (empty) CC
@origin (behind by 1 commits): qpvuntsm 8c05de15 (empty) BB
- qpvuntsm?? hidden 0cffb614 (empty) AA
+ qpvuntsm?? 0a3e99f0 (empty) CC
+ qpvuntsm?? 8c05de15 (empty) BB
@git (behind by 1 commits): qpvuntsm?? 0a3e99f0 (empty) CC
@origin (behind by 1 commits): qpvuntsm?? 8c05de15 (empty) BB
"###);
}

View file

@ -193,7 +193,7 @@ fn test_workspaces_conflicting_edits() {
insta::assert_snapshot!(stderr, @r###"
Concurrent modification detected, resolving automatically.
Rebased 1 descendant commits onto commits rewritten by other operation
Working copy now at: pmmvwywv a1896a17 (empty) (no description set)
Working copy now at: pmmvwywv?? a1896a17 (empty) (no description set)
Added 0 files, modified 1 files, removed 0 files
"###);
insta::assert_snapshot!(get_log_output(&test_env, &secondary_path),