mercurial/help/patterns.txt
author Siddharth Agarwal <sid0@fb.com>
Thu, 28 Mar 2013 18:27:19 -0700
changeset 18853 78d760aa3607
parent 16510 c7c9473fcc46
child 18960 170fc0949fb6
permissions -rw-r--r--
duplicatecopies: do not mark items not in the dirstate as copies Consider the following repo: 0 -- 1 (renames a to b) \ - 2 If we're rebasing 2 onto 1, then duplicatecopies is called with arguments (2, 1). copies.pathcopies goes backwards from 1 to 0 and returns the pair dst = a, src = b. Of course, since we're working on top of 2, at this point a doesn't exist in the dirstate. Extra entries in the copymap are currently harmless because the copymap is only queried for items in the dirstate map. However, if the dirstate.copy method becomes one of the sources used to determine which files have changed, this will prove problematic. Note that we can't avoid going backwards in general -- consider this repo: 0 -- 1 (renames a to b) \ - 2 (renames a to c) Rebasing 2 onto 1 should produce a rename from b to c.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
     1
Mercurial accepts several notations for identifying one or more files
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
     2
at a time.
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     3
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
     4
By default, Mercurial treats filenames as shell-style extended glob
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
     5
patterns.
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     6
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
     7
Alternate pattern notations must be specified explicitly.
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     8
16504
e3c7ca15cde2 doc: add note about pattern rooted/unrooted cases to "hgignore" and "patterns"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 14686
diff changeset
     9
.. note::
16510
c7c9473fcc46 docs: don't use :hg: at the beginning of lines in notes (issue3397)
Mads Kiilerich <mads@kiilerich.com>
parents: 16504
diff changeset
    10
  Patterns specified in ``.hgignore`` are not rooted. 
c7c9473fcc46 docs: don't use :hg: at the beginning of lines in notes (issue3397)
Mads Kiilerich <mads@kiilerich.com>
parents: 16504
diff changeset
    11
  Please see :hg:`help hgignore` for details.
16504
e3c7ca15cde2 doc: add note about pattern rooted/unrooted cases to "hgignore" and "patterns"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 14686
diff changeset
    12
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    13
To use a plain path name without any pattern matching, start it with
9624
585d2ffe969b doc, help: stream-line use of inline-literals
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    14
``path:``. These path names must completely match starting at the
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    15
current repository root.
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    16
9624
585d2ffe969b doc, help: stream-line use of inline-literals
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    17
To use an extended glob, start a name with ``glob:``. Globs are rooted
585d2ffe969b doc, help: stream-line use of inline-literals
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    18
at the current directory; a glob such as ``*.c`` will only match files
585d2ffe969b doc, help: stream-line use of inline-literals
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    19
in the current directory ending with ``.c``.
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    20
9624
585d2ffe969b doc, help: stream-line use of inline-literals
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    21
The supported glob syntax extensions are ``**`` to match any string
585d2ffe969b doc, help: stream-line use of inline-literals
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    22
across path separators and ``{a,b}`` to mean "a or b".
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    23
9624
585d2ffe969b doc, help: stream-line use of inline-literals
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    24
To use a Perl/Python regular expression, start a name with ``re:``.
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    25
Regexp pattern matching is anchored at the root of the repository.
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    26
13218
1f4721de2ca9 match: support reading pattern lists from files
Steve Borho <steve@borho.org>
parents: 9999
diff changeset
    27
To read name patterns from a file, use ``listfile:`` or ``listfile0:``.
1f4721de2ca9 match: support reading pattern lists from files
Steve Borho <steve@borho.org>
parents: 9999
diff changeset
    28
The latter expects null delimited patterns while the former expects line
1f4721de2ca9 match: support reading pattern lists from files
Steve Borho <steve@borho.org>
parents: 9999
diff changeset
    29
feeds. Each string read from the file is itself treated as a file
1f4721de2ca9 match: support reading pattern lists from files
Steve Borho <steve@borho.org>
parents: 9999
diff changeset
    30
pattern.
1f4721de2ca9 match: support reading pattern lists from files
Steve Borho <steve@borho.org>
parents: 9999
diff changeset
    31
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    32
Plain examples::
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    33
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    34
  path:foo/bar   a name bar in a directory named foo in the root
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    35
                 of the repository
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    36
  path:path:name a file or directory named "path:name"
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    37
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    38
Glob examples::
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    39
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    40
  glob:*.c       any name ending in ".c" in the current directory
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    41
  *.c            any name ending in ".c" in the current directory
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    42
  **.c           any name ending in ".c" in any subdirectory of the
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    43
                 current directory including itself.
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    44
  foo/*.c        any name ending in ".c" in the directory foo
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    45
  foo/**.c       any name ending in ".c" in any subdirectory of foo
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    46
                 including itself.
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    47
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    48
Regexp examples::
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    49
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
    50
  re:.*\.c$      any name ending in ".c", anywhere in the repository
13218
1f4721de2ca9 match: support reading pattern lists from files
Steve Borho <steve@borho.org>
parents: 9999
diff changeset
    51
1f4721de2ca9 match: support reading pattern lists from files
Steve Borho <steve@borho.org>
parents: 9999
diff changeset
    52
File examples::
1f4721de2ca9 match: support reading pattern lists from files
Steve Borho <steve@borho.org>
parents: 9999
diff changeset
    53
1f4721de2ca9 match: support reading pattern lists from files
Steve Borho <steve@borho.org>
parents: 9999
diff changeset
    54
  listfile:list.txt  read list from list.txt with one file pattern per line
1f4721de2ca9 match: support reading pattern lists from files
Steve Borho <steve@borho.org>
parents: 9999
diff changeset
    55
  listfile0:list.txt read list from list.txt with null byte delimiters
14686
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents: 13218
diff changeset
    56
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents: 13218
diff changeset
    57
See also :hg:`help filesets`.