From 65de7cb0eb0c06750663b7db24830be4ee30520f Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Fri, 6 Jan 2023 17:59:57 -0800 Subject: [PATCH] `jj log`: Change conflicted branches from `br?` to `br??` The divergent changes are marked with ?? (I found a single ? a bit easy to overlook), and this should be consistent. Ideally, the conflicted branches would also be red, but this takes a bit larger changes to `templater.rs`: another `Property` as well as changes to https://github.com/martinvonz/jj/blob/7f9a0a28/src/template_parser.rs#L385-L395 --- src/templater.rs | 2 +- tests/test_templater.rs | 2 +- tests/test_unsquash_command.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/templater.rs b/src/templater.rs index 4fb03f882..58e126298 100644 --- a/src/templater.rs +++ b/src/templater.rs @@ -236,7 +236,7 @@ impl TemplateProperty for BranchProperty<'_> { if let Some(local_target) = local_target { if local_target.has_add(context.id()) { if local_target.is_conflict() { - names.push(format!("{branch_name}?")); + names.push(format!("{branch_name}??")); } else if branch_target .remote_targets .values() diff --git a/tests/test_templater.rs b/tests/test_templater.rs index 4f6f883f9..3c1a88fb8 100644 --- a/tests/test_templater.rs +++ b/tests/test_templater.rs @@ -66,7 +66,7 @@ fn test_templater_branches() { &["log", "-T", r#"commit_id.short() " " branches"#], ); insta::assert_snapshot!(output, @r###" - o b1bb3766d584 branch3? + o b1bb3766d584 branch3?? | @ a5b4d15489cc branch2* new-branch | | o 21c33875443e branch1* | |/ diff --git a/tests/test_unsquash_command.rs b/tests/test_unsquash_command.rs index 17177954c..75ddb52e7 100644 --- a/tests/test_unsquash_command.rs +++ b/tests/test_unsquash_command.rs @@ -110,8 +110,8 @@ fn test_unsquash() { insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" @ 3217340cb761 |\ - o | 5658521e0f8b d e? - | o 90fe0a96fc90 c e? + o | 5658521e0f8b d e?? + | o 90fe0a96fc90 c e?? |/ o fa5efbdf533c b o 90aeefd03044 a