mercurial/help/filesets.txt
author Matt Harbison <matt_harbison@yahoo.com>
Fri, 09 Jun 2017 22:15:53 -0400
changeset 32782 9a4adc76c88a
parent 31286 f8df87018ae9
child 35741 73432eee0ac4
permissions -rw-r--r--
setup: avoid linker warnings on Windows about multiple export specifications The PyMODINIT_FUNC macro contains __declspec(dllexport), and then the build process adds an "/EXPORT func" to the command line. The 64-bit linker flags this [1]. Everything except zstd.c and bser.c are covered by redefining the macro in util.h [2]. These modules aren't built with util.h in the #include path, so the redefining hack would have to be open coded two more times. After seeing that extra_linker_flags didn't work, I couldn't find anything authoritative indicating why, though I did see an offhand comment on SO that CFLAGS is also ignored on Windows. I also don't fully understand the interaction between msvccompiler and msvc9compiler- I first subclassed the latter, but it isn't used when building with VS2008. I know the camelcase naming isn't the standard, but the HackedMingw32CCompiler class above it was introduced 5 years ago (and I think the current style was in place by then), so I assume that there's some reason for it. [1] https://support.microsoft.com/en-us/help/835326/you-receive-an-lnk4197-error-in-the-64-bit-version-of-the-visual-c-compiler [2] https://bugs.python.org/issue9709#msg120859
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14686
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     1
Mercurial supports a functional language for selecting a set of
18960
170fc0949fb6 check-code: check txt files for trailing whitespace
Mads Kiilerich <madski@unity3d.com>
parents: 15825
diff changeset
     2
files.
14686
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     3
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     4
Like other file patterns, this pattern type is indicated by a prefix,
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     5
'set:'. The language supports a number of predicates which are joined
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     6
by infix operators. Parenthesis can be used for grouping.
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     7
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     8
Identifiers such as filenames or patterns must be quoted with single
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     9
or double quotes if they contain characters outside of
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    10
``[.*{}[]?/\_a-zA-Z0-9\x80-\xff]`` or if they match one of the
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    11
predefined predicates. This generally applies to file patterns other
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    12
than globs and arguments for predicates.
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    13
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    14
Special characters can be used in quoted identifiers by escaping them,
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    15
e.g., ``\n`` is interpreted as a newline. To prevent them from being
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    16
interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``.
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    17
30729
a4bc8fff67fc help: apply the section headings from revsets to filesets
Matt Harbison <matt_harbison@yahoo.com>
parents: 23109
diff changeset
    18
See also :hg:`help patterns`.
a4bc8fff67fc help: apply the section headings from revsets to filesets
Matt Harbison <matt_harbison@yahoo.com>
parents: 23109
diff changeset
    19
30731
b8a188a6f191 help: merge the various operator sections of revsets, filesets and templates
Matt Harbison <matt_harbison@yahoo.com>
parents: 30729
diff changeset
    20
Operators
b8a188a6f191 help: merge the various operator sections of revsets, filesets and templates
Matt Harbison <matt_harbison@yahoo.com>
parents: 30729
diff changeset
    21
=========
30729
a4bc8fff67fc help: apply the section headings from revsets to filesets
Matt Harbison <matt_harbison@yahoo.com>
parents: 23109
diff changeset
    22
14686
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    23
There is a single prefix operator:
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    24
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    25
``not x``
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    26
  Files not in x. Short form is ``! x``.
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    27
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    28
These are the supported infix operators:
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    29
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    30
``x and y``
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    31
  The intersection of files in x and y. Short form is ``x & y``.
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    32
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    33
``x or y``
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    34
  The union of files in x and y. There are two alternative short
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    35
  forms: ``x | y`` and ``x + y``.
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    36
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    37
``x - y``
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    38
  Files in x but not in y.
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    39
30729
a4bc8fff67fc help: apply the section headings from revsets to filesets
Matt Harbison <matt_harbison@yahoo.com>
parents: 23109
diff changeset
    40
Predicates
a4bc8fff67fc help: apply the section headings from revsets to filesets
Matt Harbison <matt_harbison@yahoo.com>
parents: 23109
diff changeset
    41
==========
a4bc8fff67fc help: apply the section headings from revsets to filesets
Matt Harbison <matt_harbison@yahoo.com>
parents: 23109
diff changeset
    42
14686
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    43
The following predicates are supported:
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    44
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    45
.. predicatesmarker
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    46
30729
a4bc8fff67fc help: apply the section headings from revsets to filesets
Matt Harbison <matt_harbison@yahoo.com>
parents: 23109
diff changeset
    47
Examples
a4bc8fff67fc help: apply the section headings from revsets to filesets
Matt Harbison <matt_harbison@yahoo.com>
parents: 23109
diff changeset
    48
========
a4bc8fff67fc help: apply the section headings from revsets to filesets
Matt Harbison <matt_harbison@yahoo.com>
parents: 23109
diff changeset
    49
14686
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    50
Some sample queries:
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    51
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    52
- Show status of files that appear to be binary in the working directory::
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    53
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    54
    hg status -A "set:binary()"
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    55
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    56
- Forget files that are in .hgignore but are already tracked::
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    57
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    58
    hg forget "set:hgignore() and not ignored()"
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    59
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    60
- Find text files that contain a string::
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    61
23109
cf56f7a60b45 help: use "hg files" instead of "hg locate" in "hg help filesets"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18960
diff changeset
    62
    hg files "set:grep(magic) and not binary()"
14686
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    63
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    64
- Find C files in a non-standard encoding::
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    65
23109
cf56f7a60b45 help: use "hg files" instead of "hg locate" in "hg help filesets"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18960
diff changeset
    66
    hg files "set:**.c and not encoding('UTF-8')"
14686
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    67
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    68
- Revert copies of large binary files::
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    69
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    70
    hg revert "set:copied() and binary() and size('>1M')"
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    71
31193
4140d49d2efb fileset: add revs(revs, fileset) to evaluate set in working directory
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30731
diff changeset
    72
- Revert files that were added to the working directory::
4140d49d2efb fileset: add revs(revs, fileset) to evaluate set in working directory
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30731
diff changeset
    73
31286
f8df87018ae9 help: fix example of revs() fileset
Yuya Nishihara <yuya@tcha.org>
parents: 31193
diff changeset
    74
    hg revert "set:revs('wdir()', added())"
31193
4140d49d2efb fileset: add revs(revs, fileset) to evaluate set in working directory
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30731
diff changeset
    75
14829
968c301a1005 help: fileset foo.lst was named files.lst
Arne Babenhauserheide <bab@draketo.de>
parents: 14686
diff changeset
    76
- Remove files listed in foo.lst that contain the letter a or b::
14686
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    77
6ab8b17adc03 fileset: add a help topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    78
    hg remove "set: 'listfile:foo.lst' and (**a* or **b*)"