Show More
@@ -1,57 +1,62 | |||
|
1 | 1 | Mercurial accepts several notations for identifying one or more files |
|
2 | 2 | at a time. |
|
3 | 3 | |
|
4 | 4 | By default, Mercurial treats filenames as shell-style extended glob |
|
5 | 5 | patterns. |
|
6 | 6 | |
|
7 | 7 | Alternate pattern notations must be specified explicitly. |
|
8 | 8 | |
|
9 | 9 | .. note:: |
|
10 | 10 | Patterns specified in ``.hgignore`` are not rooted. |
|
11 | 11 | Please see :hg:`help hgignore` for details. |
|
12 | 12 | |
|
13 | 13 | To use a plain path name without any pattern matching, start it with |
|
14 | 14 | ``path:``. These path names must completely match starting at the |
|
15 | 15 | current repository root. |
|
16 | 16 | |
|
17 | 17 | To use an extended glob, start a name with ``glob:``. Globs are rooted |
|
18 | 18 | at the current directory; a glob such as ``*.c`` will only match files |
|
19 | 19 | in the current directory ending with ``.c``. |
|
20 | 20 | |
|
21 | 21 | The supported glob syntax extensions are ``**`` to match any string |
|
22 | 22 | across path separators and ``{a,b}`` to mean "a or b". |
|
23 | 23 | |
|
24 | 24 | To use a Perl/Python regular expression, start a name with ``re:``. |
|
25 | 25 | Regexp pattern matching is anchored at the root of the repository. |
|
26 | 26 | |
|
27 | 27 | To read name patterns from a file, use ``listfile:`` or ``listfile0:``. |
|
28 | 28 | The latter expects null delimited patterns while the former expects line |
|
29 | 29 | feeds. Each string read from the file is itself treated as a file |
|
30 | 30 | pattern. |
|
31 | 31 | |
|
32 | All patterns, except for ``glob:`` specified in command line (not for | |
|
33 | ``-I`` or ``-X`` options) or ``.hgignore`` file, can match also | |
|
34 | against directories: files under matched directories are treated as | |
|
35 | matched. | |
|
36 | ||
|
32 | 37 | Plain examples:: |
|
33 | 38 | |
|
34 | 39 | path:foo/bar a name bar in a directory named foo in the root |
|
35 | 40 | of the repository |
|
36 | 41 | path:path:name a file or directory named "path:name" |
|
37 | 42 | |
|
38 | 43 | Glob examples:: |
|
39 | 44 | |
|
40 | 45 | glob:*.c any name ending in ".c" in the current directory |
|
41 | 46 | *.c any name ending in ".c" in the current directory |
|
42 | 47 | **.c any name ending in ".c" in any subdirectory of the |
|
43 | 48 | current directory including itself. |
|
44 | 49 | foo/*.c any name ending in ".c" in the directory foo |
|
45 | 50 | foo/**.c any name ending in ".c" in any subdirectory of foo |
|
46 | 51 | including itself. |
|
47 | 52 | |
|
48 | 53 | Regexp examples:: |
|
49 | 54 | |
|
50 | 55 | re:.*\.c$ any name ending in ".c", anywhere in the repository |
|
51 | 56 | |
|
52 | 57 | File examples:: |
|
53 | 58 | |
|
54 | 59 | listfile:list.txt read list from list.txt with one file pattern per line |
|
55 | 60 | listfile0:list.txt read list from list.txt with null byte delimiters |
|
56 | 61 | |
|
57 | 62 | See also :hg:`help filesets`. |
General Comments 0
You need to be logged in to leave comments.
Login now