Mercurial > hg
comparison mercurial/helptext/hgignore.txt @ 43632:2e017696181f
help: create packages for the help text
These files need to be loaded as resources with PyOxidizer, instead of using
filesystem representations. AFAICT, the resource loading mechanisms only work
for the named package given to it, and can't reach into a subdirectory.
While here, the `help` directory is renamed to `helptext`. Without this, trying
to load external help text crashed in mercurial/help.py when importing `.i18n`,
saying there's no `mercurial.help.i18n` module.
Differential Revision: https://phab.mercurial-scm.org/D7376
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 13 Nov 2019 21:52:25 -0500 |
parents | mercurial/help/hgignore.txt@4fab8a7d2d72 |
children | b77d5b568496 |
comparison
equal
deleted
inserted
replaced
43631:d3c4368099ed | 43632:2e017696181f |
---|---|
1 Synopsis | |
2 ======== | |
3 | |
4 The Mercurial system uses a file called ``.hgignore`` in the root | |
5 directory of a repository to control its behavior when it searches | |
6 for files that it is not currently tracking. | |
7 | |
8 Description | |
9 =========== | |
10 | |
11 The working directory of a Mercurial repository will often contain | |
12 files that should not be tracked by Mercurial. These include backup | |
13 files created by editors and build products created by compilers. | |
14 These files can be ignored by listing them in a ``.hgignore`` file in | |
15 the root of the working directory. The ``.hgignore`` file must be | |
16 created manually. It is typically put under version control, so that | |
17 the settings will propagate to other repositories with push and pull. | |
18 | |
19 An untracked file is ignored if its path relative to the repository | |
20 root directory, or any prefix path of that path, is matched against | |
21 any pattern in ``.hgignore``. | |
22 | |
23 For example, say we have an untracked file, ``file.c``, at | |
24 ``a/b/file.c`` inside our repository. Mercurial will ignore ``file.c`` | |
25 if any pattern in ``.hgignore`` matches ``a/b/file.c``, ``a/b`` or ``a``. | |
26 | |
27 In addition, a Mercurial configuration file can reference a set of | |
28 per-user or global ignore files. See the ``ignore`` configuration | |
29 key on the ``[ui]`` section of :hg:`help config` for details of how to | |
30 configure these files. | |
31 | |
32 To control Mercurial's handling of files that it manages, many | |
33 commands support the ``-I`` and ``-X`` options; see | |
34 :hg:`help <command>` and :hg:`help patterns` for details. | |
35 | |
36 Files that are already tracked are not affected by .hgignore, even | |
37 if they appear in .hgignore. An untracked file X can be explicitly | |
38 added with :hg:`add X`, even if X would be excluded by a pattern | |
39 in .hgignore. | |
40 | |
41 Syntax | |
42 ====== | |
43 | |
44 An ignore file is a plain text file consisting of a list of patterns, | |
45 with one pattern per line. Empty lines are skipped. The ``#`` | |
46 character is treated as a comment character, and the ``\`` character | |
47 is treated as an escape character. | |
48 | |
49 Mercurial supports several pattern syntaxes. The default syntax used | |
50 is Python/Perl-style regular expressions. | |
51 | |
52 To change the syntax used, use a line of the following form:: | |
53 | |
54 syntax: NAME | |
55 | |
56 where ``NAME`` is one of the following: | |
57 | |
58 ``regexp`` | |
59 Regular expression, Python/Perl syntax. | |
60 ``glob`` | |
61 Shell-style glob. | |
62 ``rootglob`` | |
63 A variant of ``glob`` that is rooted (see below). | |
64 | |
65 The chosen syntax stays in effect when parsing all patterns that | |
66 follow, until another syntax is selected. | |
67 | |
68 Neither ``glob`` nor regexp patterns are rooted. A glob-syntax | |
69 pattern of the form ``*.c`` will match a file ending in ``.c`` in any | |
70 directory, and a regexp pattern of the form ``\.c$`` will do the | |
71 same. To root a regexp pattern, start it with ``^``. To get the same | |
72 effect with glob-syntax, you have to use ``rootglob``. | |
73 | |
74 Subdirectories can have their own .hgignore settings by adding | |
75 ``subinclude:path/to/subdir/.hgignore`` to the root ``.hgignore``. See | |
76 :hg:`help patterns` for details on ``subinclude:`` and ``include:``. | |
77 | |
78 .. note:: | |
79 | |
80 Patterns specified in other than ``.hgignore`` are always rooted. | |
81 Please see :hg:`help patterns` for details. | |
82 | |
83 Example | |
84 ======= | |
85 | |
86 Here is an example ignore file. :: | |
87 | |
88 # use glob syntax. | |
89 syntax: glob | |
90 | |
91 *.elc | |
92 *.pyc | |
93 *~ | |
94 | |
95 # switch to regexp syntax. | |
96 syntax: regexp | |
97 ^\.pc/ |