forked from mirrors/jj
cli: enable fileset by default
I've tested it for months and found no problems.
This commit is contained in:
parent
bf7f3d7c60
commit
8fec7500c3
6 changed files with 24 additions and 25 deletions
|
@ -23,6 +23,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|||
* Updated defaults for graph node symbol templates `templates.log_node` and
|
||||
`templates.op_log_node`.
|
||||
|
||||
* [The "fileset" language](docs/filesets.md) is now enabled by default. It can
|
||||
still be disable by setting `ui.allow-filesets=false`.
|
||||
|
||||
### Deprecations
|
||||
|
||||
### New features
|
||||
|
|
|
@ -9,7 +9,8 @@ unamend = ["unsquash"]
|
|||
tree-level-conflicts = true
|
||||
|
||||
[ui]
|
||||
allow-filesets = false
|
||||
# TODO: delete ui.allow-filesets in jj 0.26+
|
||||
allow-filesets = true
|
||||
always-allow-large-revsets = false
|
||||
diff-instructions = true
|
||||
paginate = "auto"
|
||||
|
|
|
@ -198,15 +198,7 @@ fn test_diff_basic() {
|
|||
"###);
|
||||
|
||||
// Filter by glob pattern
|
||||
let stdout = test_env.jj_cmd_success(
|
||||
&repo_path,
|
||||
&[
|
||||
"diff",
|
||||
"--config-toml=ui.allow-filesets=true",
|
||||
"-s",
|
||||
"glob:file[12]",
|
||||
],
|
||||
);
|
||||
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s", "glob:file[12]"]);
|
||||
insta::assert_snapshot!(stdout, @r###"
|
||||
D file1
|
||||
M file2
|
||||
|
|
|
@ -233,8 +233,6 @@ fn test_bad_path() {
|
|||
let subdir = repo_path.join("dir");
|
||||
std::fs::create_dir_all(&subdir).unwrap();
|
||||
|
||||
test_env.add_config("ui.allow-filesets = true");
|
||||
|
||||
// cwd == workspace_root
|
||||
let stderr = test_env.jj_cmd_failure(&repo_path, &["file", "show", "../out"]);
|
||||
insta::assert_snapshot!(stderr.replace('\\', "/"), @r###"
|
||||
|
@ -450,8 +448,16 @@ fn test_color_ui_messages() {
|
|||
// error source
|
||||
let stderr = test_env.jj_cmd_failure(&repo_path, &["log", ".."]);
|
||||
insta::assert_snapshot!(stderr.replace('\\', "/"), @r###"
|
||||
[1m[38;5;1mError: [39mPath ".." is not in the repo "."[0m
|
||||
[1m[39mCaused by: [0m[39mInvalid component ".." in repo-relative path "../"[39m
|
||||
[1m[38;5;1mError: [39mFailed to parse fileset: Invalid file pattern[0m
|
||||
[1m[39mCaused by:[0m
|
||||
[1m[39m1: [0m[39m --> 1:1[39m
|
||||
[39m |[39m
|
||||
[39m1 | ..[39m
|
||||
[39m | ^^[39m
|
||||
[39m |[39m
|
||||
[39m = Invalid file pattern[39m
|
||||
[1m[39m2: [0m[39mPath ".." is not in the repo "."[39m
|
||||
[1m[39m3: [0m[39mInvalid component ".." in repo-relative path "../"[39m
|
||||
"###);
|
||||
|
||||
// warning
|
||||
|
|
|
@ -825,18 +825,22 @@ fn test_log_filtered_by_path() {
|
|||
A file2
|
||||
"###);
|
||||
|
||||
// Fileset/pattern syntax is disabled by default.
|
||||
// Fileset/pattern syntax can be disabled.
|
||||
let stderr = test_env.jj_cmd_failure(
|
||||
test_env.env_root(),
|
||||
&["log", "-R", repo_path.to_str().unwrap(), "all()"],
|
||||
&[
|
||||
"log",
|
||||
"--config-toml=ui.allow-filesets=false",
|
||||
"-R",
|
||||
repo_path.to_str().unwrap(),
|
||||
"all()",
|
||||
],
|
||||
);
|
||||
insta::assert_snapshot!(stderr.replace('\\', "/"), @r###"
|
||||
Error: Path "all()" is not in the repo "repo"
|
||||
Caused by: Invalid component ".." in repo-relative path "../all()"
|
||||
"###);
|
||||
|
||||
test_env.add_config("ui.allow-filesets = true");
|
||||
|
||||
// empty revisions are filtered out by "all()" fileset.
|
||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-Tdescription", "-s", "all()"]);
|
||||
insta::assert_snapshot!(stdout, @r###"
|
||||
|
|
|
@ -5,13 +5,6 @@ Expressions in this language are called "filesets" (the idea comes from
|
|||
[Mercurial](https://repo.mercurial-scm.org/hg/help/filesets)). The language
|
||||
consists of file patterns, operators, and functions.
|
||||
|
||||
**Filesets support is still experimental.** It can be enabled by
|
||||
`ui.allow-filesets`.
|
||||
|
||||
```toml
|
||||
ui.allow-filesets = true
|
||||
```
|
||||
|
||||
Many `jj` commands accept fileset expressions as positional arguments. File
|
||||
names passed to these commands [must be quoted][string-literals] if they contain
|
||||
whitespace or meta characters. However, as a special case, quotes can be omitted
|
||||
|
|
Loading…
Reference in a new issue