formatter & colors.toml: replace op_log color label
Some checks failed
build / build (, macos-13) (push) Has been cancelled
build / build (, macos-14) (push) Has been cancelled
build / build (, ubuntu-latest) (push) Has been cancelled
build / build (, windows-latest) (push) Has been cancelled
build / build (--all-features, ubuntu-latest) (push) Has been cancelled
build / Build jj-lib without Git support (push) Has been cancelled
build / Check protos (push) Has been cancelled
build / Check formatting (push) Has been cancelled
build / Check that MkDocs can build the docs (push) Has been cancelled
build / Check that MkDocs can build the docs with Poetry 1.8 (push) Has been cancelled
build / cargo-deny (advisories) (push) Has been cancelled
build / cargo-deny (bans licenses sources) (push) Has been cancelled
build / Clippy check (push) Has been cancelled

Cleans up after 7051effa8f

It's split into "operation op_log" and just "operation" for the
summaries (as suggested by Yuya). The color labels use "operation".
This commit is contained in:
Ilya Grigoriev 2024-10-14 10:48:51 -07:00
parent e415c09ede
commit c4672c65b1
6 changed files with 19 additions and 18 deletions

View file

@ -18,6 +18,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
* Help command doesn't work recursively anymore, i.e. `jj workspace help root`
doesn't work anymore.
* The color label `op_log` from the `[colors]` config section now **only**
applies to the op log and not to the other places operations are displayed. In
almost all cases, if you configured `op_log` before, you should use the new
`operation` label instead.
* Default operation log template now shows end times of operations instead of
start times.

View file

@ -1492,12 +1492,7 @@ impl WorkspaceCommandHelper {
&self.op_summary_template_text,
OperationTemplateLanguage::wrap_operation,
)
// TODO: "op_log" is not a great label name for op_summary. We could
// replace it with `operation summary` and use `operation` in
// colors.toml. TODO: It would be better to put labels like these
// consistently in the same place, e.g. `templates.toml` instead of the
// rust code.
.labeled("op_log")
.labeled("operation")
}
pub fn short_change_id_template(&self) -> TemplateRenderer<'_, Commit> {

View file

@ -130,7 +130,8 @@ fn do_op_log(
&text,
OperationTemplateLanguage::wrap_operation,
)?
.labeled("op_log");
.labeled("op_log")
.labeled("operation");
op_node_template = workspace_env
.parse_template(
ui,

View file

@ -82,7 +82,7 @@ pub fn cmd_op_show(
let text = command.settings().config().get_string("templates.op_log")?;
workspace_command
.parse_operation_template(ui, &text)?
.labeled("op_log")
.labeled("operation")
};
ui.request_pager();

View file

@ -97,13 +97,13 @@
"diff copied" = "green"
"diff access-denied" = { bg = "red" }
"op_log id" = "blue"
"op_log user" = "yellow"
"op_log time" = "cyan"
"op_log current_operation" = { bold = true }
"op_log current_operation id" = "bright blue"
"op_log current_operation user" = "yellow" # No bright yellow, see comment above
"op_log current_operation time" = "bright cyan"
"operation id" = "blue"
"operation user" = "yellow"
"operation time" = "cyan"
"operation current_operation" = { bold = true }
"operation current_operation id" = "bright blue"
"operation current_operation user" = "yellow" # No bright yellow, see comment above
"operation current_operation time" = "bright cyan"
"node elided" = { fg = "bright black" }
"node working_copy" = { fg = "green", bold = true }

View file

@ -820,7 +820,7 @@ fn test_op_summary_diff_template() {
let (stdout, stderr) = test_env.jj_cmd_ok(&repo_path, &["op", "undo", "--color=debug"]);
insta::assert_snapshot!(&stdout, @"");
insta::assert_snapshot!(&stderr, @r#"
Undid operation: <<op_log id short::2301f6e6ec31>><<op_log:: (>><<op_log time end local format::2001-02-03 08:05:11>><<op_log::) >><<op_log description first_line::new empty commit>>
Undid operation: <<operation id short::2301f6e6ec31>><<operation:: (>><<operation time end local format::2001-02-03 08:05:11>><<operation::) >><<operation description first_line::new empty commit>>
"#);
let stdout = test_env.jj_cmd_success(
&repo_path,
@ -835,8 +835,8 @@ fn test_op_summary_diff_template() {
],
);
insta::assert_snapshot!(&stdout, @r#"
From operation: <<op_log id short::000000000000>><<op_log:: >><<op_log root::root()>>
To operation: <<op_log id short::d208ae1b4e3c>><<op_log:: (>><<op_log time end local format::2001-02-03 08:05:12>><<op_log::) >><<op_log description first_line::undo operation 2301f6e6ec31931a9b0a594742d6035a44c05250d1707f7f8678e888b11a98773ef07bf0e8008a5bccddf7114da4a35d1a1b1f7efa37c1e6c80d6bdb8f0d7a90>>
From operation: <<operation id short::000000000000>><<operation:: >><<operation root::root()>>
To operation: <<operation id short::d208ae1b4e3c>><<operation:: (>><<operation time end local format::2001-02-03 08:05:12>><<operation::) >><<operation description first_line::undo operation 2301f6e6ec31931a9b0a594742d6035a44c05250d1707f7f8678e888b11a98773ef07bf0e8008a5bccddf7114da4a35d1a1b1f7efa37c1e6c80d6bdb8f0d7a90>>
Changed commits:
Change qpvuntsmwlqt