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