fileset, revset: settle on optionally-quoted pattern syntax

Suppose revsets and filesets are primarily used in command shell, it would be
annoying if quoting is required in addition to the shell quoting. We might also
want to relax the revset parser to allow bare * in glob string.

Closes #2101
This commit is contained in:
Yuya Nishihara 2025-02-17 11:42:37 +09:00
parent dc7216d73a
commit d37a5b1b74
3 changed files with 3 additions and 5 deletions

View file

@ -407,10 +407,10 @@ revsets (expressions) as arguments.
## String patterns
Functions that perform string matching support the following pattern syntax:
Functions that perform string matching support the following pattern syntax (the
quotes are optional):
* `"string"`, or `string` (the quotes are optional), or `substring:"string"`:
Matches strings that contain `string`.
* `"string"` or `substring:"string"`: Matches strings that contain `string`.
* `exact:"string"`: Matches strings exactly equal to `string`.
* `glob:"pattern"`: Matches strings with Unix-style shell [wildcard
`pattern`](https://docs.rs/glob/latest/glob/struct.Pattern.html).

View file

@ -61,7 +61,6 @@ function_arguments = {
| ""
}
// TODO: change rhs to string_literal to require quoting? #2101
string_pattern = {
strict_identifier
~ pattern_kind_op

View file

@ -88,7 +88,6 @@ formal_parameters = {
| ""
}
// TODO: change rhs to string_literal to require quoting? #2101
string_pattern = { strict_identifier ~ pattern_kind_op ~ symbol }
primary = {