Show More
@@ -1,82 +1,83 b'' | |||
|
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 | |
|
11 | 11 | Patterns specified in ``.hgignore`` are not rooted. |
|
12 | 12 | Please see :hg:`help hgignore` for details. |
|
13 | 13 | |
|
14 | 14 | To use a plain path name without any pattern matching, start it with |
|
15 | 15 | ``path:``. These path names must completely match starting at the |
|
16 | 16 | current repository root, and when the path points to a directory, it is matched |
|
17 | 17 | recursively. To match all files in a directory non-recursively (not including |
|
18 | 18 | any files in subdirectories), ``rootfilesin:`` can be used, specifying an |
|
19 | 19 | absolute path (relative to the repository root). |
|
20 | 20 | |
|
21 | 21 | To use an extended glob, start a name with ``glob:``. Globs are rooted |
|
22 | 22 | at the current directory; a glob such as ``*.c`` will only match files |
|
23 | 23 | in the current directory ending with ``.c``. |
|
24 | 24 | |
|
25 | 25 | The supported glob syntax extensions are ``**`` to match any string |
|
26 | 26 | across path separators and ``{a,b}`` to mean "a or b". |
|
27 | 27 | |
|
28 | 28 | To use a Perl/Python regular expression, start a name with ``re:``. |
|
29 | 29 | Regexp pattern matching is anchored at the root of the repository. |
|
30 | 30 | |
|
31 | 31 | To read name patterns from a file, use ``listfile:`` or ``listfile0:``. |
|
32 | 32 | The latter expects null delimited patterns while the former expects line |
|
33 | 33 | feeds. Each string read from the file is itself treated as a file |
|
34 | 34 | pattern. |
|
35 | 35 | |
|
36 | 36 | To read a set of patterns from a file, use ``include:`` or ``subinclude:``. |
|
37 | 37 | ``include:`` will use all the patterns from the given file and treat them as if |
|
38 | 38 | they had been passed in manually. ``subinclude:`` will only apply the patterns |
|
39 | 39 | against files that are under the subinclude file's directory. See :hg:`help |
|
40 | 40 | hgignore` for details on the format of these files. |
|
41 | 41 | |
|
42 | 42 | All patterns, except for ``glob:`` specified in command line (not for |
|
43 | 43 | ``-I`` or ``-X`` options), can match also against directories: files |
|
44 | 44 | under matched directories are treated as matched. |
|
45 | 45 | For ``-I`` and ``-X`` options, ``glob:`` will match directories recursively. |
|
46 | 46 | |
|
47 | 47 | Plain examples:: |
|
48 | 48 | |
|
49 | 49 | path:foo/bar a name bar in a directory named foo in the root |
|
50 | 50 | of the repository |
|
51 | 51 | path:path:name a file or directory named "path:name" |
|
52 | 52 | rootfilesin:foo/bar the files in a directory called foo/bar, but not any files |
|
53 | 53 | in its subdirectories and not a file bar in directory foo |
|
54 | 54 | |
|
55 | 55 | Glob examples:: |
|
56 | 56 | |
|
57 | 57 | glob:*.c any name ending in ".c" in the current directory |
|
58 | 58 | *.c any name ending in ".c" in the current directory |
|
59 | 59 | **.c any name ending in ".c" in any subdirectory of the |
|
60 | 60 | current directory including itself. |
|
61 |
foo/* any file in directory foo |
|
|
61 | foo/* any file in directory foo | |
|
62 | foo/** any file in directory foo plus all its subdirectories, | |
|
62 | 63 | recursively |
|
63 | 64 | foo/*.c any name ending in ".c" in the directory foo |
|
64 | 65 | foo/**.c any name ending in ".c" in any subdirectory of foo |
|
65 | 66 | including itself. |
|
66 | 67 | |
|
67 | 68 | Regexp examples:: |
|
68 | 69 | |
|
69 | 70 | re:.*\.c$ any name ending in ".c", anywhere in the repository |
|
70 | 71 | |
|
71 | 72 | File examples:: |
|
72 | 73 | |
|
73 | 74 | listfile:list.txt read list from list.txt with one file pattern per line |
|
74 | 75 | listfile0:list.txt read list from list.txt with null byte delimiters |
|
75 | 76 | |
|
76 | 77 | See also :hg:`help filesets`. |
|
77 | 78 | |
|
78 | 79 | Include examples:: |
|
79 | 80 | |
|
80 | 81 | include:path/to/mypatternfile reads patterns to be applied to all paths |
|
81 | 82 | subinclude:path/to/subignorefile reads patterns specifically for paths in the |
|
82 | 83 | subdirectory |
General Comments 0
You need to be logged in to leave comments.
Login now