Skip to content

Commit

Permalink
cli: move revsets.log default to config file
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonz committed May 5, 2024
1 parent f958957 commit 3dab92d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions cli/src/config/revsets.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# NOTE: ensure you update docs/revsets.md with documentation when
# adding/updating any of these aliases

[revsets]
log = "@ | ancestors(immutable_heads().., 2) | trunk()"

[revset-aliases]
'trunk()' = '''
latest(
Expand Down
4 changes: 1 addition & 3 deletions lib/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,7 @@ impl UserSettings {
}

pub fn default_revset(&self) -> String {
self.config
.get_string("revsets.log")
.unwrap_or_else(|_| "@ | ancestors(immutable_heads().., 2) | trunk()".to_string())
self.config.get_string("revsets.log").unwrap_or_default()
}

pub fn signature(&self) -> Signature {
Expand Down

0 comments on commit 3dab92d

Please sign in to comment.