diff --git a/CHANGELOG.md b/CHANGELOG.md index df804949a5..67a804b512 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Breaking changes -* The default template alias `builtin_op_log_root(op_id: OperationId)` was replaced by `format_root_operation(root: Operation)`. - -* The default template alias `builtin_log_root(change_id: ChangeId, commit_id: CommitId)` was replaced by `format_root_commit(root: Commit)`. +* The default template aliases were replaced as follows: + * `builtin_op_log_root(op_id: OperationId)` -> + `format_root_operation(root: Operation)` + * `builtin_log_root(change_id: ChangeId, commit_id: CommitId)` -> + `format_root_commit(root: Commit)` + * `builtin_change_id_with_hidden_and_divergent_info` -> + `format_short_change_id_with_hidden_and_divergent_info(commit: Commit)` ### New features diff --git a/cli/src/config/templates.toml b/cli/src/config/templates.toml index 01410fad79..1a93949efa 100644 --- a/cli/src/config/templates.toml +++ b/cli/src/config/templates.toml @@ -1,7 +1,7 @@ [templates] commit_summary = ''' separate(" ", - builtin_change_id_with_hidden_and_divergent_info, + format_short_change_id_with_hidden_and_divergent_info(self), format_short_commit_id(commit_id), separate(commit_summary_separator, branches, @@ -16,7 +16,7 @@ separate(" ", commit_summary_no_branches = ''' separate(" ", - builtin_change_id_with_hidden_and_divergent_info, + format_short_change_id_with_hidden_and_divergent_info(self), format_short_commit_id(commit_id), if(conflict, label("conflict", "(conflict)")), if(empty, label("empty", "(empty)")), @@ -46,7 +46,7 @@ if(root, label(if(current_working_copy, "working_copy"), concat( separate(" ", - builtin_change_id_with_hidden_and_divergent_info, + format_short_change_id_with_hidden_and_divergent_info(self), if(author.email(), author.username(), email_placeholder), format_timestamp(committer.timestamp()), branches, @@ -68,7 +68,7 @@ if(root, label(if(current_working_copy, "working_copy"), concat( separate(" ", - builtin_change_id_with_hidden_and_divergent_info, + format_short_change_id_with_hidden_and_divergent_info(self), format_short_signature(author), format_timestamp(committer.timestamp()), branches, @@ -155,13 +155,13 @@ separate(" ", # 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 = ''' -if(hidden, +'format_short_change_id_with_hidden_and_divergent_info(commit)' = ''' +if(commit.hidden(), label("hidden", - format_short_change_id(change_id) ++ " hidden" + format_short_change_id(commit.change_id()) ++ " hidden" ), - label(if(divergent, "divergent"), - format_short_change_id(change_id) ++ if(divergent, "??") + label(if(commit.divergent(), "divergent"), + format_short_change_id(commit.change_id()) ++ if(commit.divergent(), "??") ) ) ''' diff --git a/cli/tests/test_log_command.rs b/cli/tests/test_log_command.rs index dbccba748b..176e7e43be 100644 --- a/cli/tests/test_log_command.rs +++ b/cli/tests/test_log_command.rs @@ -40,7 +40,6 @@ fn test_log_with_no_template() { For more information, try '--help'. Hint: The following template aliases are defined: - - builtin_change_id_with_hidden_and_divergent_info - builtin_log_comfortable - builtin_log_compact - builtin_log_detailed diff --git a/cli/tests/test_obslog_command.rs b/cli/tests/test_obslog_command.rs index 4647a6a45f..dec0cda0ad 100644 --- a/cli/tests/test_obslog_command.rs +++ b/cli/tests/test_obslog_command.rs @@ -275,7 +275,6 @@ fn test_obslog_with_no_template() { For more information, try '--help'. Hint: The following template aliases are defined: - - builtin_change_id_with_hidden_and_divergent_info - builtin_log_comfortable - builtin_log_compact - builtin_log_detailed diff --git a/cli/tests/test_operations.rs b/cli/tests/test_operations.rs index e0b54b9384..eee55db184 100644 --- a/cli/tests/test_operations.rs +++ b/cli/tests/test_operations.rs @@ -136,7 +136,6 @@ fn test_op_log_with_no_template() { For more information, try '--help'. Hint: The following template aliases are defined: - - builtin_change_id_with_hidden_and_divergent_info - builtin_log_comfortable - builtin_log_compact - builtin_log_detailed diff --git a/cli/tests/test_show_command.rs b/cli/tests/test_show_command.rs index 15cf1cffc1..16273bea9a 100644 --- a/cli/tests/test_show_command.rs +++ b/cli/tests/test_show_command.rs @@ -60,7 +60,6 @@ fn test_show_with_no_template() { For more information, try '--help'. Hint: The following template aliases are defined: - - builtin_change_id_with_hidden_and_divergent_info - builtin_log_comfortable - builtin_log_compact - builtin_log_detailed diff --git a/cli/tests/test_templater.rs b/cli/tests/test_templater.rs index 08e2308a3b..d58ad16f78 100644 --- a/cli/tests/test_templater.rs +++ b/cli/tests/test_templater.rs @@ -111,7 +111,7 @@ fn test_templater_parse_error() { | ^-----^ | = Keyword "builtin" doesn't exist - Hint: Did you mean "builtin_change_id_with_hidden_and_divergent_info", "builtin_log_comfortable", "builtin_log_compact", "builtin_log_detailed", "builtin_log_node", "builtin_log_node_ascii", "builtin_log_oneline", "builtin_op_log_comfortable", "builtin_op_log_compact", "builtin_op_log_node", "builtin_op_log_node_ascii"? + Hint: Did you mean "builtin_log_comfortable", "builtin_log_compact", "builtin_log_detailed", "builtin_log_node", "builtin_log_node_ascii", "builtin_log_oneline", "builtin_op_log_comfortable", "builtin_op_log_compact", "builtin_op_log_node", "builtin_op_log_node_ascii"? "###); }