##// END OF EJS Templates
help/config: separate terms with a blank line...
Martin Geisler -
r14458:c62b3b74 default
parent child Browse files
Show More
@@ -1,1215 +1,1325 b''
1 Mercurial reads configuration data from several files, if they exist.
1 Mercurial reads configuration data from several files, if they exist.
2 Below we list the most specific file first.
2 Below we list the most specific file first.
3
3
4 On Windows, these configuration files are read:
4 On Windows, these configuration files are read:
5
5
6 - ``<repo>\.hg\hgrc``
6 - ``<repo>\.hg\hgrc``
7 - ``%USERPROFILE%\.hgrc``
7 - ``%USERPROFILE%\.hgrc``
8 - ``%USERPROFILE%\mercurial.ini``
8 - ``%USERPROFILE%\mercurial.ini``
9 - ``%HOME%\.hgrc``
9 - ``%HOME%\.hgrc``
10 - ``%HOME%\mercurial.ini``
10 - ``%HOME%\mercurial.ini``
11 - ``C:\mercurial\mercurial.ini`` (unless regkey or hgrc.d\ or mercurial.ini found)
11 - ``C:\mercurial\mercurial.ini`` (unless regkey or hgrc.d\ or mercurial.ini found)
12 - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (unless hgrc.d\ or mercurial.ini found)
12 - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (unless hgrc.d\ or mercurial.ini found)
13 - ``<hg.exe-dir>\hgrc.d\*.rc`` (unless mercurial.ini found)
13 - ``<hg.exe-dir>\hgrc.d\*.rc`` (unless mercurial.ini found)
14 - ``<hg.exe-dir>\mercurial.ini``
14 - ``<hg.exe-dir>\mercurial.ini``
15
15
16 On Unix, these files are read:
16 On Unix, these files are read:
17
17
18 - ``<repo>/.hg/hgrc``
18 - ``<repo>/.hg/hgrc``
19 - ``$HOME/.hgrc``
19 - ``$HOME/.hgrc``
20 - ``/etc/mercurial/hgrc``
20 - ``/etc/mercurial/hgrc``
21 - ``/etc/mercurial/hgrc.d/*.rc``
21 - ``/etc/mercurial/hgrc.d/*.rc``
22 - ``<install-root>/etc/mercurial/hgrc``
22 - ``<install-root>/etc/mercurial/hgrc``
23 - ``<install-root>/etc/mercurial/hgrc.d/*.rc``
23 - ``<install-root>/etc/mercurial/hgrc.d/*.rc``
24
24
25 These files do not exist by default and you will have to create the
25 These files do not exist by default and you will have to create the
26 appropriate configuration files yourself: global configuration like
26 appropriate configuration files yourself: global configuration like
27 the username setting is typically put into
27 the username setting is typically put into
28 ``%USERPROFILE%\mercurial.ini`` or ``$HOME/.hgrc`` and local
28 ``%USERPROFILE%\mercurial.ini`` or ``$HOME/.hgrc`` and local
29 configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
29 configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
30
30
31 If there is a per-repository configuration file which is not owned by
31 If there is a per-repository configuration file which is not owned by
32 the active user, Mercurial will warn you that the file is skipped::
32 the active user, Mercurial will warn you that the file is skipped::
33
33
34 not trusting file <repo>/.hg/hgrc from untrusted user USER, group GROUP
34 not trusting file <repo>/.hg/hgrc from untrusted user USER, group GROUP
35
35
36 If this bothers you, the warning can be silenced (the file would still
36 If this bothers you, the warning can be silenced (the file would still
37 be ignored) or trust can be established. Use one of the following
37 be ignored) or trust can be established. Use one of the following
38 settings, the syntax is explained below:
38 settings, the syntax is explained below:
39
39
40 - ``ui.report_untrusted = False``
40 - ``ui.report_untrusted = False``
41 - ``trusted.users = USER``
41 - ``trusted.users = USER``
42 - ``trusted.groups = GROUP``
42 - ``trusted.groups = GROUP``
43
43
44 The configuration files for Mercurial use a simple ini-file format. A
44 The configuration files for Mercurial use a simple ini-file format. A
45 configuration file consists of sections, led by a ``[section]`` header
45 configuration file consists of sections, led by a ``[section]`` header
46 and followed by ``name = value`` entries::
46 and followed by ``name = value`` entries::
47
47
48 [ui]
48 [ui]
49 username = Firstname Lastname <firstname.lastname@example.net>
49 username = Firstname Lastname <firstname.lastname@example.net>
50 verbose = True
50 verbose = True
51
51
52 The above entries will be referred to as ``ui.username`` and
52 The above entries will be referred to as ``ui.username`` and
53 ``ui.verbose``, respectively. Please see the hgrc man page for a full
53 ``ui.verbose``, respectively. Please see the hgrc man page for a full
54 description of the possible configuration values:
54 description of the possible configuration values:
55
55
56 - on Unix-like systems: ``man hgrc``
56 - on Unix-like systems: ``man hgrc``
57 - online: http://www.selenic.com/mercurial/hgrc.5.html
57 - online: http://www.selenic.com/mercurial/hgrc.5.html
58
58
59 Files
59 Files
60 -----
60 -----
61
61
62 Mercurial reads configuration data from several files, if they exist.
62 Mercurial reads configuration data from several files, if they exist.
63 The names of these files depend on the system on which Mercurial is
63 The names of these files depend on the system on which Mercurial is
64 installed. ``*.rc`` files from a single directory are read in
64 installed. ``*.rc`` files from a single directory are read in
65 alphabetical order, later ones overriding earlier ones. Where multiple
65 alphabetical order, later ones overriding earlier ones. Where multiple
66 paths are given below, settings from earlier paths override later
66 paths are given below, settings from earlier paths override later
67 ones.
67 ones.
68
68
69 | (Unix, Windows) ``<repo>/.hg/hgrc``
69 | (Unix, Windows) ``<repo>/.hg/hgrc``
70
70
71 Per-repository configuration options that only apply in a
71 Per-repository configuration options that only apply in a
72 particular repository. This file is not version-controlled, and
72 particular repository. This file is not version-controlled, and
73 will not get transferred during a "clone" operation. Options in
73 will not get transferred during a "clone" operation. Options in
74 this file override options in all other configuration files. On
74 this file override options in all other configuration files. On
75 Unix, most of this file will be ignored if it doesn't belong to a
75 Unix, most of this file will be ignored if it doesn't belong to a
76 trusted user or to a trusted group. See the documentation for the
76 trusted user or to a trusted group. See the documentation for the
77 trusted_ section below for more details.
77 trusted_ section below for more details.
78
78
79 | (Unix) ``$HOME/.hgrc``
79 | (Unix) ``$HOME/.hgrc``
80 | (Windows) ``%USERPROFILE%\.hgrc``
80 | (Windows) ``%USERPROFILE%\.hgrc``
81 | (Windows) ``%USERPROFILE%\Mercurial.ini``
81 | (Windows) ``%USERPROFILE%\Mercurial.ini``
82 | (Windows) ``%HOME%\.hgrc``
82 | (Windows) ``%HOME%\.hgrc``
83 | (Windows) ``%HOME%\Mercurial.ini``
83 | (Windows) ``%HOME%\Mercurial.ini``
84
84
85 Per-user configuration file(s), for the user running Mercurial. On
85 Per-user configuration file(s), for the user running Mercurial. On
86 Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``. Options in these
86 Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``. Options in these
87 files apply to all Mercurial commands executed by this user in any
87 files apply to all Mercurial commands executed by this user in any
88 directory. Options in these files override per-system and per-installation
88 directory. Options in these files override per-system and per-installation
89 options.
89 options.
90
90
91 | (Unix) ``/etc/mercurial/hgrc``
91 | (Unix) ``/etc/mercurial/hgrc``
92 | (Unix) ``/etc/mercurial/hgrc.d/*.rc``
92 | (Unix) ``/etc/mercurial/hgrc.d/*.rc``
93
93
94 Per-system configuration files, for the system on which Mercurial
94 Per-system configuration files, for the system on which Mercurial
95 is running. Options in these files apply to all Mercurial commands
95 is running. Options in these files apply to all Mercurial commands
96 executed by any user in any directory. Options in these files
96 executed by any user in any directory. Options in these files
97 override per-installation options.
97 override per-installation options.
98
98
99 | (Unix) ``<install-root>/etc/mercurial/hgrc``
99 | (Unix) ``<install-root>/etc/mercurial/hgrc``
100 | (Unix) ``<install-root>/etc/mercurial/hgrc.d/*.rc``
100 | (Unix) ``<install-root>/etc/mercurial/hgrc.d/*.rc``
101
101
102 Per-installation configuration files, searched for in the
102 Per-installation configuration files, searched for in the
103 directory where Mercurial is installed. ``<install-root>`` is the
103 directory where Mercurial is installed. ``<install-root>`` is the
104 parent directory of the **hg** executable (or symlink) being run. For
104 parent directory of the **hg** executable (or symlink) being run. For
105 example, if installed in ``/shared/tools/bin/hg``, Mercurial will look
105 example, if installed in ``/shared/tools/bin/hg``, Mercurial will look
106 in ``/shared/tools/etc/mercurial/hgrc``. Options in these files apply
106 in ``/shared/tools/etc/mercurial/hgrc``. Options in these files apply
107 to all Mercurial commands executed by any user in any directory.
107 to all Mercurial commands executed by any user in any directory.
108
108
109 | (Windows) ``<install-dir>\Mercurial.ini``
109 | (Windows) ``<install-dir>\Mercurial.ini``
110 | (Windows) ``<install-dir>\hgrc.d\*.rc``
110 | (Windows) ``<install-dir>\hgrc.d\*.rc``
111 | (Windows) ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial``
111 | (Windows) ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial``
112
112
113 Per-installation/system configuration files, for the system on
113 Per-installation/system configuration files, for the system on
114 which Mercurial is running. Options in these files apply to all
114 which Mercurial is running. Options in these files apply to all
115 Mercurial commands executed by any user in any directory. Registry
115 Mercurial commands executed by any user in any directory. Registry
116 keys contain PATH-like strings, every part of which must reference
116 keys contain PATH-like strings, every part of which must reference
117 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
117 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
118 be read. Mercurial checks each of these locations in the specified
118 be read. Mercurial checks each of these locations in the specified
119 order until one or more configuration files are detected. If the
119 order until one or more configuration files are detected. If the
120 pywin32 extensions are not installed, Mercurial will only look for
120 pywin32 extensions are not installed, Mercurial will only look for
121 site-wide configuration in ``C:\Mercurial\Mercurial.ini``.
121 site-wide configuration in ``C:\Mercurial\Mercurial.ini``.
122
122
123 Syntax
123 Syntax
124 ------
124 ------
125
125
126 A configuration file consists of sections, led by a ``[section]`` header
126 A configuration file consists of sections, led by a ``[section]`` header
127 and followed by ``name = value`` entries (sometimes called
127 and followed by ``name = value`` entries (sometimes called
128 ``configuration keys``)::
128 ``configuration keys``)::
129
129
130 [spam]
130 [spam]
131 eggs=ham
131 eggs=ham
132 green=
132 green=
133 eggs
133 eggs
134
134
135 Each line contains one entry. If the lines that follow are indented,
135 Each line contains one entry. If the lines that follow are indented,
136 they are treated as continuations of that entry. Leading whitespace is
136 they are treated as continuations of that entry. Leading whitespace is
137 removed from values. Empty lines are skipped. Lines beginning with
137 removed from values. Empty lines are skipped. Lines beginning with
138 ``#`` or ``;`` are ignored and may be used to provide comments.
138 ``#`` or ``;`` are ignored and may be used to provide comments.
139
139
140 Configuration keys can be set multiple times, in which case mercurial
140 Configuration keys can be set multiple times, in which case mercurial
141 will use the value that was configured last. As an example::
141 will use the value that was configured last. As an example::
142
142
143 [spam]
143 [spam]
144 eggs=large
144 eggs=large
145 ham=serrano
145 ham=serrano
146 eggs=small
146 eggs=small
147
147
148 This would set the configuration key named ``eggs`` to ``small``.
148 This would set the configuration key named ``eggs`` to ``small``.
149
149
150 It is also possible to define a section multiple times. A section can
150 It is also possible to define a section multiple times. A section can
151 be redefined on the same and/or on different hgrc files. For example::
151 be redefined on the same and/or on different hgrc files. For example::
152
152
153 [foo]
153 [foo]
154 eggs=large
154 eggs=large
155 ham=serrano
155 ham=serrano
156 eggs=small
156 eggs=small
157
157
158 [bar]
158 [bar]
159 eggs=ham
159 eggs=ham
160 green=
160 green=
161 eggs
161 eggs
162
162
163 [foo]
163 [foo]
164 ham=prosciutto
164 ham=prosciutto
165 eggs=medium
165 eggs=medium
166 bread=toasted
166 bread=toasted
167
167
168 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
168 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
169 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
169 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
170 respectively. As you can see there only thing that matters is the last
170 respectively. As you can see there only thing that matters is the last
171 value that was set for each of the configuration keys.
171 value that was set for each of the configuration keys.
172
172
173 If a configuration key is set multiple times in different
173 If a configuration key is set multiple times in different
174 configuration files the final value will depend on the order in which
174 configuration files the final value will depend on the order in which
175 the different configuration files are read, with settings from earlier
175 the different configuration files are read, with settings from earlier
176 paths overriding later ones as described on the ``Files`` section
176 paths overriding later ones as described on the ``Files`` section
177 above.
177 above.
178
178
179 A line of the form ``%include file`` will include ``file`` into the
179 A line of the form ``%include file`` will include ``file`` into the
180 current configuration file. The inclusion is recursive, which means
180 current configuration file. The inclusion is recursive, which means
181 that included files can include other files. Filenames are relative to
181 that included files can include other files. Filenames are relative to
182 the configuration file in which the ``%include`` directive is found.
182 the configuration file in which the ``%include`` directive is found.
183 Environment variables and ``~user`` constructs are expanded in
183 Environment variables and ``~user`` constructs are expanded in
184 ``file``. This lets you do something like::
184 ``file``. This lets you do something like::
185
185
186 %include ~/.hgrc.d/$HOST.rc
186 %include ~/.hgrc.d/$HOST.rc
187
187
188 to include a different configuration file on each computer you use.
188 to include a different configuration file on each computer you use.
189
189
190 A line with ``%unset name`` will remove ``name`` from the current
190 A line with ``%unset name`` will remove ``name`` from the current
191 section, if it has been set previously.
191 section, if it has been set previously.
192
192
193 The values are either free-form text strings, lists of text strings,
193 The values are either free-form text strings, lists of text strings,
194 or Boolean values. Boolean values can be set to true using any of "1",
194 or Boolean values. Boolean values can be set to true using any of "1",
195 "yes", "true", or "on" and to false using "0", "no", "false", or "off"
195 "yes", "true", or "on" and to false using "0", "no", "false", or "off"
196 (all case insensitive).
196 (all case insensitive).
197
197
198 List values are separated by whitespace or comma, except when values are
198 List values are separated by whitespace or comma, except when values are
199 placed in double quotation marks::
199 placed in double quotation marks::
200
200
201 allow_read = "John Doe, PhD", brian, betty
201 allow_read = "John Doe, PhD", brian, betty
202
202
203 Quotation marks can be escaped by prefixing them with a backslash. Only
203 Quotation marks can be escaped by prefixing them with a backslash. Only
204 quotation marks at the beginning of a word is counted as a quotation
204 quotation marks at the beginning of a word is counted as a quotation
205 (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
205 (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
206
206
207 Sections
207 Sections
208 --------
208 --------
209
209
210 This section describes the different sections that may appear in a
210 This section describes the different sections that may appear in a
211 Mercurial "hgrc" file, the purpose of each section, its possible keys,
211 Mercurial "hgrc" file, the purpose of each section, its possible keys,
212 and their possible values.
212 and their possible values.
213
213
214 ``alias``
214 ``alias``
215 """""""""
215 """""""""
216
216
217 Defines command aliases.
217 Defines command aliases.
218 Aliases allow you to define your own commands in terms of other
218 Aliases allow you to define your own commands in terms of other
219 commands (or aliases), optionally including arguments. Positional
219 commands (or aliases), optionally including arguments. Positional
220 arguments in the form of ``$1``, ``$2``, etc in the alias definition
220 arguments in the form of ``$1``, ``$2``, etc in the alias definition
221 are expanded by Mercurial before execution. Positional arguments not
221 are expanded by Mercurial before execution. Positional arguments not
222 already used by ``$N`` in the definition are put at the end of the
222 already used by ``$N`` in the definition are put at the end of the
223 command to be executed.
223 command to be executed.
224
224
225 Alias definitions consist of lines of the form::
225 Alias definitions consist of lines of the form::
226
226
227 <alias> = <command> [<argument]...
227 <alias> = <command> [<argument]...
228
228
229 For example, this definition::
229 For example, this definition::
230
230
231 latest = log --limit 5
231 latest = log --limit 5
232
232
233 creates a new command ``latest`` that shows only the five most recent
233 creates a new command ``latest`` that shows only the five most recent
234 changesets. You can define subsequent aliases using earlier ones::
234 changesets. You can define subsequent aliases using earlier ones::
235
235
236 stable5 = latest -b stable
236 stable5 = latest -b stable
237
237
238 .. note:: It is possible to create aliases with the same names as
238 .. note:: It is possible to create aliases with the same names as
239 existing commands, which will then override the original
239 existing commands, which will then override the original
240 definitions. This is almost always a bad idea!
240 definitions. This is almost always a bad idea!
241
241
242 An alias can start with an exclamation point (``!``) to make it a
242 An alias can start with an exclamation point (``!``) to make it a
243 shell alias. A shell alias is executed with the shell and will let you
243 shell alias. A shell alias is executed with the shell and will let you
244 run arbitrary commands. As an example, ::
244 run arbitrary commands. As an example, ::
245
245
246 echo = !echo
246 echo = !echo
247
247
248 will let you do ``hg echo foo`` to have ``foo`` printed in your
248 will let you do ``hg echo foo`` to have ``foo`` printed in your
249 terminal. A better example might be::
249 terminal. A better example might be::
250
250
251 purge = !$HG status --no-status --unknown -0 | xargs -0 rm
251 purge = !$HG status --no-status --unknown -0 | xargs -0 rm
252
252
253 which will make ``hg purge`` delete all unknown files in the
253 which will make ``hg purge`` delete all unknown files in the
254 repository in the same manner as the purge extension.
254 repository in the same manner as the purge extension.
255
255
256 Shell aliases are executed in an environment where ``$HG`` expand to
256 Shell aliases are executed in an environment where ``$HG`` expand to
257 the path of the Mercurial that was used to execute the alias. This is
257 the path of the Mercurial that was used to execute the alias. This is
258 useful when you want to call further Mercurial commands in a shell
258 useful when you want to call further Mercurial commands in a shell
259 alias, as was done above for the purge alias. In addition,
259 alias, as was done above for the purge alias. In addition,
260 ``$HG_ARGS`` expand to the arguments given to Mercurial. In the ``hg
260 ``$HG_ARGS`` expand to the arguments given to Mercurial. In the ``hg
261 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
261 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
262
262
263 ``auth``
263 ``auth``
264 """"""""
264 """"""""
265
265
266 Authentication credentials for HTTP authentication. This section
266 Authentication credentials for HTTP authentication. This section
267 allows you to store usernames and passwords for use when logging
267 allows you to store usernames and passwords for use when logging
268 *into* HTTP servers. See the web_ configuration section if you want to
268 *into* HTTP servers. See the web_ configuration section if you want to
269 configure *who* can login to your HTTP server.
269 configure *who* can login to your HTTP server.
270
270
271 Each line has the following format::
271 Each line has the following format::
272
272
273 <name>.<argument> = <value>
273 <name>.<argument> = <value>
274
274
275 where ``<name>`` is used to group arguments into authentication
275 where ``<name>`` is used to group arguments into authentication
276 entries. Example::
276 entries. Example::
277
277
278 foo.prefix = hg.intevation.org/mercurial
278 foo.prefix = hg.intevation.org/mercurial
279 foo.username = foo
279 foo.username = foo
280 foo.password = bar
280 foo.password = bar
281 foo.schemes = http https
281 foo.schemes = http https
282
282
283 bar.prefix = secure.example.org
283 bar.prefix = secure.example.org
284 bar.key = path/to/file.key
284 bar.key = path/to/file.key
285 bar.cert = path/to/file.cert
285 bar.cert = path/to/file.cert
286 bar.schemes = https
286 bar.schemes = https
287
287
288 Supported arguments:
288 Supported arguments:
289
289
290 ``prefix``
290 ``prefix``
291 Either ``*`` or a URI prefix with or without the scheme part.
291 Either ``*`` or a URI prefix with or without the scheme part.
292 The authentication entry with the longest matching prefix is used
292 The authentication entry with the longest matching prefix is used
293 (where ``*`` matches everything and counts as a match of length
293 (where ``*`` matches everything and counts as a match of length
294 1). If the prefix doesn't include a scheme, the match is performed
294 1). If the prefix doesn't include a scheme, the match is performed
295 against the URI with its scheme stripped as well, and the schemes
295 against the URI with its scheme stripped as well, and the schemes
296 argument, q.v., is then subsequently consulted.
296 argument, q.v., is then subsequently consulted.
297
297 ``username``
298 ``username``
298 Optional. Username to authenticate with. If not given, and the
299 Optional. Username to authenticate with. If not given, and the
299 remote site requires basic or digest authentication, the user will
300 remote site requires basic or digest authentication, the user will
300 be prompted for it. Environment variables are expanded in the
301 be prompted for it. Environment variables are expanded in the
301 username letting you do ``foo.username = $USER``.
302 username letting you do ``foo.username = $USER``.
303
302 ``password``
304 ``password``
303 Optional. Password to authenticate with. If not given, and the
305 Optional. Password to authenticate with. If not given, and the
304 remote site requires basic or digest authentication, the user
306 remote site requires basic or digest authentication, the user
305 will be prompted for it.
307 will be prompted for it.
308
306 ``key``
309 ``key``
307 Optional. PEM encoded client certificate key file. Environment
310 Optional. PEM encoded client certificate key file. Environment
308 variables are expanded in the filename.
311 variables are expanded in the filename.
312
309 ``cert``
313 ``cert``
310 Optional. PEM encoded client certificate chain file. Environment
314 Optional. PEM encoded client certificate chain file. Environment
311 variables are expanded in the filename.
315 variables are expanded in the filename.
316
312 ``schemes``
317 ``schemes``
313 Optional. Space separated list of URI schemes to use this
318 Optional. Space separated list of URI schemes to use this
314 authentication entry with. Only used if the prefix doesn't include
319 authentication entry with. Only used if the prefix doesn't include
315 a scheme. Supported schemes are http and https. They will match
320 a scheme. Supported schemes are http and https. They will match
316 static-http and static-https respectively, as well.
321 static-http and static-https respectively, as well.
317 Default: https.
322 Default: https.
318
323
319 If no suitable authentication entry is found, the user is prompted
324 If no suitable authentication entry is found, the user is prompted
320 for credentials as usual if required by the remote.
325 for credentials as usual if required by the remote.
321
326
322
327
323 ``decode/encode``
328 ``decode/encode``
324 """""""""""""""""
329 """""""""""""""""
325
330
326 Filters for transforming files on checkout/checkin. This would
331 Filters for transforming files on checkout/checkin. This would
327 typically be used for newline processing or other
332 typically be used for newline processing or other
328 localization/canonicalization of files.
333 localization/canonicalization of files.
329
334
330 Filters consist of a filter pattern followed by a filter command.
335 Filters consist of a filter pattern followed by a filter command.
331 Filter patterns are globs by default, rooted at the repository root.
336 Filter patterns are globs by default, rooted at the repository root.
332 For example, to match any file ending in ``.txt`` in the root
337 For example, to match any file ending in ``.txt`` in the root
333 directory only, use the pattern ``*.txt``. To match any file ending
338 directory only, use the pattern ``*.txt``. To match any file ending
334 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
339 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
335 For each file only the first matching filter applies.
340 For each file only the first matching filter applies.
336
341
337 The filter command can start with a specifier, either ``pipe:`` or
342 The filter command can start with a specifier, either ``pipe:`` or
338 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
343 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
339
344
340 A ``pipe:`` command must accept data on stdin and return the transformed
345 A ``pipe:`` command must accept data on stdin and return the transformed
341 data on stdout.
346 data on stdout.
342
347
343 Pipe example::
348 Pipe example::
344
349
345 [encode]
350 [encode]
346 # uncompress gzip files on checkin to improve delta compression
351 # uncompress gzip files on checkin to improve delta compression
347 # note: not necessarily a good idea, just an example
352 # note: not necessarily a good idea, just an example
348 *.gz = pipe: gunzip
353 *.gz = pipe: gunzip
349
354
350 [decode]
355 [decode]
351 # recompress gzip files when writing them to the working dir (we
356 # recompress gzip files when writing them to the working dir (we
352 # can safely omit "pipe:", because it's the default)
357 # can safely omit "pipe:", because it's the default)
353 *.gz = gzip
358 *.gz = gzip
354
359
355 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
360 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
356 with the name of a temporary file that contains the data to be
361 with the name of a temporary file that contains the data to be
357 filtered by the command. The string ``OUTFILE`` is replaced with the name
362 filtered by the command. The string ``OUTFILE`` is replaced with the name
358 of an empty temporary file, where the filtered data must be written by
363 of an empty temporary file, where the filtered data must be written by
359 the command.
364 the command.
360
365
361 .. note:: The tempfile mechanism is recommended for Windows systems,
366 .. note:: The tempfile mechanism is recommended for Windows systems,
362 where the standard shell I/O redirection operators often have
367 where the standard shell I/O redirection operators often have
363 strange effects and may corrupt the contents of your files.
368 strange effects and may corrupt the contents of your files.
364
369
365 This filter mechanism is used internally by the ``eol`` extension to
370 This filter mechanism is used internally by the ``eol`` extension to
366 translate line ending characters between Windows (CRLF) and Unix (LF)
371 translate line ending characters between Windows (CRLF) and Unix (LF)
367 format. We suggest you use the ``eol`` extension for convenience.
372 format. We suggest you use the ``eol`` extension for convenience.
368
373
369
374
370 ``defaults``
375 ``defaults``
371 """"""""""""
376 """"""""""""
372
377
373 (defaults are deprecated. Don't use them. Use aliases instead)
378 (defaults are deprecated. Don't use them. Use aliases instead)
374
379
375 Use the ``[defaults]`` section to define command defaults, i.e. the
380 Use the ``[defaults]`` section to define command defaults, i.e. the
376 default options/arguments to pass to the specified commands.
381 default options/arguments to pass to the specified commands.
377
382
378 The following example makes :hg:`log` run in verbose mode, and
383 The following example makes :hg:`log` run in verbose mode, and
379 :hg:`status` show only the modified files, by default::
384 :hg:`status` show only the modified files, by default::
380
385
381 [defaults]
386 [defaults]
382 log = -v
387 log = -v
383 status = -m
388 status = -m
384
389
385 The actual commands, instead of their aliases, must be used when
390 The actual commands, instead of their aliases, must be used when
386 defining command defaults. The command defaults will also be applied
391 defining command defaults. The command defaults will also be applied
387 to the aliases of the commands defined.
392 to the aliases of the commands defined.
388
393
389
394
390 ``diff``
395 ``diff``
391 """"""""
396 """"""""
392
397
393 Settings used when displaying diffs. Everything except for ``unified`` is a
398 Settings used when displaying diffs. Everything except for ``unified`` is a
394 Boolean and defaults to False.
399 Boolean and defaults to False.
395
400
396 ``git``
401 ``git``
397 Use git extended diff format.
402 Use git extended diff format.
403
398 ``nodates``
404 ``nodates``
399 Don't include dates in diff headers.
405 Don't include dates in diff headers.
406
400 ``showfunc``
407 ``showfunc``
401 Show which function each change is in.
408 Show which function each change is in.
409
402 ``ignorews``
410 ``ignorews``
403 Ignore white space when comparing lines.
411 Ignore white space when comparing lines.
412
404 ``ignorewsamount``
413 ``ignorewsamount``
405 Ignore changes in the amount of white space.
414 Ignore changes in the amount of white space.
415
406 ``ignoreblanklines``
416 ``ignoreblanklines``
407 Ignore changes whose lines are all blank.
417 Ignore changes whose lines are all blank.
418
408 ``unified``
419 ``unified``
409 Number of lines of context to show.
420 Number of lines of context to show.
410
421
411 ``email``
422 ``email``
412 """""""""
423 """""""""
413
424
414 Settings for extensions that send email messages.
425 Settings for extensions that send email messages.
415
426
416 ``from``
427 ``from``
417 Optional. Email address to use in "From" header and SMTP envelope
428 Optional. Email address to use in "From" header and SMTP envelope
418 of outgoing messages.
429 of outgoing messages.
430
419 ``to``
431 ``to``
420 Optional. Comma-separated list of recipients' email addresses.
432 Optional. Comma-separated list of recipients' email addresses.
433
421 ``cc``
434 ``cc``
422 Optional. Comma-separated list of carbon copy recipients'
435 Optional. Comma-separated list of carbon copy recipients'
423 email addresses.
436 email addresses.
437
424 ``bcc``
438 ``bcc``
425 Optional. Comma-separated list of blind carbon copy recipients'
439 Optional. Comma-separated list of blind carbon copy recipients'
426 email addresses.
440 email addresses.
441
427 ``method``
442 ``method``
428 Optional. Method to use to send email messages. If value is ``smtp``
443 Optional. Method to use to send email messages. If value is ``smtp``
429 (default), use SMTP (see the SMTP_ section for configuration).
444 (default), use SMTP (see the SMTP_ section for configuration).
430 Otherwise, use as name of program to run that acts like sendmail
445 Otherwise, use as name of program to run that acts like sendmail
431 (takes ``-f`` option for sender, list of recipients on command line,
446 (takes ``-f`` option for sender, list of recipients on command line,
432 message on stdin). Normally, setting this to ``sendmail`` or
447 message on stdin). Normally, setting this to ``sendmail`` or
433 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
448 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
449
434 ``charsets``
450 ``charsets``
435 Optional. Comma-separated list of character sets considered
451 Optional. Comma-separated list of character sets considered
436 convenient for recipients. Addresses, headers, and parts not
452 convenient for recipients. Addresses, headers, and parts not
437 containing patches of outgoing messages will be encoded in the
453 containing patches of outgoing messages will be encoded in the
438 first character set to which conversion from local encoding
454 first character set to which conversion from local encoding
439 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
455 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
440 conversion fails, the text in question is sent as is. Defaults to
456 conversion fails, the text in question is sent as is. Defaults to
441 empty (explicit) list.
457 empty (explicit) list.
442
458
443 Order of outgoing email character sets:
459 Order of outgoing email character sets:
444
460
445 1. ``us-ascii``: always first, regardless of settings
461 1. ``us-ascii``: always first, regardless of settings
446 2. ``email.charsets``: in order given by user
462 2. ``email.charsets``: in order given by user
447 3. ``ui.fallbackencoding``: if not in email.charsets
463 3. ``ui.fallbackencoding``: if not in email.charsets
448 4. ``$HGENCODING``: if not in email.charsets
464 4. ``$HGENCODING``: if not in email.charsets
449 5. ``utf-8``: always last, regardless of settings
465 5. ``utf-8``: always last, regardless of settings
450
466
451 Email example::
467 Email example::
452
468
453 [email]
469 [email]
454 from = Joseph User <joe.user@example.com>
470 from = Joseph User <joe.user@example.com>
455 method = /usr/sbin/sendmail
471 method = /usr/sbin/sendmail
456 # charsets for western Europeans
472 # charsets for western Europeans
457 # us-ascii, utf-8 omitted, as they are tried first and last
473 # us-ascii, utf-8 omitted, as they are tried first and last
458 charsets = iso-8859-1, iso-8859-15, windows-1252
474 charsets = iso-8859-1, iso-8859-15, windows-1252
459
475
460
476
461 ``extensions``
477 ``extensions``
462 """"""""""""""
478 """"""""""""""
463
479
464 Mercurial has an extension mechanism for adding new features. To
480 Mercurial has an extension mechanism for adding new features. To
465 enable an extension, create an entry for it in this section.
481 enable an extension, create an entry for it in this section.
466
482
467 If you know that the extension is already in Python's search path,
483 If you know that the extension is already in Python's search path,
468 you can give the name of the module, followed by ``=``, with nothing
484 you can give the name of the module, followed by ``=``, with nothing
469 after the ``=``.
485 after the ``=``.
470
486
471 Otherwise, give a name that you choose, followed by ``=``, followed by
487 Otherwise, give a name that you choose, followed by ``=``, followed by
472 the path to the ``.py`` file (including the file name extension) that
488 the path to the ``.py`` file (including the file name extension) that
473 defines the extension.
489 defines the extension.
474
490
475 To explicitly disable an extension that is enabled in an hgrc of
491 To explicitly disable an extension that is enabled in an hgrc of
476 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
492 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
477 or ``foo = !`` when path is not supplied.
493 or ``foo = !`` when path is not supplied.
478
494
479 Example for ``~/.hgrc``::
495 Example for ``~/.hgrc``::
480
496
481 [extensions]
497 [extensions]
482 # (the mq extension will get loaded from Mercurial's path)
498 # (the mq extension will get loaded from Mercurial's path)
483 mq =
499 mq =
484 # (this extension will get loaded from the file specified)
500 # (this extension will get loaded from the file specified)
485 myfeature = ~/.hgext/myfeature.py
501 myfeature = ~/.hgext/myfeature.py
486
502
487
503
488 ``hostfingerprints``
504 ``hostfingerprints``
489 """"""""""""""""""""
505 """"""""""""""""""""
490
506
491 Fingerprints of the certificates of known HTTPS servers.
507 Fingerprints of the certificates of known HTTPS servers.
492 A HTTPS connection to a server with a fingerprint configured here will
508 A HTTPS connection to a server with a fingerprint configured here will
493 only succeed if the servers certificate matches the fingerprint.
509 only succeed if the servers certificate matches the fingerprint.
494 This is very similar to how ssh known hosts works.
510 This is very similar to how ssh known hosts works.
495 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
511 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
496 The CA chain and web.cacerts is not used for servers with a fingerprint.
512 The CA chain and web.cacerts is not used for servers with a fingerprint.
497
513
498 For example::
514 For example::
499
515
500 [hostfingerprints]
516 [hostfingerprints]
501 hg.intevation.org = 38:76:52:7c:87:26:9a:8f:4a:f8:d3:de:08:45:3b:ea:d6:4b:ee:cc
517 hg.intevation.org = 38:76:52:7c:87:26:9a:8f:4a:f8:d3:de:08:45:3b:ea:d6:4b:ee:cc
502
518
503 This feature is only supported when using Python 2.6 or later.
519 This feature is only supported when using Python 2.6 or later.
504
520
505
521
506 ``format``
522 ``format``
507 """"""""""
523 """"""""""
508
524
509 ``usestore``
525 ``usestore``
510 Enable or disable the "store" repository format which improves
526 Enable or disable the "store" repository format which improves
511 compatibility with systems that fold case or otherwise mangle
527 compatibility with systems that fold case or otherwise mangle
512 filenames. Enabled by default. Disabling this option will allow
528 filenames. Enabled by default. Disabling this option will allow
513 you to store longer filenames in some situations at the expense of
529 you to store longer filenames in some situations at the expense of
514 compatibility and ensures that the on-disk format of newly created
530 compatibility and ensures that the on-disk format of newly created
515 repositories will be compatible with Mercurial before version 0.9.4.
531 repositories will be compatible with Mercurial before version 0.9.4.
516
532
517 ``usefncache``
533 ``usefncache``
518 Enable or disable the "fncache" repository format which enhances
534 Enable or disable the "fncache" repository format which enhances
519 the "store" repository format (which has to be enabled to use
535 the "store" repository format (which has to be enabled to use
520 fncache) to allow longer filenames and avoids using Windows
536 fncache) to allow longer filenames and avoids using Windows
521 reserved names, e.g. "nul". Enabled by default. Disabling this
537 reserved names, e.g. "nul". Enabled by default. Disabling this
522 option ensures that the on-disk format of newly created
538 option ensures that the on-disk format of newly created
523 repositories will be compatible with Mercurial before version 1.1.
539 repositories will be compatible with Mercurial before version 1.1.
524
540
525 ``dotencode``
541 ``dotencode``
526 Enable or disable the "dotencode" repository format which enhances
542 Enable or disable the "dotencode" repository format which enhances
527 the "fncache" repository format (which has to be enabled to use
543 the "fncache" repository format (which has to be enabled to use
528 dotencode) to avoid issues with filenames starting with ._ on
544 dotencode) to avoid issues with filenames starting with ._ on
529 Mac OS X and spaces on Windows. Enabled by default. Disabling this
545 Mac OS X and spaces on Windows. Enabled by default. Disabling this
530 option ensures that the on-disk format of newly created
546 option ensures that the on-disk format of newly created
531 repositories will be compatible with Mercurial before version 1.7.
547 repositories will be compatible with Mercurial before version 1.7.
532
548
533 ``merge-patterns``
549 ``merge-patterns``
534 """"""""""""""""""
550 """"""""""""""""""
535
551
536 This section specifies merge tools to associate with particular file
552 This section specifies merge tools to associate with particular file
537 patterns. Tools matched here will take precedence over the default
553 patterns. Tools matched here will take precedence over the default
538 merge tool. Patterns are globs by default, rooted at the repository
554 merge tool. Patterns are globs by default, rooted at the repository
539 root.
555 root.
540
556
541 Example::
557 Example::
542
558
543 [merge-patterns]
559 [merge-patterns]
544 **.c = kdiff3
560 **.c = kdiff3
545 **.jpg = myimgmerge
561 **.jpg = myimgmerge
546
562
547 ``merge-tools``
563 ``merge-tools``
548 """""""""""""""
564 """""""""""""""
549
565
550 This section configures external merge tools to use for file-level
566 This section configures external merge tools to use for file-level
551 merges.
567 merges.
552
568
553 Example ``~/.hgrc``::
569 Example ``~/.hgrc``::
554
570
555 [merge-tools]
571 [merge-tools]
556 # Override stock tool location
572 # Override stock tool location
557 kdiff3.executable = ~/bin/kdiff3
573 kdiff3.executable = ~/bin/kdiff3
558 # Specify command line
574 # Specify command line
559 kdiff3.args = $base $local $other -o $output
575 kdiff3.args = $base $local $other -o $output
560 # Give higher priority
576 # Give higher priority
561 kdiff3.priority = 1
577 kdiff3.priority = 1
562
578
563 # Define new tool
579 # Define new tool
564 myHtmlTool.args = -m $local $other $base $output
580 myHtmlTool.args = -m $local $other $base $output
565 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
581 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
566 myHtmlTool.priority = 1
582 myHtmlTool.priority = 1
567
583
568 Supported arguments:
584 Supported arguments:
569
585
570 ``priority``
586 ``priority``
571 The priority in which to evaluate this tool.
587 The priority in which to evaluate this tool.
572 Default: 0.
588 Default: 0.
589
573 ``executable``
590 ``executable``
574 Either just the name of the executable or its pathname. On Windows,
591 Either just the name of the executable or its pathname. On Windows,
575 the path can use environment variables with ${ProgramFiles} syntax.
592 the path can use environment variables with ${ProgramFiles} syntax.
576 Default: the tool name.
593 Default: the tool name.
594
577 ``args``
595 ``args``
578 The arguments to pass to the tool executable. You can refer to the
596 The arguments to pass to the tool executable. You can refer to the
579 files being merged as well as the output file through these
597 files being merged as well as the output file through these
580 variables: ``$base``, ``$local``, ``$other``, ``$output``.
598 variables: ``$base``, ``$local``, ``$other``, ``$output``.
581 Default: ``$local $base $other``
599 Default: ``$local $base $other``
600
582 ``premerge``
601 ``premerge``
583 Attempt to run internal non-interactive 3-way merge tool before
602 Attempt to run internal non-interactive 3-way merge tool before
584 launching external tool. Options are ``true``, ``false``, or ``keep``
603 launching external tool. Options are ``true``, ``false``, or ``keep``
585 to leave markers in the file if the premerge fails.
604 to leave markers in the file if the premerge fails.
586 Default: True
605 Default: True
606
587 ``binary``
607 ``binary``
588 This tool can merge binary files. Defaults to False, unless tool
608 This tool can merge binary files. Defaults to False, unless tool
589 was selected by file pattern match.
609 was selected by file pattern match.
610
590 ``symlink``
611 ``symlink``
591 This tool can merge symlinks. Defaults to False, even if tool was
612 This tool can merge symlinks. Defaults to False, even if tool was
592 selected by file pattern match.
613 selected by file pattern match.
614
593 ``check``
615 ``check``
594 A list of merge success-checking options:
616 A list of merge success-checking options:
595
617
596 ``changed``
618 ``changed``
597 Ask whether merge was successful when the merged file shows no changes.
619 Ask whether merge was successful when the merged file shows no changes.
598 ``conflicts``
620 ``conflicts``
599 Check whether there are conflicts even though the tool reported success.
621 Check whether there are conflicts even though the tool reported success.
600 ``prompt``
622 ``prompt``
601 Always prompt for merge success, regardless of success reported by tool.
623 Always prompt for merge success, regardless of success reported by tool.
602
624
603 ``checkchanged``
625 ``checkchanged``
604 True is equivalent to ``check = changed``.
626 True is equivalent to ``check = changed``.
605 Default: False
627 Default: False
628
606 ``checkconflicts``
629 ``checkconflicts``
607 True is equivalent to ``check = conflicts``.
630 True is equivalent to ``check = conflicts``.
608 Default: False
631 Default: False
632
609 ``fixeol``
633 ``fixeol``
610 Attempt to fix up EOL changes caused by the merge tool.
634 Attempt to fix up EOL changes caused by the merge tool.
611 Default: False
635 Default: False
636
612 ``gui``
637 ``gui``
613 This tool requires a graphical interface to run. Default: False
638 This tool requires a graphical interface to run. Default: False
639
614 ``regkey``
640 ``regkey``
615 Windows registry key which describes install location of this
641 Windows registry key which describes install location of this
616 tool. Mercurial will search for this key first under
642 tool. Mercurial will search for this key first under
617 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
643 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
618 Default: None
644 Default: None
645
619 ``regkeyalt``
646 ``regkeyalt``
620 An alternate Windows registry key to try if the first key is not
647 An alternate Windows registry key to try if the first key is not
621 found. The alternate key uses the same ``regname`` and ``regappend``
648 found. The alternate key uses the same ``regname`` and ``regappend``
622 semantics of the primary key. The most common use for this key
649 semantics of the primary key. The most common use for this key
623 is to search for 32bit applications on 64bit operating systems.
650 is to search for 32bit applications on 64bit operating systems.
624 Default: None
651 Default: None
652
625 ``regname``
653 ``regname``
626 Name of value to read from specified registry key. Defaults to the
654 Name of value to read from specified registry key. Defaults to the
627 unnamed (default) value.
655 unnamed (default) value.
656
628 ``regappend``
657 ``regappend``
629 String to append to the value read from the registry, typically
658 String to append to the value read from the registry, typically
630 the executable name of the tool.
659 the executable name of the tool.
631 Default: None
660 Default: None
632
661
633
662
634 ``hooks``
663 ``hooks``
635 """""""""
664 """""""""
636
665
637 Commands or Python functions that get automatically executed by
666 Commands or Python functions that get automatically executed by
638 various actions such as starting or finishing a commit. Multiple
667 various actions such as starting or finishing a commit. Multiple
639 hooks can be run for the same action by appending a suffix to the
668 hooks can be run for the same action by appending a suffix to the
640 action. Overriding a site-wide hook can be done by changing its
669 action. Overriding a site-wide hook can be done by changing its
641 value or setting it to an empty string.
670 value or setting it to an empty string.
642
671
643 Example ``.hg/hgrc``::
672 Example ``.hg/hgrc``::
644
673
645 [hooks]
674 [hooks]
646 # update working directory after adding changesets
675 # update working directory after adding changesets
647 changegroup.update = hg update
676 changegroup.update = hg update
648 # do not use the site-wide hook
677 # do not use the site-wide hook
649 incoming =
678 incoming =
650 incoming.email = /my/email/hook
679 incoming.email = /my/email/hook
651 incoming.autobuild = /my/build/hook
680 incoming.autobuild = /my/build/hook
652
681
653 Most hooks are run with environment variables set that give useful
682 Most hooks are run with environment variables set that give useful
654 additional information. For each hook below, the environment
683 additional information. For each hook below, the environment
655 variables it is passed are listed with names of the form ``$HG_foo``.
684 variables it is passed are listed with names of the form ``$HG_foo``.
656
685
657 ``changegroup``
686 ``changegroup``
658 Run after a changegroup has been added via push, pull or unbundle.
687 Run after a changegroup has been added via push, pull or unbundle.
659 ID of the first new changeset is in ``$HG_NODE``. URL from which
688 ID of the first new changeset is in ``$HG_NODE``. URL from which
660 changes came is in ``$HG_URL``.
689 changes came is in ``$HG_URL``.
690
661 ``commit``
691 ``commit``
662 Run after a changeset has been created in the local repository. ID
692 Run after a changeset has been created in the local repository. ID
663 of the newly created changeset is in ``$HG_NODE``. Parent changeset
693 of the newly created changeset is in ``$HG_NODE``. Parent changeset
664 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
694 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
695
665 ``incoming``
696 ``incoming``
666 Run after a changeset has been pulled, pushed, or unbundled into
697 Run after a changeset has been pulled, pushed, or unbundled into
667 the local repository. The ID of the newly arrived changeset is in
698 the local repository. The ID of the newly arrived changeset is in
668 ``$HG_NODE``. URL that was source of changes came is in ``$HG_URL``.
699 ``$HG_NODE``. URL that was source of changes came is in ``$HG_URL``.
700
669 ``outgoing``
701 ``outgoing``
670 Run after sending changes from local repository to another. ID of
702 Run after sending changes from local repository to another. ID of
671 first changeset sent is in ``$HG_NODE``. Source of operation is in
703 first changeset sent is in ``$HG_NODE``. Source of operation is in
672 ``$HG_SOURCE``; see "preoutgoing" hook for description.
704 ``$HG_SOURCE``; see "preoutgoing" hook for description.
705
673 ``post-<command>``
706 ``post-<command>``
674 Run after successful invocations of the associated command. The
707 Run after successful invocations of the associated command. The
675 contents of the command line are passed as ``$HG_ARGS`` and the result
708 contents of the command line are passed as ``$HG_ARGS`` and the result
676 code in ``$HG_RESULT``. Parsed command line arguments are passed as
709 code in ``$HG_RESULT``. Parsed command line arguments are passed as
677 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
710 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
678 the python data internally passed to <command>. ``$HG_OPTS`` is a
711 the python data internally passed to <command>. ``$HG_OPTS`` is a
679 dictionary of options (with unspecified options set to their defaults).
712 dictionary of options (with unspecified options set to their defaults).
680 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
713 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
714
681 ``pre-<command>``
715 ``pre-<command>``
682 Run before executing the associated command. The contents of the
716 Run before executing the associated command. The contents of the
683 command line are passed as ``$HG_ARGS``. Parsed command line arguments
717 command line are passed as ``$HG_ARGS``. Parsed command line arguments
684 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
718 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
685 representations of the data internally passed to <command>. ``$HG_OPTS``
719 representations of the data internally passed to <command>. ``$HG_OPTS``
686 is a dictionary of options (with unspecified options set to their
720 is a dictionary of options (with unspecified options set to their
687 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
721 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
688 failure, the command doesn't execute and Mercurial returns the failure
722 failure, the command doesn't execute and Mercurial returns the failure
689 code.
723 code.
724
690 ``prechangegroup``
725 ``prechangegroup``
691 Run before a changegroup is added via push, pull or unbundle. Exit
726 Run before a changegroup is added via push, pull or unbundle. Exit
692 status 0 allows the changegroup to proceed. Non-zero status will
727 status 0 allows the changegroup to proceed. Non-zero status will
693 cause the push, pull or unbundle to fail. URL from which changes
728 cause the push, pull or unbundle to fail. URL from which changes
694 will come is in ``$HG_URL``.
729 will come is in ``$HG_URL``.
730
695 ``precommit``
731 ``precommit``
696 Run before starting a local commit. Exit status 0 allows the
732 Run before starting a local commit. Exit status 0 allows the
697 commit to proceed. Non-zero status will cause the commit to fail.
733 commit to proceed. Non-zero status will cause the commit to fail.
698 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
734 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
735
699 ``prelistkeys``
736 ``prelistkeys``
700 Run before listing pushkeys (like bookmarks) in the
737 Run before listing pushkeys (like bookmarks) in the
701 repository. Non-zero status will cause failure. The key namespace is
738 repository. Non-zero status will cause failure. The key namespace is
702 in ``$HG_NAMESPACE``.
739 in ``$HG_NAMESPACE``.
740
703 ``preoutgoing``
741 ``preoutgoing``
704 Run before collecting changes to send from the local repository to
742 Run before collecting changes to send from the local repository to
705 another. Non-zero status will cause failure. This lets you prevent
743 another. Non-zero status will cause failure. This lets you prevent
706 pull over HTTP or SSH. Also prevents against local pull, push
744 pull over HTTP or SSH. Also prevents against local pull, push
707 (outbound) or bundle commands, but not effective, since you can
745 (outbound) or bundle commands, but not effective, since you can
708 just copy files instead then. Source of operation is in
746 just copy files instead then. Source of operation is in
709 ``$HG_SOURCE``. If "serve", operation is happening on behalf of remote
747 ``$HG_SOURCE``. If "serve", operation is happening on behalf of remote
710 SSH or HTTP repository. If "push", "pull" or "bundle", operation
748 SSH or HTTP repository. If "push", "pull" or "bundle", operation
711 is happening on behalf of repository on same system.
749 is happening on behalf of repository on same system.
750
712 ``prepushkey``
751 ``prepushkey``
713 Run before a pushkey (like a bookmark) is added to the
752 Run before a pushkey (like a bookmark) is added to the
714 repository. Non-zero status will cause the key to be rejected. The
753 repository. Non-zero status will cause the key to be rejected. The
715 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
754 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
716 the old value (if any) is in ``$HG_OLD``, and the new value is in
755 the old value (if any) is in ``$HG_OLD``, and the new value is in
717 ``$HG_NEW``.
756 ``$HG_NEW``.
757
718 ``pretag``
758 ``pretag``
719 Run before creating a tag. Exit status 0 allows the tag to be
759 Run before creating a tag. Exit status 0 allows the tag to be
720 created. Non-zero status will cause the tag to fail. ID of
760 created. Non-zero status will cause the tag to fail. ID of
721 changeset to tag is in ``$HG_NODE``. Name of tag is in ``$HG_TAG``. Tag is
761 changeset to tag is in ``$HG_NODE``. Name of tag is in ``$HG_TAG``. Tag is
722 local if ``$HG_LOCAL=1``, in repository if ``$HG_LOCAL=0``.
762 local if ``$HG_LOCAL=1``, in repository if ``$HG_LOCAL=0``.
763
723 ``pretxnchangegroup``
764 ``pretxnchangegroup``
724 Run after a changegroup has been added via push, pull or unbundle,
765 Run after a changegroup has been added via push, pull or unbundle,
725 but before the transaction has been committed. Changegroup is
766 but before the transaction has been committed. Changegroup is
726 visible to hook program. This lets you validate incoming changes
767 visible to hook program. This lets you validate incoming changes
727 before accepting them. Passed the ID of the first new changeset in
768 before accepting them. Passed the ID of the first new changeset in
728 ``$HG_NODE``. Exit status 0 allows the transaction to commit. Non-zero
769 ``$HG_NODE``. Exit status 0 allows the transaction to commit. Non-zero
729 status will cause the transaction to be rolled back and the push,
770 status will cause the transaction to be rolled back and the push,
730 pull or unbundle will fail. URL that was source of changes is in
771 pull or unbundle will fail. URL that was source of changes is in
731 ``$HG_URL``.
772 ``$HG_URL``.
773
732 ``pretxncommit``
774 ``pretxncommit``
733 Run after a changeset has been created but the transaction not yet
775 Run after a changeset has been created but the transaction not yet
734 committed. Changeset is visible to hook program. This lets you
776 committed. Changeset is visible to hook program. This lets you
735 validate commit message and changes. Exit status 0 allows the
777 validate commit message and changes. Exit status 0 allows the
736 commit to proceed. Non-zero status will cause the transaction to
778 commit to proceed. Non-zero status will cause the transaction to
737 be rolled back. ID of changeset is in ``$HG_NODE``. Parent changeset
779 be rolled back. ID of changeset is in ``$HG_NODE``. Parent changeset
738 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
780 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
781
739 ``preupdate``
782 ``preupdate``
740 Run before updating the working directory. Exit status 0 allows
783 Run before updating the working directory. Exit status 0 allows
741 the update to proceed. Non-zero status will prevent the update.
784 the update to proceed. Non-zero status will prevent the update.
742 Changeset ID of first new parent is in ``$HG_PARENT1``. If merge, ID
785 Changeset ID of first new parent is in ``$HG_PARENT1``. If merge, ID
743 of second new parent is in ``$HG_PARENT2``.
786 of second new parent is in ``$HG_PARENT2``.
787
744 ``listkeys``
788 ``listkeys``
745 Run after listing pushkeys (like bookmarks) in the repository. The
789 Run after listing pushkeys (like bookmarks) in the repository. The
746 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
790 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
747 dictionary containing the keys and values.
791 dictionary containing the keys and values.
792
748 ``pushkey``
793 ``pushkey``
749 Run after a pushkey (like a bookmark) is added to the
794 Run after a pushkey (like a bookmark) is added to the
750 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
795 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
751 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
796 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
752 value is in ``$HG_NEW``.
797 value is in ``$HG_NEW``.
798
753 ``tag``
799 ``tag``
754 Run after a tag is created. ID of tagged changeset is in ``$HG_NODE``.
800 Run after a tag is created. ID of tagged changeset is in ``$HG_NODE``.
755 Name of tag is in ``$HG_TAG``. Tag is local if ``$HG_LOCAL=1``, in
801 Name of tag is in ``$HG_TAG``. Tag is local if ``$HG_LOCAL=1``, in
756 repository if ``$HG_LOCAL=0``.
802 repository if ``$HG_LOCAL=0``.
803
757 ``update``
804 ``update``
758 Run after updating the working directory. Changeset ID of first
805 Run after updating the working directory. Changeset ID of first
759 new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is
806 new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is
760 in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
807 in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
761 update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``.
808 update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``.
762
809
763 .. note:: It is generally better to use standard hooks rather than the
810 .. note:: It is generally better to use standard hooks rather than the
764 generic pre- and post- command hooks as they are guaranteed to be
811 generic pre- and post- command hooks as they are guaranteed to be
765 called in the appropriate contexts for influencing transactions.
812 called in the appropriate contexts for influencing transactions.
766 Also, hooks like "commit" will be called in all contexts that
813 Also, hooks like "commit" will be called in all contexts that
767 generate a commit (e.g. tag) and not just the commit command.
814 generate a commit (e.g. tag) and not just the commit command.
768
815
769 .. note:: Environment variables with empty values may not be passed to
816 .. note:: Environment variables with empty values may not be passed to
770 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
817 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
771 will have an empty value under Unix-like platforms for non-merge
818 will have an empty value under Unix-like platforms for non-merge
772 changesets, while it will not be available at all under Windows.
819 changesets, while it will not be available at all under Windows.
773
820
774 The syntax for Python hooks is as follows::
821 The syntax for Python hooks is as follows::
775
822
776 hookname = python:modulename.submodule.callable
823 hookname = python:modulename.submodule.callable
777 hookname = python:/path/to/python/module.py:callable
824 hookname = python:/path/to/python/module.py:callable
778
825
779 Python hooks are run within the Mercurial process. Each hook is
826 Python hooks are run within the Mercurial process. Each hook is
780 called with at least three keyword arguments: a ui object (keyword
827 called with at least three keyword arguments: a ui object (keyword
781 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
828 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
782 keyword that tells what kind of hook is used. Arguments listed as
829 keyword that tells what kind of hook is used. Arguments listed as
783 environment variables above are passed as keyword arguments, with no
830 environment variables above are passed as keyword arguments, with no
784 ``HG_`` prefix, and names in lower case.
831 ``HG_`` prefix, and names in lower case.
785
832
786 If a Python hook returns a "true" value or raises an exception, this
833 If a Python hook returns a "true" value or raises an exception, this
787 is treated as a failure.
834 is treated as a failure.
788
835
789
836
790 ``http_proxy``
837 ``http_proxy``
791 """"""""""""""
838 """"""""""""""
792
839
793 Used to access web-based Mercurial repositories through a HTTP
840 Used to access web-based Mercurial repositories through a HTTP
794 proxy.
841 proxy.
795
842
796 ``host``
843 ``host``
797 Host name and (optional) port of the proxy server, for example
844 Host name and (optional) port of the proxy server, for example
798 "myproxy:8000".
845 "myproxy:8000".
846
799 ``no``
847 ``no``
800 Optional. Comma-separated list of host names that should bypass
848 Optional. Comma-separated list of host names that should bypass
801 the proxy.
849 the proxy.
850
802 ``passwd``
851 ``passwd``
803 Optional. Password to authenticate with at the proxy server.
852 Optional. Password to authenticate with at the proxy server.
853
804 ``user``
854 ``user``
805 Optional. User name to authenticate with at the proxy server.
855 Optional. User name to authenticate with at the proxy server.
856
806 ``always``
857 ``always``
807 Optional. Always use the proxy, even for localhost and any entries
858 Optional. Always use the proxy, even for localhost and any entries
808 in ``http_proxy.no``. True or False. Default: False.
859 in ``http_proxy.no``. True or False. Default: False.
809
860
810 ``smtp``
861 ``smtp``
811 """"""""
862 """"""""
812
863
813 Configuration for extensions that need to send email messages.
864 Configuration for extensions that need to send email messages.
814
865
815 ``host``
866 ``host``
816 Host name of mail server, e.g. "mail.example.com".
867 Host name of mail server, e.g. "mail.example.com".
868
817 ``port``
869 ``port``
818 Optional. Port to connect to on mail server. Default: 25.
870 Optional. Port to connect to on mail server. Default: 25.
871
819 ``tls``
872 ``tls``
820 Optional. Method to enable TLS when connecting to mail server: starttls,
873 Optional. Method to enable TLS when connecting to mail server: starttls,
821 smtps or none. Default: none.
874 smtps or none. Default: none.
875
822 ``username``
876 ``username``
823 Optional. User name for authenticating with the SMTP server.
877 Optional. User name for authenticating with the SMTP server.
824 Default: none.
878 Default: none.
879
825 ``password``
880 ``password``
826 Optional. Password for authenticating with the SMTP server. If not
881 Optional. Password for authenticating with the SMTP server. If not
827 specified, interactive sessions will prompt the user for a
882 specified, interactive sessions will prompt the user for a
828 password; non-interactive sessions will fail. Default: none.
883 password; non-interactive sessions will fail. Default: none.
884
829 ``local_hostname``
885 ``local_hostname``
830 Optional. It's the hostname that the sender can use to identify
886 Optional. It's the hostname that the sender can use to identify
831 itself to the MTA.
887 itself to the MTA.
832
888
833
889
834 ``patch``
890 ``patch``
835 """""""""
891 """""""""
836
892
837 Settings used when applying patches, for instance through the 'import'
893 Settings used when applying patches, for instance through the 'import'
838 command or with Mercurial Queues extension.
894 command or with Mercurial Queues extension.
839
895
840 ``eol``
896 ``eol``
841 When set to 'strict' patch content and patched files end of lines
897 When set to 'strict' patch content and patched files end of lines
842 are preserved. When set to ``lf`` or ``crlf``, both files end of
898 are preserved. When set to ``lf`` or ``crlf``, both files end of
843 lines are ignored when patching and the result line endings are
899 lines are ignored when patching and the result line endings are
844 normalized to either LF (Unix) or CRLF (Windows). When set to
900 normalized to either LF (Unix) or CRLF (Windows). When set to
845 ``auto``, end of lines are again ignored while patching but line
901 ``auto``, end of lines are again ignored while patching but line
846 endings in patched files are normalized to their original setting
902 endings in patched files are normalized to their original setting
847 on a per-file basis. If target file does not exist or has no end
903 on a per-file basis. If target file does not exist or has no end
848 of line, patch line endings are preserved.
904 of line, patch line endings are preserved.
849 Default: strict.
905 Default: strict.
850
906
851
907
852 ``paths``
908 ``paths``
853 """""""""
909 """""""""
854
910
855 Assigns symbolic names to repositories. The left side is the
911 Assigns symbolic names to repositories. The left side is the
856 symbolic name, and the right gives the directory or URL that is the
912 symbolic name, and the right gives the directory or URL that is the
857 location of the repository. Default paths can be declared by setting
913 location of the repository. Default paths can be declared by setting
858 the following entries.
914 the following entries.
859
915
860 ``default``
916 ``default``
861 Directory or URL to use when pulling if no source is specified.
917 Directory or URL to use when pulling if no source is specified.
862 Default is set to repository from which the current repository was
918 Default is set to repository from which the current repository was
863 cloned.
919 cloned.
920
864 ``default-push``
921 ``default-push``
865 Optional. Directory or URL to use when pushing if no destination
922 Optional. Directory or URL to use when pushing if no destination
866 is specified.
923 is specified.
867
924
868
925
869 ``profiling``
926 ``profiling``
870 """""""""""""
927 """""""""""""
871
928
872 Specifies profiling format and file output. In this section
929 Specifies profiling format and file output. In this section
873 description, 'profiling data' stands for the raw data collected
930 description, 'profiling data' stands for the raw data collected
874 during profiling, while 'profiling report' stands for a statistical
931 during profiling, while 'profiling report' stands for a statistical
875 text report generated from the profiling data. The profiling is done
932 text report generated from the profiling data. The profiling is done
876 using lsprof.
933 using lsprof.
877
934
878 ``format``
935 ``format``
879 Profiling format.
936 Profiling format.
880 Default: text.
937 Default: text.
881
938
882 ``text``
939 ``text``
883 Generate a profiling report. When saving to a file, it should be
940 Generate a profiling report. When saving to a file, it should be
884 noted that only the report is saved, and the profiling data is
941 noted that only the report is saved, and the profiling data is
885 not kept.
942 not kept.
886 ``kcachegrind``
943 ``kcachegrind``
887 Format profiling data for kcachegrind use: when saving to a
944 Format profiling data for kcachegrind use: when saving to a
888 file, the generated file can directly be loaded into
945 file, the generated file can directly be loaded into
889 kcachegrind.
946 kcachegrind.
947
890 ``output``
948 ``output``
891 File path where profiling data or report should be saved. If the
949 File path where profiling data or report should be saved. If the
892 file exists, it is replaced. Default: None, data is printed on
950 file exists, it is replaced. Default: None, data is printed on
893 stderr
951 stderr
894
952
895 ``server``
953 ``server``
896 """"""""""
954 """"""""""
897
955
898 Controls generic server settings.
956 Controls generic server settings.
899
957
900 ``uncompressed``
958 ``uncompressed``
901 Whether to allow clients to clone a repository using the
959 Whether to allow clients to clone a repository using the
902 uncompressed streaming protocol. This transfers about 40% more
960 uncompressed streaming protocol. This transfers about 40% more
903 data than a regular clone, but uses less memory and CPU on both
961 data than a regular clone, but uses less memory and CPU on both
904 server and client. Over a LAN (100 Mbps or better) or a very fast
962 server and client. Over a LAN (100 Mbps or better) or a very fast
905 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
963 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
906 regular clone. Over most WAN connections (anything slower than
964 regular clone. Over most WAN connections (anything slower than
907 about 6 Mbps), uncompressed streaming is slower, because of the
965 about 6 Mbps), uncompressed streaming is slower, because of the
908 extra data transfer overhead. This mode will also temporarily hold
966 extra data transfer overhead. This mode will also temporarily hold
909 the write lock while determining what data to transfer.
967 the write lock while determining what data to transfer.
910 Default is True.
968 Default is True.
911
969
912 ``validate``
970 ``validate``
913 Whether to validate the completeness of pushed changesets by
971 Whether to validate the completeness of pushed changesets by
914 checking that all new file revisions specified in manifests are
972 checking that all new file revisions specified in manifests are
915 present. Default is False.
973 present. Default is False.
916
974
917 ``subpaths``
975 ``subpaths``
918 """"""""""""
976 """"""""""""
919
977
920 Defines subrepositories source locations rewriting rules of the form::
978 Defines subrepositories source locations rewriting rules of the form::
921
979
922 <pattern> = <replacement>
980 <pattern> = <replacement>
923
981
924 Where ``pattern`` is a regular expression matching the source and
982 Where ``pattern`` is a regular expression matching the source and
925 ``replacement`` is the replacement string used to rewrite it. Groups
983 ``replacement`` is the replacement string used to rewrite it. Groups
926 can be matched in ``pattern`` and referenced in ``replacements``. For
984 can be matched in ``pattern`` and referenced in ``replacements``. For
927 instance::
985 instance::
928
986
929 http://server/(.*)-hg/ = http://hg.server/\1/
987 http://server/(.*)-hg/ = http://hg.server/\1/
930
988
931 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
989 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
932
990
933 All patterns are applied in definition order.
991 All patterns are applied in definition order.
934
992
935 ``trusted``
993 ``trusted``
936 """""""""""
994 """""""""""
937
995
938 Mercurial will not use the settings in the
996 Mercurial will not use the settings in the
939 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
997 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
940 user or to a trusted group, as various hgrc features allow arbitrary
998 user or to a trusted group, as various hgrc features allow arbitrary
941 commands to be run. This issue is often encountered when configuring
999 commands to be run. This issue is often encountered when configuring
942 hooks or extensions for shared repositories or servers. However,
1000 hooks or extensions for shared repositories or servers. However,
943 the web interface will use some safe settings from the ``[web]``
1001 the web interface will use some safe settings from the ``[web]``
944 section.
1002 section.
945
1003
946 This section specifies what users and groups are trusted. The
1004 This section specifies what users and groups are trusted. The
947 current user is always trusted. To trust everybody, list a user or a
1005 current user is always trusted. To trust everybody, list a user or a
948 group with name ``*``. These settings must be placed in an
1006 group with name ``*``. These settings must be placed in an
949 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
1007 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
950 user or service running Mercurial.
1008 user or service running Mercurial.
951
1009
952 ``users``
1010 ``users``
953 Comma-separated list of trusted users.
1011 Comma-separated list of trusted users.
1012
954 ``groups``
1013 ``groups``
955 Comma-separated list of trusted groups.
1014 Comma-separated list of trusted groups.
956
1015
957
1016
958 ``ui``
1017 ``ui``
959 """"""
1018 """"""
960
1019
961 User interface controls.
1020 User interface controls.
962
1021
963 ``archivemeta``
1022 ``archivemeta``
964 Whether to include the .hg_archival.txt file containing meta data
1023 Whether to include the .hg_archival.txt file containing meta data
965 (hashes for the repository base and for tip) in archives created
1024 (hashes for the repository base and for tip) in archives created
966 by the :hg:`archive` command or downloaded via hgweb.
1025 by the :hg:`archive` command or downloaded via hgweb.
967 Default is True.
1026 Default is True.
1027
968 ``askusername``
1028 ``askusername``
969 Whether to prompt for a username when committing. If True, and
1029 Whether to prompt for a username when committing. If True, and
970 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
1030 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
971 be prompted to enter a username. If no username is entered, the
1031 be prompted to enter a username. If no username is entered, the
972 default ``USER@HOST`` is used instead.
1032 default ``USER@HOST`` is used instead.
973 Default is False.
1033 Default is False.
1034
974 ``commitsubrepos``
1035 ``commitsubrepos``
975 Whether to commit modified subrepositories when committing the
1036 Whether to commit modified subrepositories when committing the
976 parent repository. If False and one subrepository has uncommitted
1037 parent repository. If False and one subrepository has uncommitted
977 changes, abort the commit.
1038 changes, abort the commit.
978 Default is True.
1039 Default is True.
1040
979 ``debug``
1041 ``debug``
980 Print debugging information. True or False. Default is False.
1042 Print debugging information. True or False. Default is False.
1043
981 ``editor``
1044 ``editor``
982 The editor to use during a commit. Default is ``$EDITOR`` or ``vi``.
1045 The editor to use during a commit. Default is ``$EDITOR`` or ``vi``.
1046
983 ``fallbackencoding``
1047 ``fallbackencoding``
984 Encoding to try if it's not possible to decode the changelog using
1048 Encoding to try if it's not possible to decode the changelog using
985 UTF-8. Default is ISO-8859-1.
1049 UTF-8. Default is ISO-8859-1.
1050
986 ``ignore``
1051 ``ignore``
987 A file to read per-user ignore patterns from. This file should be
1052 A file to read per-user ignore patterns from. This file should be
988 in the same format as a repository-wide .hgignore file. This
1053 in the same format as a repository-wide .hgignore file. This
989 option supports hook syntax, so if you want to specify multiple
1054 option supports hook syntax, so if you want to specify multiple
990 ignore files, you can do so by setting something like
1055 ignore files, you can do so by setting something like
991 ``ignore.other = ~/.hgignore2``. For details of the ignore file
1056 ``ignore.other = ~/.hgignore2``. For details of the ignore file
992 format, see the |hgignore(5)|_ man page.
1057 format, see the |hgignore(5)|_ man page.
1058
993 ``interactive``
1059 ``interactive``
994 Allow to prompt the user. True or False. Default is True.
1060 Allow to prompt the user. True or False. Default is True.
1061
995 ``logtemplate``
1062 ``logtemplate``
996 Template string for commands that print changesets.
1063 Template string for commands that print changesets.
1064
997 ``merge``
1065 ``merge``
998 The conflict resolution program to use during a manual merge.
1066 The conflict resolution program to use during a manual merge.
999 For more information on merge tools see :hg:`help merge-tools`.
1067 For more information on merge tools see :hg:`help merge-tools`.
1000 For configuring merge tools see the merge-tools_ section.
1068 For configuring merge tools see the merge-tools_ section.
1069
1001 ``portablefilenames``
1070 ``portablefilenames``
1002 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
1071 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
1003 Default is ``warn``.
1072 Default is ``warn``.
1004 If set to ``warn`` (or ``true``), a warning message is printed on POSIX
1073 If set to ``warn`` (or ``true``), a warning message is printed on POSIX
1005 platforms, if a file with a non-portable filename is added (e.g. a file
1074 platforms, if a file with a non-portable filename is added (e.g. a file
1006 with a name that can't be created on Windows because it contains reserved
1075 with a name that can't be created on Windows because it contains reserved
1007 parts like ``AUX``, reserved characters like ``:``, or would cause a case
1076 parts like ``AUX``, reserved characters like ``:``, or would cause a case
1008 collision with an existing file).
1077 collision with an existing file).
1009 If set to ``ignore`` (or ``false``), no warning is printed.
1078 If set to ``ignore`` (or ``false``), no warning is printed.
1010 If set to ``abort``, the command is aborted.
1079 If set to ``abort``, the command is aborted.
1011 On Windows, this configuration option is ignored and the command aborted.
1080 On Windows, this configuration option is ignored and the command aborted.
1081
1012 ``quiet``
1082 ``quiet``
1013 Reduce the amount of output printed. True or False. Default is False.
1083 Reduce the amount of output printed. True or False. Default is False.
1084
1014 ``remotecmd``
1085 ``remotecmd``
1015 remote command to use for clone/push/pull operations. Default is ``hg``.
1086 remote command to use for clone/push/pull operations. Default is ``hg``.
1087
1016 ``report_untrusted``
1088 ``report_untrusted``
1017 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
1089 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
1018 trusted user or group. True or False. Default is True.
1090 trusted user or group. True or False. Default is True.
1091
1019 ``slash``
1092 ``slash``
1020 Display paths using a slash (``/``) as the path separator. This
1093 Display paths using a slash (``/``) as the path separator. This
1021 only makes a difference on systems where the default path
1094 only makes a difference on systems where the default path
1022 separator is not the slash character (e.g. Windows uses the
1095 separator is not the slash character (e.g. Windows uses the
1023 backslash character (``\``)).
1096 backslash character (``\``)).
1024 Default is False.
1097 Default is False.
1098
1025 ``ssh``
1099 ``ssh``
1026 command to use for SSH connections. Default is ``ssh``.
1100 command to use for SSH connections. Default is ``ssh``.
1101
1027 ``strict``
1102 ``strict``
1028 Require exact command names, instead of allowing unambiguous
1103 Require exact command names, instead of allowing unambiguous
1029 abbreviations. True or False. Default is False.
1104 abbreviations. True or False. Default is False.
1105
1030 ``style``
1106 ``style``
1031 Name of style to use for command output.
1107 Name of style to use for command output.
1108
1032 ``timeout``
1109 ``timeout``
1033 The timeout used when a lock is held (in seconds), a negative value
1110 The timeout used when a lock is held (in seconds), a negative value
1034 means no timeout. Default is 600.
1111 means no timeout. Default is 600.
1112
1035 ``traceback``
1113 ``traceback``
1036 Mercurial always prints a traceback when an unknown exception
1114 Mercurial always prints a traceback when an unknown exception
1037 occurs. Setting this to True will make Mercurial print a traceback
1115 occurs. Setting this to True will make Mercurial print a traceback
1038 on all exceptions, even those recognized by Mercurial (such as
1116 on all exceptions, even those recognized by Mercurial (such as
1039 IOError or MemoryError). Default is False.
1117 IOError or MemoryError). Default is False.
1118
1040 ``username``
1119 ``username``
1041 The committer of a changeset created when running "commit".
1120 The committer of a changeset created when running "commit".
1042 Typically a person's name and email address, e.g. ``Fred Widget
1121 Typically a person's name and email address, e.g. ``Fred Widget
1043 <fred@example.com>``. Default is ``$EMAIL`` or ``username@hostname``. If
1122 <fred@example.com>``. Default is ``$EMAIL`` or ``username@hostname``. If
1044 the username in hgrc is empty, it has to be specified manually or
1123 the username in hgrc is empty, it has to be specified manually or
1045 in a different hgrc file (e.g. ``$HOME/.hgrc``, if the admin set
1124 in a different hgrc file (e.g. ``$HOME/.hgrc``, if the admin set
1046 ``username =`` in the system hgrc). Environment variables in the
1125 ``username =`` in the system hgrc). Environment variables in the
1047 username are expanded.
1126 username are expanded.
1127
1048 ``verbose``
1128 ``verbose``
1049 Increase the amount of output printed. True or False. Default is False.
1129 Increase the amount of output printed. True or False. Default is False.
1050
1130
1051
1131
1052 ``web``
1132 ``web``
1053 """""""
1133 """""""
1054
1134
1055 Web interface configuration. The settings in this section apply to
1135 Web interface configuration. The settings in this section apply to
1056 both the builtin webserver (started by :hg:`serve`) and the script you
1136 both the builtin webserver (started by :hg:`serve`) and the script you
1057 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
1137 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
1058 and WSGI).
1138 and WSGI).
1059
1139
1060 The Mercurial webserver does no authentication (it does not prompt for
1140 The Mercurial webserver does no authentication (it does not prompt for
1061 usernames and passwords to validate *who* users are), but it does do
1141 usernames and passwords to validate *who* users are), but it does do
1062 authorization (it grants or denies access for *authenticated users*
1142 authorization (it grants or denies access for *authenticated users*
1063 based on settings in this section). You must either configure your
1143 based on settings in this section). You must either configure your
1064 webserver to do authentication for you, or disable the authorization
1144 webserver to do authentication for you, or disable the authorization
1065 checks.
1145 checks.
1066
1146
1067 For a quick setup in a trusted environment, e.g., a private LAN, where
1147 For a quick setup in a trusted environment, e.g., a private LAN, where
1068 you want it to accept pushes from anybody, you can use the following
1148 you want it to accept pushes from anybody, you can use the following
1069 command line::
1149 command line::
1070
1150
1071 $ hg --config web.allow_push=* --config web.push_ssl=False serve
1151 $ hg --config web.allow_push=* --config web.push_ssl=False serve
1072
1152
1073 Note that this will allow anybody to push anything to the server and
1153 Note that this will allow anybody to push anything to the server and
1074 that this should not be used for public servers.
1154 that this should not be used for public servers.
1075
1155
1076 The full set of options is:
1156 The full set of options is:
1077
1157
1078 ``accesslog``
1158 ``accesslog``
1079 Where to output the access log. Default is stdout.
1159 Where to output the access log. Default is stdout.
1160
1080 ``address``
1161 ``address``
1081 Interface address to bind to. Default is all.
1162 Interface address to bind to. Default is all.
1163
1082 ``allow_archive``
1164 ``allow_archive``
1083 List of archive format (bz2, gz, zip) allowed for downloading.
1165 List of archive format (bz2, gz, zip) allowed for downloading.
1084 Default is empty.
1166 Default is empty.
1167
1085 ``allowbz2``
1168 ``allowbz2``
1086 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
1169 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
1087 revisions.
1170 revisions.
1088 Default is False.
1171 Default is False.
1172
1089 ``allowgz``
1173 ``allowgz``
1090 (DEPRECATED) Whether to allow .tar.gz downloading of repository
1174 (DEPRECATED) Whether to allow .tar.gz downloading of repository
1091 revisions.
1175 revisions.
1092 Default is False.
1176 Default is False.
1177
1093 ``allowpull``
1178 ``allowpull``
1094 Whether to allow pulling from the repository. Default is True.
1179 Whether to allow pulling from the repository. Default is True.
1180
1095 ``allow_push``
1181 ``allow_push``
1096 Whether to allow pushing to the repository. If empty or not set,
1182 Whether to allow pushing to the repository. If empty or not set,
1097 push is not allowed. If the special value ``*``, any remote user can
1183 push is not allowed. If the special value ``*``, any remote user can
1098 push, including unauthenticated users. Otherwise, the remote user
1184 push, including unauthenticated users. Otherwise, the remote user
1099 must have been authenticated, and the authenticated user name must
1185 must have been authenticated, and the authenticated user name must
1100 be present in this list. The contents of the allow_push list are
1186 be present in this list. The contents of the allow_push list are
1101 examined after the deny_push list.
1187 examined after the deny_push list.
1188
1102 ``allow_read``
1189 ``allow_read``
1103 If the user has not already been denied repository access due to
1190 If the user has not already been denied repository access due to
1104 the contents of deny_read, this list determines whether to grant
1191 the contents of deny_read, this list determines whether to grant
1105 repository access to the user. If this list is not empty, and the
1192 repository access to the user. If this list is not empty, and the
1106 user is unauthenticated or not present in the list, then access is
1193 user is unauthenticated or not present in the list, then access is
1107 denied for the user. If the list is empty or not set, then access
1194 denied for the user. If the list is empty or not set, then access
1108 is permitted to all users by default. Setting allow_read to the
1195 is permitted to all users by default. Setting allow_read to the
1109 special value ``*`` is equivalent to it not being set (i.e. access
1196 special value ``*`` is equivalent to it not being set (i.e. access
1110 is permitted to all users). The contents of the allow_read list are
1197 is permitted to all users). The contents of the allow_read list are
1111 examined after the deny_read list.
1198 examined after the deny_read list.
1199
1112 ``allowzip``
1200 ``allowzip``
1113 (DEPRECATED) Whether to allow .zip downloading of repository
1201 (DEPRECATED) Whether to allow .zip downloading of repository
1114 revisions. Default is False. This feature creates temporary files.
1202 revisions. Default is False. This feature creates temporary files.
1203
1115 ``baseurl``
1204 ``baseurl``
1116 Base URL to use when publishing URLs in other locations, so
1205 Base URL to use when publishing URLs in other locations, so
1117 third-party tools like email notification hooks can construct
1206 third-party tools like email notification hooks can construct
1118 URLs. Example: ``http://hgserver/repos/``.
1207 URLs. Example: ``http://hgserver/repos/``.
1208
1119 ``cacerts``
1209 ``cacerts``
1120 Path to file containing a list of PEM encoded certificate
1210 Path to file containing a list of PEM encoded certificate
1121 authority certificates. Environment variables and ``~user``
1211 authority certificates. Environment variables and ``~user``
1122 constructs are expanded in the filename. If specified on the
1212 constructs are expanded in the filename. If specified on the
1123 client, then it will verify the identity of remote HTTPS servers
1213 client, then it will verify the identity of remote HTTPS servers
1124 with these certificates. The form must be as follows::
1214 with these certificates. The form must be as follows::
1125
1215
1126 -----BEGIN CERTIFICATE-----
1216 -----BEGIN CERTIFICATE-----
1127 ... (certificate in base64 PEM encoding) ...
1217 ... (certificate in base64 PEM encoding) ...
1128 -----END CERTIFICATE-----
1218 -----END CERTIFICATE-----
1129 -----BEGIN CERTIFICATE-----
1219 -----BEGIN CERTIFICATE-----
1130 ... (certificate in base64 PEM encoding) ...
1220 ... (certificate in base64 PEM encoding) ...
1131 -----END CERTIFICATE-----
1221 -----END CERTIFICATE-----
1132
1222
1133 This feature is only supported when using Python 2.6 or later. If you wish
1223 This feature is only supported when using Python 2.6 or later. If you wish
1134 to use it with earlier versions of Python, install the backported
1224 to use it with earlier versions of Python, install the backported
1135 version of the ssl library that is available from
1225 version of the ssl library that is available from
1136 ``http://pypi.python.org``.
1226 ``http://pypi.python.org``.
1137
1227
1138 You can use OpenSSL's CA certificate file if your platform has one.
1228 You can use OpenSSL's CA certificate file if your platform has one.
1139 On most Linux systems this will be ``/etc/ssl/certs/ca-certificates.crt``.
1229 On most Linux systems this will be ``/etc/ssl/certs/ca-certificates.crt``.
1140 Otherwise you will have to generate this file manually.
1230 Otherwise you will have to generate this file manually.
1141
1231
1142 To disable SSL verification temporarily, specify ``--insecure`` from
1232 To disable SSL verification temporarily, specify ``--insecure`` from
1143 command line.
1233 command line.
1144
1234
1145 ``cache``
1235 ``cache``
1146 Whether to support caching in hgweb. Defaults to True.
1236 Whether to support caching in hgweb. Defaults to True.
1237
1147 ``contact``
1238 ``contact``
1148 Name or email address of the person in charge of the repository.
1239 Name or email address of the person in charge of the repository.
1149 Defaults to ui.username or ``$EMAIL`` or "unknown" if unset or empty.
1240 Defaults to ui.username or ``$EMAIL`` or "unknown" if unset or empty.
1241
1150 ``deny_push``
1242 ``deny_push``
1151 Whether to deny pushing to the repository. If empty or not set,
1243 Whether to deny pushing to the repository. If empty or not set,
1152 push is not denied. If the special value ``*``, all remote users are
1244 push is not denied. If the special value ``*``, all remote users are
1153 denied push. Otherwise, unauthenticated users are all denied, and
1245 denied push. Otherwise, unauthenticated users are all denied, and
1154 any authenticated user name present in this list is also denied. The
1246 any authenticated user name present in this list is also denied. The
1155 contents of the deny_push list are examined before the allow_push list.
1247 contents of the deny_push list are examined before the allow_push list.
1248
1156 ``deny_read``
1249 ``deny_read``
1157 Whether to deny reading/viewing of the repository. If this list is
1250 Whether to deny reading/viewing of the repository. If this list is
1158 not empty, unauthenticated users are all denied, and any
1251 not empty, unauthenticated users are all denied, and any
1159 authenticated user name present in this list is also denied access to
1252 authenticated user name present in this list is also denied access to
1160 the repository. If set to the special value ``*``, all remote users
1253 the repository. If set to the special value ``*``, all remote users
1161 are denied access (rarely needed ;). If deny_read is empty or not set,
1254 are denied access (rarely needed ;). If deny_read is empty or not set,
1162 the determination of repository access depends on the presence and
1255 the determination of repository access depends on the presence and
1163 content of the allow_read list (see description). If both
1256 content of the allow_read list (see description). If both
1164 deny_read and allow_read are empty or not set, then access is
1257 deny_read and allow_read are empty or not set, then access is
1165 permitted to all users by default. If the repository is being
1258 permitted to all users by default. If the repository is being
1166 served via hgwebdir, denied users will not be able to see it in
1259 served via hgwebdir, denied users will not be able to see it in
1167 the list of repositories. The contents of the deny_read list have
1260 the list of repositories. The contents of the deny_read list have
1168 priority over (are examined before) the contents of the allow_read
1261 priority over (are examined before) the contents of the allow_read
1169 list.
1262 list.
1263
1170 ``descend``
1264 ``descend``
1171 hgwebdir indexes will not descend into subdirectories. Only repositories
1265 hgwebdir indexes will not descend into subdirectories. Only repositories
1172 directly in the current path will be shown (other repositories are still
1266 directly in the current path will be shown (other repositories are still
1173 available from the index corresponding to their containing path).
1267 available from the index corresponding to their containing path).
1268
1174 ``description``
1269 ``description``
1175 Textual description of the repository's purpose or contents.
1270 Textual description of the repository's purpose or contents.
1176 Default is "unknown".
1271 Default is "unknown".
1272
1177 ``encoding``
1273 ``encoding``
1178 Character encoding name. Default is the current locale charset.
1274 Character encoding name. Default is the current locale charset.
1179 Example: "UTF-8"
1275 Example: "UTF-8"
1276
1180 ``errorlog``
1277 ``errorlog``
1181 Where to output the error log. Default is stderr.
1278 Where to output the error log. Default is stderr.
1279
1182 ``hidden``
1280 ``hidden``
1183 Whether to hide the repository in the hgwebdir index.
1281 Whether to hide the repository in the hgwebdir index.
1184 Default is False.
1282 Default is False.
1283
1185 ``ipv6``
1284 ``ipv6``
1186 Whether to use IPv6. Default is False.
1285 Whether to use IPv6. Default is False.
1286
1187 ``logourl``
1287 ``logourl``
1188 Base URL to use for logos. If unset, ``http://mercurial.selenic.com/``
1288 Base URL to use for logos. If unset, ``http://mercurial.selenic.com/``
1189 will be used.
1289 will be used.
1290
1190 ``name``
1291 ``name``
1191 Repository name to use in the web interface. Default is current
1292 Repository name to use in the web interface. Default is current
1192 working directory.
1293 working directory.
1294
1193 ``maxchanges``
1295 ``maxchanges``
1194 Maximum number of changes to list on the changelog. Default is 10.
1296 Maximum number of changes to list on the changelog. Default is 10.
1297
1195 ``maxfiles``
1298 ``maxfiles``
1196 Maximum number of files to list per changeset. Default is 10.
1299 Maximum number of files to list per changeset. Default is 10.
1300
1197 ``port``
1301 ``port``
1198 Port to listen on. Default is 8000.
1302 Port to listen on. Default is 8000.
1303
1199 ``prefix``
1304 ``prefix``
1200 Prefix path to serve from. Default is '' (server root).
1305 Prefix path to serve from. Default is '' (server root).
1306
1201 ``push_ssl``
1307 ``push_ssl``
1202 Whether to require that inbound pushes be transported over SSL to
1308 Whether to require that inbound pushes be transported over SSL to
1203 prevent password sniffing. Default is True.
1309 prevent password sniffing. Default is True.
1310
1204 ``staticurl``
1311 ``staticurl``
1205 Base URL to use for static files. If unset, static files (e.g. the
1312 Base URL to use for static files. If unset, static files (e.g. the
1206 hgicon.png favicon) will be served by the CGI script itself. Use
1313 hgicon.png favicon) will be served by the CGI script itself. Use
1207 this setting to serve them directly with the HTTP server.
1314 this setting to serve them directly with the HTTP server.
1208 Example: ``http://hgserver/static/``.
1315 Example: ``http://hgserver/static/``.
1316
1209 ``stripes``
1317 ``stripes``
1210 How many lines a "zebra stripe" should span in multiline output.
1318 How many lines a "zebra stripe" should span in multiline output.
1211 Default is 1; set to 0 to disable.
1319 Default is 1; set to 0 to disable.
1320
1212 ``style``
1321 ``style``
1213 Which template map style to use.
1322 Which template map style to use.
1323
1214 ``templates``
1324 ``templates``
1215 Where to find the HTML templates. Default is install path.
1325 Where to find the HTML templates. Default is install path.
General Comments 0
You need to be logged in to leave comments. Login now