Skip to content

Commit 07c63ed

Browse files
committed
cli: remove ui.allow-filesets configuration option
The "fileset" language has been enabled by default since v0.20.
1 parent 9cab4d9 commit 07c63ed

File tree

8 files changed

+5
-54
lines changed

8 files changed

+5
-54
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1212

1313
### Breaking changes
1414

15+
* The `ui.allow-filesets` configuration option has been removed.
16+
[The "fileset" language](docs/filesets.md) has been enabled by default since v0.20.
17+
1518
### Deprecations
1619

1720
### New features
@@ -834,7 +837,7 @@ Thanks to the people who made this release happen!
834837
`templates.op_log_node`.
835838

836839
* [The "fileset" language](docs/filesets.md) is now enabled by default. It can
837-
still be disable by setting `ui.allow-filesets=false`.
840+
still be disabled by setting `ui.allow-filesets=false`.
838841

839842
* On `jj git fetch`/`import`, commits referred to by `HEAD@git` are no longer
840843
preserved. If a checked-out named branch gets deleted locally or remotely, the

cli/src/cli_util.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,15 +1312,8 @@ to the current parents may contain changes from multiple commits.
13121312
// empty arguments.
13131313
if values.is_empty() {
13141314
Ok(FilesetExpression::all())
1315-
} else if self.settings().get_bool("ui.allow-filesets")? {
1316-
self.parse_union_filesets(ui, values)
13171315
} else {
1318-
let expressions = values
1319-
.iter()
1320-
.map(|v| self.parse_file_path(v))
1321-
.map_ok(FilesetExpression::prefix_path)
1322-
.try_collect()?;
1323-
Ok(FilesetExpression::union_all(expressions))
1316+
self.parse_union_filesets(ui, values)
13241317
}
13251318
}
13261319

cli/src/complete.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,6 @@ fn all_files_from_rev(rev: String, current: &std::ffi::OsStr) -> Vec<CompletionC
572572
.arg("list")
573573
.arg("--revision")
574574
.arg(rev)
575-
.arg("--config=ui.allow-filesets=true")
576575
.arg(current_prefix_to_fileset(current))
577576
.stdout(std::process::Stdio::piped())
578577
.stderr(std::process::Stdio::null())
@@ -605,7 +604,6 @@ fn modified_files_from_rev_with_jj_cmd(
605604
};
606605
cmd.arg("diff")
607606
.arg("--summary")
608-
.arg("--config=ui.allow-filesets=true")
609607
.arg(current_prefix_to_fileset(current));
610608
match rev {
611609
(rev, None) => cmd.arg("--revision").arg(rev),
@@ -657,7 +655,6 @@ fn conflicted_files_from_rev(rev: &str, current: &std::ffi::OsStr) -> Vec<Comple
657655
.arg("--list")
658656
.arg("--revision")
659657
.arg(rev)
660-
.arg("--config=ui.allow-filesets=true")
661658
.arg(current_prefix_to_fileset(current))
662659
.output()
663660
.map_err(user_error)?;

cli/src/config-schema.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@
5353
"description": "Whether to allow initializing a repo with the native backend",
5454
"default": false
5555
},
56-
"allow-filesets": {
57-
"type": "boolean",
58-
"description": "Whether to parse path arguments as fileset expressions",
59-
"default": true
60-
},
6156
"always-allow-large-revsets": {
6257
"type": "boolean",
6358
"description": "Whether to allow large revsets to be used in all commands without the `all:` modifier",

cli/src/config/misc.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ push-new-bookmarks = false
2020
sign-on-push = false
2121

2222
[ui]
23-
# TODO: delete ui.allow-filesets in jj 0.26+
24-
allow-filesets = true
2523
allow-init-native = false
2624
always-allow-large-revsets = false
2725
color = "auto"

cli/tests/test_completion.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,10 +636,6 @@ fn test_files() {
636636
test_env.jj_cmd_ok(test_env.env_root(), &["git", "init", "repo"]);
637637
let repo_path = test_env.env_root().join("repo");
638638

639-
// Completions for files use filesets internally.
640-
// Ensure they still work if the user has them disabled.
641-
test_env.add_config("ui.allow-filesets = false");
642-
643639
create_commit(
644640
&test_env,
645641
&repo_path,

cli/tests/test_global_opts.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,6 @@ fn test_bad_path() {
286286
3: Invalid component ".." in repo-relative path "../out"
287287
Hint: Consider using root:"out" to specify repo-relative path
288288
"###);
289-
290-
test_env.add_config("ui.allow-filesets = false");
291-
292-
// If fileset/pattern syntax is disabled, no hint should be generated
293-
let stderr = test_env.jj_cmd_failure(test_env.env_root(), &["file", "show", "-Rrepo", "out"]);
294-
insta::assert_snapshot!(stderr.replace('\\', "/"), @r###"
295-
Error: Path "out" is not in the repo "repo"
296-
Caused by: Invalid component ".." in repo-relative path "../out"
297-
"###);
298289
}
299290

300291
#[test]
@@ -314,12 +305,6 @@ fn test_invalid_filesets_looking_like_filepaths() {
314305
= expected `~` or <primary>
315306
Hint: See https://jj-vcs.github.io/jj/latest/filesets/ for filesets syntax, or for how to match file paths.
316307
"#);
317-
318-
test_env.add_config(r#"ui.allow-filesets=false"#);
319-
let stderr = test_env.jj_cmd_failure(&repo_path, &["file", "show", "abc~"]);
320-
insta::assert_snapshot!(stderr, @r#"
321-
Error: No such path: abc~
322-
"#);
323308
}
324309

325310
#[test]

cli/tests/test_log_command.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -857,22 +857,6 @@ fn test_log_filtered_by_path() {
857857
A file2
858858
"###);
859859

860-
// Fileset/pattern syntax can be disabled.
861-
let stderr = test_env.jj_cmd_failure(
862-
test_env.env_root(),
863-
&[
864-
"log",
865-
"--config=ui.allow-filesets=false",
866-
"-R",
867-
repo_path.to_str().unwrap(),
868-
"all()",
869-
],
870-
);
871-
insta::assert_snapshot!(stderr.replace('\\', "/"), @r###"
872-
Error: Path "all()" is not in the repo "repo"
873-
Caused by: Invalid component ".." in repo-relative path "../all()"
874-
"###);
875-
876860
// empty revisions are filtered out by "all()" fileset.
877861
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-Tdescription", "-s", "all()"]);
878862
insta::assert_snapshot!(stdout, @r###"

0 commit comments

Comments
 (0)