-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a builtin overrides config source.
* The builtin overrides config source is backed by `config/builtins.toml`, but is sourced last. * This will take precedence over everything else. * Define `builtin_immutable_heads()` in the `builtins.toml` * Warn if user redefines `builtin_`, that these may be ignored. * Redefine `immutable_heads()` in terms of `builtin_immutable_heads()` * Add unittests * Update CHANGELOG and documentation.
- Loading branch information
Showing
7 changed files
with
88 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[revset-aliases] | ||
'builtin_immutable_heads()' = 'trunk() | tags() | untracked_remote_branches()' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,3 +136,20 @@ fn test_builtin_alias_trunk_no_match_only_exact() { | |
insta::assert_snapshot!(stderr, @r###" | ||
"###); | ||
} | ||
|
||
#[test] | ||
fn test_builtin_user_redefines_builtin_immutable_heads() { | ||
let (test_env, workspace_root) = set_up("main"); | ||
|
||
test_env.add_config(r#"revset-aliases.'builtin_immutable_heads()' = '@'"#); | ||
|
||
let (stdout, stderr) = test_env.jj_cmd_ok(&workspace_root, &["log", "-r", "trunk()"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◆ xtvrqkyv [email protected] 2001-02-03 08:05:08 main d13ecdbd | ||
│ (empty) description 1 | ||
~ | ||
"###); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Warning: `revset-aliases.builtin_immutable_heads()` may be overridden; aliases starting with `builtin` are reserved | ||
"###); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters