help/patterns.txt
changeset 9999 f91e5630ce7e
parent 9998 4a3c388f8c69
child 10000 16f49d671c7f
equal deleted inserted replaced
9998:4a3c388f8c69 9999:f91e5630ce7e
     1 Mercurial accepts several notations for identifying one or more files
       
     2 at a time.
       
     3 
       
     4 By default, Mercurial treats filenames as shell-style extended glob
       
     5 patterns.
       
     6 
       
     7 Alternate pattern notations must be specified explicitly.
       
     8 
       
     9 To use a plain path name without any pattern matching, start it with
       
    10 ``path:``. These path names must completely match starting at the
       
    11 current repository root.
       
    12 
       
    13 To use an extended glob, start a name with ``glob:``. Globs are rooted
       
    14 at the current directory; a glob such as ``*.c`` will only match files
       
    15 in the current directory ending with ``.c``.
       
    16 
       
    17 The supported glob syntax extensions are ``**`` to match any string
       
    18 across path separators and ``{a,b}`` to mean "a or b".
       
    19 
       
    20 To use a Perl/Python regular expression, start a name with ``re:``.
       
    21 Regexp pattern matching is anchored at the root of the repository.
       
    22 
       
    23 Plain examples::
       
    24 
       
    25   path:foo/bar   a name bar in a directory named foo in the root
       
    26                  of the repository
       
    27   path:path:name a file or directory named "path:name"
       
    28 
       
    29 Glob examples::
       
    30 
       
    31   glob:*.c       any name ending in ".c" in the current directory
       
    32   *.c            any name ending in ".c" in the current directory
       
    33   **.c           any name ending in ".c" in any subdirectory of the
       
    34                  current directory including itself.
       
    35   foo/*.c        any name ending in ".c" in the directory foo
       
    36   foo/**.c       any name ending in ".c" in any subdirectory of foo
       
    37                  including itself.
       
    38 
       
    39 Regexp examples::
       
    40 
       
    41   re:.*\.c$      any name ending in ".c", anywhere in the repository