Show More
@@ -0,0 +1,65 b'' | |||
|
1 | Mercurial supports a functional language for selecting a set of | |
|
2 | files. | |
|
3 | ||
|
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 | |
|
6 | by infix operators. Parenthesis can be used for grouping. | |
|
7 | ||
|
8 | Identifiers such as filenames or patterns must be quoted with single | |
|
9 | or double quotes if they contain characters outside of | |
|
10 | ``[.*{}[]?/\_a-zA-Z0-9\x80-\xff]`` or if they match one of the | |
|
11 | predefined predicates. This generally applies to file patterns other | |
|
12 | than globs and arguments for predicates. | |
|
13 | ||
|
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 | |
|
16 | interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``. | |
|
17 | ||
|
18 | There is a single prefix operator: | |
|
19 | ||
|
20 | ``not x`` | |
|
21 | Files not in x. Short form is ``! x``. | |
|
22 | ||
|
23 | These are the supported infix operators: | |
|
24 | ||
|
25 | ``x and y`` | |
|
26 | The intersection of files in x and y. Short form is ``x & y``. | |
|
27 | ||
|
28 | ``x or y`` | |
|
29 | The union of files in x and y. There are two alternative short | |
|
30 | forms: ``x | y`` and ``x + y``. | |
|
31 | ||
|
32 | ``x - y`` | |
|
33 | Files in x but not in y. | |
|
34 | ||
|
35 | The following predicates are supported: | |
|
36 | ||
|
37 | .. predicatesmarker | |
|
38 | ||
|
39 | Some sample queries: | |
|
40 | ||
|
41 | - Show status of files that appear to be binary in the working directory:: | |
|
42 | ||
|
43 | hg status -A "set:binary()" | |
|
44 | ||
|
45 | - Forget files that are in .hgignore but are already tracked:: | |
|
46 | ||
|
47 | hg forget "set:hgignore() and not ignored()" | |
|
48 | ||
|
49 | - Find text files that contain a string:: | |
|
50 | ||
|
51 | hg locate "set:grep(magic) and not binary()" | |
|
52 | ||
|
53 | - Find C files in a non-standard encoding:: | |
|
54 | ||
|
55 | hg locate "set:**.c and not encoding(ascii)" | |
|
56 | ||
|
57 | - Revert copies of large binary files:: | |
|
58 | ||
|
59 | hg revert "set:copied() and binary() and size('>1M')" | |
|
60 | ||
|
61 | - Remove files listed in files.lst that contain the letter a or b:: | |
|
62 | ||
|
63 | hg remove "set: 'listfile:foo.lst' and (**a* or **b*)" | |
|
64 | ||
|
65 | See also :hg:`help patterns`. |
@@ -7,7 +7,7 b'' | |||
|
7 | 7 | |
|
8 | 8 | from i18n import gettext, _ |
|
9 | 9 | import sys, os |
|
10 | import extensions, revset, templatekw, templatefilters | |
|
10 | import extensions, revset, fileset, templatekw, templatefilters | |
|
11 | 11 | import util |
|
12 | 12 | |
|
13 | 13 | def listexts(header, exts, indent=1): |
@@ -61,6 +61,7 b' helptable = sorted([' | |||
|
61 | 61 | (['mrevs', 'multirevs'], _('Specifying Multiple Revisions'), |
|
62 | 62 | loaddoc('multirevs')), |
|
63 | 63 | (['revset', 'revsets'], _("Specifying Revision Sets"), loaddoc('revsets')), |
|
64 | (['fileset', 'filesets'], _("Specifying File Sets"), loaddoc('filesets')), | |
|
64 | 65 | (['diffs'], _('Diff Formats'), loaddoc('diffs')), |
|
65 | 66 | (['merge-tools'], _('Merge Tools'), loaddoc('merge-tools')), |
|
66 | 67 | (['templating', 'templates'], _('Template Usage'), |
@@ -102,6 +103,7 b' def addtopicsymbols(topic, marker, symbo' | |||
|
102 | 103 | return makeitemsdoc(topic, doc, marker, symbols) |
|
103 | 104 | addtopichook(topic, add) |
|
104 | 105 | |
|
106 | addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols) | |
|
105 | 107 | addtopicsymbols('revsets', '.. predicatesmarker', revset.symbols) |
|
106 | 108 | addtopicsymbols('templates', '.. keywordsmarker', templatekw.keywords) |
|
107 | 109 | addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters) |
@@ -49,3 +49,5 b' File examples::' | |||
|
49 | 49 | |
|
50 | 50 | listfile:list.txt read list from list.txt with one file pattern per line |
|
51 | 51 | listfile0:list.txt read list from list.txt with null byte delimiters |
|
52 | ||
|
53 | See also :hg:`help filesets`. |
@@ -338,6 +338,7 b' Testing -h/--help:' | |||
|
338 | 338 | diffs Diff Formats |
|
339 | 339 | environment Environment Variables |
|
340 | 340 | extensions Using additional features |
|
341 | filesets Specifying File Sets | |
|
341 | 342 | glossary Glossary |
|
342 | 343 | hgignore syntax for Mercurial ignore files |
|
343 | 344 | hgweb Configuring hgweb |
@@ -418,6 +419,7 b' Testing -h/--help:' | |||
|
418 | 419 | diffs Diff Formats |
|
419 | 420 | environment Environment Variables |
|
420 | 421 | extensions Using additional features |
|
422 | filesets Specifying File Sets | |
|
421 | 423 | glossary Glossary |
|
422 | 424 | hgignore syntax for Mercurial ignore files |
|
423 | 425 | hgweb Configuring hgweb |
@@ -108,6 +108,7 b' Short help:' | |||
|
108 | 108 | diffs Diff Formats |
|
109 | 109 | environment Environment Variables |
|
110 | 110 | extensions Using additional features |
|
111 | filesets Specifying File Sets | |
|
111 | 112 | glossary Glossary |
|
112 | 113 | hgignore syntax for Mercurial ignore files |
|
113 | 114 | hgweb Configuring hgweb |
@@ -182,6 +183,7 b' Short help:' | |||
|
182 | 183 | diffs Diff Formats |
|
183 | 184 | environment Environment Variables |
|
184 | 185 | extensions Using additional features |
|
186 | filesets Specifying File Sets | |
|
185 | 187 | glossary Glossary |
|
186 | 188 | hgignore syntax for Mercurial ignore files |
|
187 | 189 | hgweb Configuring hgweb |
@@ -699,6 +701,7 b' Test that default list of commands omits' | |||
|
699 | 701 | diffs Diff Formats |
|
700 | 702 | environment Environment Variables |
|
701 | 703 | extensions Using additional features |
|
704 | filesets Specifying File Sets | |
|
702 | 705 | glossary Glossary |
|
703 | 706 | hgignore syntax for Mercurial ignore files |
|
704 | 707 | hgweb Configuring hgweb |
General Comments 0
You need to be logged in to leave comments.
Login now