Mercurial > public > mercurial-scm > hg
diff mercurial/help/filesets.txt @ 35741:73432eee0ac4
fileset: add kind:pat operator
":" isn't taken as a symbol character but an infix operator so we can write
e.g. "path:'foo bar'" as well as "'path:foo bar'". An invalid pattern kind
is rejected in the former form as we know a kind is specified explicitly.
The binding strength is copied from "x:y" range operator of revset. Perhaps
it can be adjusted later if we want to parse "foo:bar()" as "(foo:bar)()",
not "foo:(bar())". We can also add "kind:" postfix operator if we want.
One possible confusion is that the scope of the leading "set:" vs "kind:pat"
operator. The former is consumed by a matcher so applies to the whole fileset
expression:
$ hg files 'set:foo() or kind:bar or baz'
^^^^^^^^^^^^^^^^^^^^^^^^
Whereas the scope of kind:pat operator is narrow:
$ hg files 'set:foo() or kind:bar or baz'
^^^
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 14 Jan 2018 13:29:15 +0900 |
parents | f8df87018ae9 |
children |
line wrap: on
line diff
--- a/mercurial/help/filesets.txt Sun Jan 14 13:33:56 2018 +0900 +++ b/mercurial/help/filesets.txt Sun Jan 14 13:29:15 2018 +0900 @@ -9,7 +9,8 @@ or double quotes if they contain characters outside of ``[.*{}[]?/\_a-zA-Z0-9\x80-\xff]`` or if they match one of the predefined predicates. This generally applies to file patterns other -than globs and arguments for predicates. +than globs and arguments for predicates. Pattern prefixes such as +``path:`` may be specified without quoting. Special characters can be used in quoted identifiers by escaping them, e.g., ``\n`` is interpreted as a newline. To prevent them from being @@ -75,4 +76,4 @@ - Remove files listed in foo.lst that contain the letter a or b:: - hg remove "set: 'listfile:foo.lst' and (**a* or **b*)" + hg remove "set: listfile:foo.lst and (**a* or **b*)"