##// END OF EJS Templates
help: apply the section headings from revsets to filesets...
Matt Harbison -
r30729:a4bc8fff default
parent child Browse files
Show More
@@ -1,65 +1,77 b''
1 Mercurial supports a functional language for selecting a set of
1 Mercurial supports a functional language for selecting a set of
2 files.
2 files.
3
3
4 Like other file patterns, this pattern type is indicated by a prefix,
4 Like other file patterns, this pattern type is indicated by a prefix,
5 'set:'. The language supports a number of predicates which are joined
5 'set:'. The language supports a number of predicates which are joined
6 by infix operators. Parenthesis can be used for grouping.
6 by infix operators. Parenthesis can be used for grouping.
7
7
8 Identifiers such as filenames or patterns must be quoted with single
8 Identifiers such as filenames or patterns must be quoted with single
9 or double quotes if they contain characters outside of
9 or double quotes if they contain characters outside of
10 ``[.*{}[]?/\_a-zA-Z0-9\x80-\xff]`` or if they match one of the
10 ``[.*{}[]?/\_a-zA-Z0-9\x80-\xff]`` or if they match one of the
11 predefined predicates. This generally applies to file patterns other
11 predefined predicates. This generally applies to file patterns other
12 than globs and arguments for predicates.
12 than globs and arguments for predicates.
13
13
14 Special characters can be used in quoted identifiers by escaping them,
14 Special characters can be used in quoted identifiers by escaping them,
15 e.g., ``\n`` is interpreted as a newline. To prevent them from being
15 e.g., ``\n`` is interpreted as a newline. To prevent them from being
16 interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``.
16 interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``.
17
17
18 See also :hg:`help patterns`.
19
20 Prefix
21 ======
22
18 There is a single prefix operator:
23 There is a single prefix operator:
19
24
20 ``not x``
25 ``not x``
21 Files not in x. Short form is ``! x``.
26 Files not in x. Short form is ``! x``.
22
27
28 Infix
29 =====
30
23 These are the supported infix operators:
31 These are the supported infix operators:
24
32
25 ``x and y``
33 ``x and y``
26 The intersection of files in x and y. Short form is ``x & y``.
34 The intersection of files in x and y. Short form is ``x & y``.
27
35
28 ``x or y``
36 ``x or y``
29 The union of files in x and y. There are two alternative short
37 The union of files in x and y. There are two alternative short
30 forms: ``x | y`` and ``x + y``.
38 forms: ``x | y`` and ``x + y``.
31
39
32 ``x - y``
40 ``x - y``
33 Files in x but not in y.
41 Files in x but not in y.
34
42
43 Predicates
44 ==========
45
35 The following predicates are supported:
46 The following predicates are supported:
36
47
37 .. predicatesmarker
48 .. predicatesmarker
38
49
50 Examples
51 ========
52
39 Some sample queries:
53 Some sample queries:
40
54
41 - Show status of files that appear to be binary in the working directory::
55 - Show status of files that appear to be binary in the working directory::
42
56
43 hg status -A "set:binary()"
57 hg status -A "set:binary()"
44
58
45 - Forget files that are in .hgignore but are already tracked::
59 - Forget files that are in .hgignore but are already tracked::
46
60
47 hg forget "set:hgignore() and not ignored()"
61 hg forget "set:hgignore() and not ignored()"
48
62
49 - Find text files that contain a string::
63 - Find text files that contain a string::
50
64
51 hg files "set:grep(magic) and not binary()"
65 hg files "set:grep(magic) and not binary()"
52
66
53 - Find C files in a non-standard encoding::
67 - Find C files in a non-standard encoding::
54
68
55 hg files "set:**.c and not encoding('UTF-8')"
69 hg files "set:**.c and not encoding('UTF-8')"
56
70
57 - Revert copies of large binary files::
71 - Revert copies of large binary files::
58
72
59 hg revert "set:copied() and binary() and size('>1M')"
73 hg revert "set:copied() and binary() and size('>1M')"
60
74
61 - Remove files listed in foo.lst that contain the letter a or b::
75 - Remove files listed in foo.lst that contain the letter a or b::
62
76
63 hg remove "set: 'listfile:foo.lst' and (**a* or **b*)"
77 hg remove "set: 'listfile:foo.lst' and (**a* or **b*)"
64
65 See also :hg:`help patterns`.
General Comments 0
You need to be logged in to leave comments. Login now