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