Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add template aliases with node symbol configs #3501

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cli/src/config/colors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,9 @@
"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"

"node elided" = { fg = "bright black" }
"node working_copy" = { fg = "green", bold = true }
"node current_operation" = { fg = "green", bold = true }
"node immutable" = { fg = "bright cyan", bold = true }
"node conflict" = { fg = "red", bold = true }
62 changes: 62 additions & 0 deletions cli/src/config/templates.toml
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,65 @@ if(hidden,
)
)
'''

builtin_log_node = '''
label("node",
coalesce(
if(!self, label("elided", "~")),
label(
separate(" ",
if(current_working_copy, "working_copy"),
if(immutable, "immutable"),
if(conflict, "conflict"),
),
coalesce(
if(!self, "~"),
if(current_working_copy, "@"),
if(immutable, "◆"),
if(conflict, "×"),
"○",
)
)
)
)
'''

builtin_log_node_ascii = '''
label("node",
coalesce(
if(!self, label("elided", "~")),
label(
separate(" ",
if(current_working_copy, "working_copy"),
if(immutable, "immutable"),
if(conflict, "conflict"),
),
coalesce(
if(!self, "~"),
if(current_working_copy, "@"),
if(immutable, "#"),
if(conflict, "x"),
"o",
)
)
)
)
'''

builtin_op_log_node = '''
label("node",
coalesce(
if(current_operation, label("current_operation", "@")),
"○",
)
)
'''

builtin_op_log_node_ascii = '''
label("node",
coalesce(
if(current_operation, label("current_operation", "@")),
"o",
)
)
'''
4 changes: 4 additions & 0 deletions cli/tests/test_log_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ fn test_log_with_no_template() {
- 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
- commit_summary_separator
- description_placeholder
- email_placeholder
Expand Down
4 changes: 4 additions & 0 deletions cli/tests/test_obslog_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,13 @@ fn test_obslog_with_no_template() {
- 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
- commit_summary_separator
- description_placeholder
- email_placeholder
Expand Down
4 changes: 4 additions & 0 deletions cli/tests/test_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,13 @@ fn test_op_log_with_no_template() {
- 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
- commit_summary_separator
- description_placeholder
- email_placeholder
Expand Down
4 changes: 4 additions & 0 deletions cli/tests/test_show_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ fn test_show_with_no_template() {
- 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
- commit_summary_separator
- description_placeholder
- email_placeholder
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/test_templater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_oneline", "builtin_op_log_comfortable", "builtin_op_log_compact"?
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"?
"###);
}

Expand Down