forked from mirrors/jj
cli: rename ui.graph.format
to ui.graph.style
I think of it more as style than a format, so using `style` in the config key makes sense to me. I didn't bother making upgrades easy by supporting the old name since this was just released and only a few developers probably have it set.
This commit is contained in:
parent
8248d6e8f6
commit
d8942d5f96
5 changed files with 9 additions and 9 deletions
|
@ -87,7 +87,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
still accepted for backwards compatibility for some time.
|
||||
|
||||
* Commands that draw an ASCII graph (`jj log`, `jj op log`, `jj obslog`) now
|
||||
have different styles available by setting e.g. `ui.graph.format = "curved"`.
|
||||
have different styles available by setting e.g. `ui.graph.style = "curved"`.
|
||||
|
||||
### Fixed bugs
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ ui.color = "never" # Turn off color
|
|||
```toml
|
||||
# Possible values: "curved", "square", "ascii", "ascii-large",
|
||||
# "legacy" (default)
|
||||
ui.graph.format = "curved"
|
||||
ui.graph.style = "curved"
|
||||
```
|
||||
|
||||
### Shortest unique prefixes for ids
|
||||
|
|
|
@ -153,9 +153,9 @@ impl UserSettings {
|
|||
&self.config
|
||||
}
|
||||
|
||||
pub fn graph_format(&self) -> String {
|
||||
pub fn graph_style(&self) -> String {
|
||||
self.config
|
||||
.get_string("ui.graph.format")
|
||||
.get_string("ui.graph.style")
|
||||
.unwrap_or_else(|_| "legacy".to_string())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ pub fn get_graphlog<'a, K: Clone + Eq + Hash + 'a>(
|
|||
) -> Box<dyn GraphLog<K> + 'a> {
|
||||
let builder = GraphRowRenderer::new().output().with_min_row_height(0);
|
||||
|
||||
match settings.graph_format().as_str() {
|
||||
match settings.graph_style().as_str() {
|
||||
"curved" => SaplingGraphLog::create(builder.build_box_drawing(), formatter),
|
||||
"square" => {
|
||||
SaplingGraphLog::create(builder.build_box_drawing().with_square_glyphs(), formatter)
|
||||
|
|
|
@ -718,7 +718,7 @@ fn test_graph_styles() {
|
|||
"###);
|
||||
|
||||
// ASCII style
|
||||
test_env.add_config(r#"ui.graph.format = "ascii""#);
|
||||
test_env.add_config(r#"ui.graph.style = "ascii""#);
|
||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T=description"]);
|
||||
insta::assert_snapshot!(stdout, @r###"
|
||||
@ merge
|
||||
|
@ -735,7 +735,7 @@ fn test_graph_styles() {
|
|||
"###);
|
||||
|
||||
// Large ASCII style
|
||||
test_env.add_config(r#"ui.graph.format = "ascii-large""#);
|
||||
test_env.add_config(r#"ui.graph.style = "ascii-large""#);
|
||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T=description"]);
|
||||
insta::assert_snapshot!(stdout, @r###"
|
||||
@ merge
|
||||
|
@ -754,7 +754,7 @@ fn test_graph_styles() {
|
|||
"###);
|
||||
|
||||
// Curved style
|
||||
test_env.add_config(r#"ui.graph.format = "curved""#);
|
||||
test_env.add_config(r#"ui.graph.style = "curved""#);
|
||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T=description"]);
|
||||
insta::assert_snapshot!(stdout, @r###"
|
||||
@ merge
|
||||
|
@ -771,7 +771,7 @@ fn test_graph_styles() {
|
|||
"###);
|
||||
|
||||
// Square style
|
||||
test_env.add_config(r#"ui.graph.format = "square""#);
|
||||
test_env.add_config(r#"ui.graph.style = "square""#);
|
||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T=description"]);
|
||||
insta::assert_snapshot!(stdout, @r###"
|
||||
@ merge
|
||||
|
|
Loading…
Reference in a new issue