##// END OF EJS Templates
windows: add a global equivalent to /etc/mercurial for *.rc processing...
Matt Harbison -
r44403:1ccf340a default
parent child Browse files
Show More
@@ -1,2876 +1,2879 b''
1 The Mercurial system uses a set of configuration files to control
1 The Mercurial system uses a set of configuration files to control
2 aspects of its behavior.
2 aspects of its behavior.
3
3
4 Troubleshooting
4 Troubleshooting
5 ===============
5 ===============
6
6
7 If you're having problems with your configuration,
7 If you're having problems with your configuration,
8 :hg:`config --debug` can help you understand what is introducing
8 :hg:`config --debug` can help you understand what is introducing
9 a setting into your environment.
9 a setting into your environment.
10
10
11 See :hg:`help config.syntax` and :hg:`help config.files`
11 See :hg:`help config.syntax` and :hg:`help config.files`
12 for information about how and where to override things.
12 for information about how and where to override things.
13
13
14 Structure
14 Structure
15 =========
15 =========
16
16
17 The configuration files use a simple ini-file format. A configuration
17 The configuration files use a simple ini-file format. A configuration
18 file consists of sections, led by a ``[section]`` header and followed
18 file consists of sections, led by a ``[section]`` header and followed
19 by ``name = value`` entries::
19 by ``name = value`` entries::
20
20
21 [ui]
21 [ui]
22 username = Firstname Lastname <firstname.lastname@example.net>
22 username = Firstname Lastname <firstname.lastname@example.net>
23 verbose = True
23 verbose = True
24
24
25 The above entries will be referred to as ``ui.username`` and
25 The above entries will be referred to as ``ui.username`` and
26 ``ui.verbose``, respectively. See :hg:`help config.syntax`.
26 ``ui.verbose``, respectively. See :hg:`help config.syntax`.
27
27
28 Files
28 Files
29 =====
29 =====
30
30
31 Mercurial reads configuration data from several files, if they exist.
31 Mercurial reads configuration data from several files, if they exist.
32 These files do not exist by default and you will have to create the
32 These files do not exist by default and you will have to create the
33 appropriate configuration files yourself:
33 appropriate configuration files yourself:
34
34
35 Local configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
35 Local configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
36
36
37 Global configuration like the username setting is typically put into:
37 Global configuration like the username setting is typically put into:
38
38
39 .. container:: windows
39 .. container:: windows
40
40
41 - ``%USERPROFILE%\mercurial.ini`` (on Windows)
41 - ``%USERPROFILE%\mercurial.ini`` (on Windows)
42
42
43 .. container:: unix.plan9
43 .. container:: unix.plan9
44
44
45 - ``$HOME/.hgrc`` (on Unix, Plan9)
45 - ``$HOME/.hgrc`` (on Unix, Plan9)
46
46
47 The names of these files depend on the system on which Mercurial is
47 The names of these files depend on the system on which Mercurial is
48 installed. ``*.rc`` files from a single directory are read in
48 installed. ``*.rc`` files from a single directory are read in
49 alphabetical order, later ones overriding earlier ones. Where multiple
49 alphabetical order, later ones overriding earlier ones. Where multiple
50 paths are given below, settings from earlier paths override later
50 paths are given below, settings from earlier paths override later
51 ones.
51 ones.
52
52
53 .. container:: verbose.unix
53 .. container:: verbose.unix
54
54
55 On Unix, the following files are consulted:
55 On Unix, the following files are consulted:
56
56
57 - ``<repo>/.hg/hgrc`` (per-repository)
57 - ``<repo>/.hg/hgrc`` (per-repository)
58 - ``$HOME/.hgrc`` (per-user)
58 - ``$HOME/.hgrc`` (per-user)
59 - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user)
59 - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user)
60 - ``<install-root>/etc/mercurial/hgrc`` (per-installation)
60 - ``<install-root>/etc/mercurial/hgrc`` (per-installation)
61 - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
61 - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
62 - ``/etc/mercurial/hgrc`` (per-system)
62 - ``/etc/mercurial/hgrc`` (per-system)
63 - ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
63 - ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
64 - ``<internal>/*.rc`` (defaults)
64 - ``<internal>/*.rc`` (defaults)
65
65
66 .. container:: verbose.windows
66 .. container:: verbose.windows
67
67
68 On Windows, the following files are consulted:
68 On Windows, the following files are consulted:
69
69
70 - ``<repo>/.hg/hgrc`` (per-repository)
70 - ``<repo>/.hg/hgrc`` (per-repository)
71 - ``%USERPROFILE%\.hgrc`` (per-user)
71 - ``%USERPROFILE%\.hgrc`` (per-user)
72 - ``%USERPROFILE%\Mercurial.ini`` (per-user)
72 - ``%USERPROFILE%\Mercurial.ini`` (per-user)
73 - ``%HOME%\.hgrc`` (per-user)
73 - ``%HOME%\.hgrc`` (per-user)
74 - ``%HOME%\Mercurial.ini`` (per-user)
74 - ``%HOME%\Mercurial.ini`` (per-user)
75 - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation)
75 - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation)
76 - ``<install-dir>\hgrc.d\*.rc`` (per-installation)
76 - ``<install-dir>\hgrc.d\*.rc`` (per-installation)
77 - ``<install-dir>\Mercurial.ini`` (per-installation)
77 - ``<install-dir>\Mercurial.ini`` (per-installation)
78 - ``%PROGRAMDATA%\Mercurial\hgrc`` (per-system)
79 - ``%PROGRAMDATA%\Mercurial\Mercurial.ini`` (per-system)
80 - ``%PROGRAMDATA%\Mercurial\hgrc.d\*.rc`` (per-system)
78 - ``<internal>/*.rc`` (defaults)
81 - ``<internal>/*.rc`` (defaults)
79
82
80 .. note::
83 .. note::
81
84
82 The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
85 The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
83 is used when running 32-bit Python on 64-bit Windows.
86 is used when running 32-bit Python on 64-bit Windows.
84
87
85 .. container:: windows
88 .. container:: windows
86
89
87 On Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``.
90 On Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``.
88
91
89 .. container:: verbose.plan9
92 .. container:: verbose.plan9
90
93
91 On Plan9, the following files are consulted:
94 On Plan9, the following files are consulted:
92
95
93 - ``<repo>/.hg/hgrc`` (per-repository)
96 - ``<repo>/.hg/hgrc`` (per-repository)
94 - ``$home/lib/hgrc`` (per-user)
97 - ``$home/lib/hgrc`` (per-user)
95 - ``<install-root>/lib/mercurial/hgrc`` (per-installation)
98 - ``<install-root>/lib/mercurial/hgrc`` (per-installation)
96 - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
99 - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
97 - ``/lib/mercurial/hgrc`` (per-system)
100 - ``/lib/mercurial/hgrc`` (per-system)
98 - ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
101 - ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
99 - ``<internal>/*.rc`` (defaults)
102 - ``<internal>/*.rc`` (defaults)
100
103
101 Per-repository configuration options only apply in a
104 Per-repository configuration options only apply in a
102 particular repository. This file is not version-controlled, and
105 particular repository. This file is not version-controlled, and
103 will not get transferred during a "clone" operation. Options in
106 will not get transferred during a "clone" operation. Options in
104 this file override options in all other configuration files.
107 this file override options in all other configuration files.
105
108
106 .. container:: unix.plan9
109 .. container:: unix.plan9
107
110
108 On Plan 9 and Unix, most of this file will be ignored if it doesn't
111 On Plan 9 and Unix, most of this file will be ignored if it doesn't
109 belong to a trusted user or to a trusted group. See
112 belong to a trusted user or to a trusted group. See
110 :hg:`help config.trusted` for more details.
113 :hg:`help config.trusted` for more details.
111
114
112 Per-user configuration file(s) are for the user running Mercurial. Options
115 Per-user configuration file(s) are for the user running Mercurial. Options
113 in these files apply to all Mercurial commands executed by this user in any
116 in these files apply to all Mercurial commands executed by this user in any
114 directory. Options in these files override per-system and per-installation
117 directory. Options in these files override per-system and per-installation
115 options.
118 options.
116
119
117 Per-installation configuration files are searched for in the
120 Per-installation configuration files are searched for in the
118 directory where Mercurial is installed. ``<install-root>`` is the
121 directory where Mercurial is installed. ``<install-root>`` is the
119 parent directory of the **hg** executable (or symlink) being run.
122 parent directory of the **hg** executable (or symlink) being run.
120
123
121 .. container:: unix.plan9
124 .. container:: unix.plan9
122
125
123 For example, if installed in ``/shared/tools/bin/hg``, Mercurial
126 For example, if installed in ``/shared/tools/bin/hg``, Mercurial
124 will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these
127 will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these
125 files apply to all Mercurial commands executed by any user in any
128 files apply to all Mercurial commands executed by any user in any
126 directory.
129 directory.
127
130
128 Per-installation configuration files are for the system on
131 Per-installation configuration files are for the system on
129 which Mercurial is running. Options in these files apply to all
132 which Mercurial is running. Options in these files apply to all
130 Mercurial commands executed by any user in any directory. Registry
133 Mercurial commands executed by any user in any directory. Registry
131 keys contain PATH-like strings, every part of which must reference
134 keys contain PATH-like strings, every part of which must reference
132 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
135 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
133 be read. Mercurial checks each of these locations in the specified
136 be read. Mercurial checks each of these locations in the specified
134 order until one or more configuration files are detected.
137 order until one or more configuration files are detected.
135
138
136 Per-system configuration files are for the system on which Mercurial
139 Per-system configuration files are for the system on which Mercurial
137 is running. Options in these files apply to all Mercurial commands
140 is running. Options in these files apply to all Mercurial commands
138 executed by any user in any directory. Options in these files
141 executed by any user in any directory. Options in these files
139 override per-installation options.
142 override per-installation options.
140
143
141 Mercurial comes with some default configuration. The default configuration
144 Mercurial comes with some default configuration. The default configuration
142 files are installed with Mercurial and will be overwritten on upgrades. Default
145 files are installed with Mercurial and will be overwritten on upgrades. Default
143 configuration files should never be edited by users or administrators but can
146 configuration files should never be edited by users or administrators but can
144 be overridden in other configuration files. So far the directory only contains
147 be overridden in other configuration files. So far the directory only contains
145 merge tool configuration but packagers can also put other default configuration
148 merge tool configuration but packagers can also put other default configuration
146 there.
149 there.
147
150
148 Syntax
151 Syntax
149 ======
152 ======
150
153
151 A configuration file consists of sections, led by a ``[section]`` header
154 A configuration file consists of sections, led by a ``[section]`` header
152 and followed by ``name = value`` entries (sometimes called
155 and followed by ``name = value`` entries (sometimes called
153 ``configuration keys``)::
156 ``configuration keys``)::
154
157
155 [spam]
158 [spam]
156 eggs=ham
159 eggs=ham
157 green=
160 green=
158 eggs
161 eggs
159
162
160 Each line contains one entry. If the lines that follow are indented,
163 Each line contains one entry. If the lines that follow are indented,
161 they are treated as continuations of that entry. Leading whitespace is
164 they are treated as continuations of that entry. Leading whitespace is
162 removed from values. Empty lines are skipped. Lines beginning with
165 removed from values. Empty lines are skipped. Lines beginning with
163 ``#`` or ``;`` are ignored and may be used to provide comments.
166 ``#`` or ``;`` are ignored and may be used to provide comments.
164
167
165 Configuration keys can be set multiple times, in which case Mercurial
168 Configuration keys can be set multiple times, in which case Mercurial
166 will use the value that was configured last. As an example::
169 will use the value that was configured last. As an example::
167
170
168 [spam]
171 [spam]
169 eggs=large
172 eggs=large
170 ham=serrano
173 ham=serrano
171 eggs=small
174 eggs=small
172
175
173 This would set the configuration key named ``eggs`` to ``small``.
176 This would set the configuration key named ``eggs`` to ``small``.
174
177
175 It is also possible to define a section multiple times. A section can
178 It is also possible to define a section multiple times. A section can
176 be redefined on the same and/or on different configuration files. For
179 be redefined on the same and/or on different configuration files. For
177 example::
180 example::
178
181
179 [foo]
182 [foo]
180 eggs=large
183 eggs=large
181 ham=serrano
184 ham=serrano
182 eggs=small
185 eggs=small
183
186
184 [bar]
187 [bar]
185 eggs=ham
188 eggs=ham
186 green=
189 green=
187 eggs
190 eggs
188
191
189 [foo]
192 [foo]
190 ham=prosciutto
193 ham=prosciutto
191 eggs=medium
194 eggs=medium
192 bread=toasted
195 bread=toasted
193
196
194 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
197 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
195 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
198 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
196 respectively. As you can see there only thing that matters is the last
199 respectively. As you can see there only thing that matters is the last
197 value that was set for each of the configuration keys.
200 value that was set for each of the configuration keys.
198
201
199 If a configuration key is set multiple times in different
202 If a configuration key is set multiple times in different
200 configuration files the final value will depend on the order in which
203 configuration files the final value will depend on the order in which
201 the different configuration files are read, with settings from earlier
204 the different configuration files are read, with settings from earlier
202 paths overriding later ones as described on the ``Files`` section
205 paths overriding later ones as described on the ``Files`` section
203 above.
206 above.
204
207
205 A line of the form ``%include file`` will include ``file`` into the
208 A line of the form ``%include file`` will include ``file`` into the
206 current configuration file. The inclusion is recursive, which means
209 current configuration file. The inclusion is recursive, which means
207 that included files can include other files. Filenames are relative to
210 that included files can include other files. Filenames are relative to
208 the configuration file in which the ``%include`` directive is found.
211 the configuration file in which the ``%include`` directive is found.
209 Environment variables and ``~user`` constructs are expanded in
212 Environment variables and ``~user`` constructs are expanded in
210 ``file``. This lets you do something like::
213 ``file``. This lets you do something like::
211
214
212 %include ~/.hgrc.d/$HOST.rc
215 %include ~/.hgrc.d/$HOST.rc
213
216
214 to include a different configuration file on each computer you use.
217 to include a different configuration file on each computer you use.
215
218
216 A line with ``%unset name`` will remove ``name`` from the current
219 A line with ``%unset name`` will remove ``name`` from the current
217 section, if it has been set previously.
220 section, if it has been set previously.
218
221
219 The values are either free-form text strings, lists of text strings,
222 The values are either free-form text strings, lists of text strings,
220 or Boolean values. Boolean values can be set to true using any of "1",
223 or Boolean values. Boolean values can be set to true using any of "1",
221 "yes", "true", or "on" and to false using "0", "no", "false", or "off"
224 "yes", "true", or "on" and to false using "0", "no", "false", or "off"
222 (all case insensitive).
225 (all case insensitive).
223
226
224 List values are separated by whitespace or comma, except when values are
227 List values are separated by whitespace or comma, except when values are
225 placed in double quotation marks::
228 placed in double quotation marks::
226
229
227 allow_read = "John Doe, PhD", brian, betty
230 allow_read = "John Doe, PhD", brian, betty
228
231
229 Quotation marks can be escaped by prefixing them with a backslash. Only
232 Quotation marks can be escaped by prefixing them with a backslash. Only
230 quotation marks at the beginning of a word is counted as a quotation
233 quotation marks at the beginning of a word is counted as a quotation
231 (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
234 (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
232
235
233 Sections
236 Sections
234 ========
237 ========
235
238
236 This section describes the different sections that may appear in a
239 This section describes the different sections that may appear in a
237 Mercurial configuration file, the purpose of each section, its possible
240 Mercurial configuration file, the purpose of each section, its possible
238 keys, and their possible values.
241 keys, and their possible values.
239
242
240 ``alias``
243 ``alias``
241 ---------
244 ---------
242
245
243 Defines command aliases.
246 Defines command aliases.
244
247
245 Aliases allow you to define your own commands in terms of other
248 Aliases allow you to define your own commands in terms of other
246 commands (or aliases), optionally including arguments. Positional
249 commands (or aliases), optionally including arguments. Positional
247 arguments in the form of ``$1``, ``$2``, etc. in the alias definition
250 arguments in the form of ``$1``, ``$2``, etc. in the alias definition
248 are expanded by Mercurial before execution. Positional arguments not
251 are expanded by Mercurial before execution. Positional arguments not
249 already used by ``$N`` in the definition are put at the end of the
252 already used by ``$N`` in the definition are put at the end of the
250 command to be executed.
253 command to be executed.
251
254
252 Alias definitions consist of lines of the form::
255 Alias definitions consist of lines of the form::
253
256
254 <alias> = <command> [<argument>]...
257 <alias> = <command> [<argument>]...
255
258
256 For example, this definition::
259 For example, this definition::
257
260
258 latest = log --limit 5
261 latest = log --limit 5
259
262
260 creates a new command ``latest`` that shows only the five most recent
263 creates a new command ``latest`` that shows only the five most recent
261 changesets. You can define subsequent aliases using earlier ones::
264 changesets. You can define subsequent aliases using earlier ones::
262
265
263 stable5 = latest -b stable
266 stable5 = latest -b stable
264
267
265 .. note::
268 .. note::
266
269
267 It is possible to create aliases with the same names as
270 It is possible to create aliases with the same names as
268 existing commands, which will then override the original
271 existing commands, which will then override the original
269 definitions. This is almost always a bad idea!
272 definitions. This is almost always a bad idea!
270
273
271 An alias can start with an exclamation point (``!``) to make it a
274 An alias can start with an exclamation point (``!``) to make it a
272 shell alias. A shell alias is executed with the shell and will let you
275 shell alias. A shell alias is executed with the shell and will let you
273 run arbitrary commands. As an example, ::
276 run arbitrary commands. As an example, ::
274
277
275 echo = !echo $@
278 echo = !echo $@
276
279
277 will let you do ``hg echo foo`` to have ``foo`` printed in your
280 will let you do ``hg echo foo`` to have ``foo`` printed in your
278 terminal. A better example might be::
281 terminal. A better example might be::
279
282
280 purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f
283 purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f
281
284
282 which will make ``hg purge`` delete all unknown files in the
285 which will make ``hg purge`` delete all unknown files in the
283 repository in the same manner as the purge extension.
286 repository in the same manner as the purge extension.
284
287
285 Positional arguments like ``$1``, ``$2``, etc. in the alias definition
288 Positional arguments like ``$1``, ``$2``, etc. in the alias definition
286 expand to the command arguments. Unmatched arguments are
289 expand to the command arguments. Unmatched arguments are
287 removed. ``$0`` expands to the alias name and ``$@`` expands to all
290 removed. ``$0`` expands to the alias name and ``$@`` expands to all
288 arguments separated by a space. ``"$@"`` (with quotes) expands to all
291 arguments separated by a space. ``"$@"`` (with quotes) expands to all
289 arguments quoted individually and separated by a space. These expansions
292 arguments quoted individually and separated by a space. These expansions
290 happen before the command is passed to the shell.
293 happen before the command is passed to the shell.
291
294
292 Shell aliases are executed in an environment where ``$HG`` expands to
295 Shell aliases are executed in an environment where ``$HG`` expands to
293 the path of the Mercurial that was used to execute the alias. This is
296 the path of the Mercurial that was used to execute the alias. This is
294 useful when you want to call further Mercurial commands in a shell
297 useful when you want to call further Mercurial commands in a shell
295 alias, as was done above for the purge alias. In addition,
298 alias, as was done above for the purge alias. In addition,
296 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
299 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
297 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
300 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
298
301
299 .. note::
302 .. note::
300
303
301 Some global configuration options such as ``-R`` are
304 Some global configuration options such as ``-R`` are
302 processed before shell aliases and will thus not be passed to
305 processed before shell aliases and will thus not be passed to
303 aliases.
306 aliases.
304
307
305
308
306 ``annotate``
309 ``annotate``
307 ------------
310 ------------
308
311
309 Settings used when displaying file annotations. All values are
312 Settings used when displaying file annotations. All values are
310 Booleans and default to False. See :hg:`help config.diff` for
313 Booleans and default to False. See :hg:`help config.diff` for
311 related options for the diff command.
314 related options for the diff command.
312
315
313 ``ignorews``
316 ``ignorews``
314 Ignore white space when comparing lines.
317 Ignore white space when comparing lines.
315
318
316 ``ignorewseol``
319 ``ignorewseol``
317 Ignore white space at the end of a line when comparing lines.
320 Ignore white space at the end of a line when comparing lines.
318
321
319 ``ignorewsamount``
322 ``ignorewsamount``
320 Ignore changes in the amount of white space.
323 Ignore changes in the amount of white space.
321
324
322 ``ignoreblanklines``
325 ``ignoreblanklines``
323 Ignore changes whose lines are all blank.
326 Ignore changes whose lines are all blank.
324
327
325
328
326 ``auth``
329 ``auth``
327 --------
330 --------
328
331
329 Authentication credentials and other authentication-like configuration
332 Authentication credentials and other authentication-like configuration
330 for HTTP connections. This section allows you to store usernames and
333 for HTTP connections. This section allows you to store usernames and
331 passwords for use when logging *into* HTTP servers. See
334 passwords for use when logging *into* HTTP servers. See
332 :hg:`help config.web` if you want to configure *who* can login to
335 :hg:`help config.web` if you want to configure *who* can login to
333 your HTTP server.
336 your HTTP server.
334
337
335 The following options apply to all hosts.
338 The following options apply to all hosts.
336
339
337 ``cookiefile``
340 ``cookiefile``
338 Path to a file containing HTTP cookie lines. Cookies matching a
341 Path to a file containing HTTP cookie lines. Cookies matching a
339 host will be sent automatically.
342 host will be sent automatically.
340
343
341 The file format uses the Mozilla cookies.txt format, which defines cookies
344 The file format uses the Mozilla cookies.txt format, which defines cookies
342 on their own lines. Each line contains 7 fields delimited by the tab
345 on their own lines. Each line contains 7 fields delimited by the tab
343 character (domain, is_domain_cookie, path, is_secure, expires, name,
346 character (domain, is_domain_cookie, path, is_secure, expires, name,
344 value). For more info, do an Internet search for "Netscape cookies.txt
347 value). For more info, do an Internet search for "Netscape cookies.txt
345 format."
348 format."
346
349
347 Note: the cookies parser does not handle port numbers on domains. You
350 Note: the cookies parser does not handle port numbers on domains. You
348 will need to remove ports from the domain for the cookie to be recognized.
351 will need to remove ports from the domain for the cookie to be recognized.
349 This could result in a cookie being disclosed to an unwanted server.
352 This could result in a cookie being disclosed to an unwanted server.
350
353
351 The cookies file is read-only.
354 The cookies file is read-only.
352
355
353 Other options in this section are grouped by name and have the following
356 Other options in this section are grouped by name and have the following
354 format::
357 format::
355
358
356 <name>.<argument> = <value>
359 <name>.<argument> = <value>
357
360
358 where ``<name>`` is used to group arguments into authentication
361 where ``<name>`` is used to group arguments into authentication
359 entries. Example::
362 entries. Example::
360
363
361 foo.prefix = hg.intevation.de/mercurial
364 foo.prefix = hg.intevation.de/mercurial
362 foo.username = foo
365 foo.username = foo
363 foo.password = bar
366 foo.password = bar
364 foo.schemes = http https
367 foo.schemes = http https
365
368
366 bar.prefix = secure.example.org
369 bar.prefix = secure.example.org
367 bar.key = path/to/file.key
370 bar.key = path/to/file.key
368 bar.cert = path/to/file.cert
371 bar.cert = path/to/file.cert
369 bar.schemes = https
372 bar.schemes = https
370
373
371 Supported arguments:
374 Supported arguments:
372
375
373 ``prefix``
376 ``prefix``
374 Either ``*`` or a URI prefix with or without the scheme part.
377 Either ``*`` or a URI prefix with or without the scheme part.
375 The authentication entry with the longest matching prefix is used
378 The authentication entry with the longest matching prefix is used
376 (where ``*`` matches everything and counts as a match of length
379 (where ``*`` matches everything and counts as a match of length
377 1). If the prefix doesn't include a scheme, the match is performed
380 1). If the prefix doesn't include a scheme, the match is performed
378 against the URI with its scheme stripped as well, and the schemes
381 against the URI with its scheme stripped as well, and the schemes
379 argument, q.v., is then subsequently consulted.
382 argument, q.v., is then subsequently consulted.
380
383
381 ``username``
384 ``username``
382 Optional. Username to authenticate with. If not given, and the
385 Optional. Username to authenticate with. If not given, and the
383 remote site requires basic or digest authentication, the user will
386 remote site requires basic or digest authentication, the user will
384 be prompted for it. Environment variables are expanded in the
387 be prompted for it. Environment variables are expanded in the
385 username letting you do ``foo.username = $USER``. If the URI
388 username letting you do ``foo.username = $USER``. If the URI
386 includes a username, only ``[auth]`` entries with a matching
389 includes a username, only ``[auth]`` entries with a matching
387 username or without a username will be considered.
390 username or without a username will be considered.
388
391
389 ``password``
392 ``password``
390 Optional. Password to authenticate with. If not given, and the
393 Optional. Password to authenticate with. If not given, and the
391 remote site requires basic or digest authentication, the user
394 remote site requires basic or digest authentication, the user
392 will be prompted for it.
395 will be prompted for it.
393
396
394 ``key``
397 ``key``
395 Optional. PEM encoded client certificate key file. Environment
398 Optional. PEM encoded client certificate key file. Environment
396 variables are expanded in the filename.
399 variables are expanded in the filename.
397
400
398 ``cert``
401 ``cert``
399 Optional. PEM encoded client certificate chain file. Environment
402 Optional. PEM encoded client certificate chain file. Environment
400 variables are expanded in the filename.
403 variables are expanded in the filename.
401
404
402 ``schemes``
405 ``schemes``
403 Optional. Space separated list of URI schemes to use this
406 Optional. Space separated list of URI schemes to use this
404 authentication entry with. Only used if the prefix doesn't include
407 authentication entry with. Only used if the prefix doesn't include
405 a scheme. Supported schemes are http and https. They will match
408 a scheme. Supported schemes are http and https. They will match
406 static-http and static-https respectively, as well.
409 static-http and static-https respectively, as well.
407 (default: https)
410 (default: https)
408
411
409 If no suitable authentication entry is found, the user is prompted
412 If no suitable authentication entry is found, the user is prompted
410 for credentials as usual if required by the remote.
413 for credentials as usual if required by the remote.
411
414
412 ``color``
415 ``color``
413 ---------
416 ---------
414
417
415 Configure the Mercurial color mode. For details about how to define your custom
418 Configure the Mercurial color mode. For details about how to define your custom
416 effect and style see :hg:`help color`.
419 effect and style see :hg:`help color`.
417
420
418 ``mode``
421 ``mode``
419 String: control the method used to output color. One of ``auto``, ``ansi``,
422 String: control the method used to output color. One of ``auto``, ``ansi``,
420 ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
423 ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
421 use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a
424 use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a
422 terminal. Any invalid value will disable color.
425 terminal. Any invalid value will disable color.
423
426
424 ``pagermode``
427 ``pagermode``
425 String: optional override of ``color.mode`` used with pager.
428 String: optional override of ``color.mode`` used with pager.
426
429
427 On some systems, terminfo mode may cause problems when using
430 On some systems, terminfo mode may cause problems when using
428 color with ``less -R`` as a pager program. less with the -R option
431 color with ``less -R`` as a pager program. less with the -R option
429 will only display ECMA-48 color codes, and terminfo mode may sometimes
432 will only display ECMA-48 color codes, and terminfo mode may sometimes
430 emit codes that less doesn't understand. You can work around this by
433 emit codes that less doesn't understand. You can work around this by
431 either using ansi mode (or auto mode), or by using less -r (which will
434 either using ansi mode (or auto mode), or by using less -r (which will
432 pass through all terminal control codes, not just color control
435 pass through all terminal control codes, not just color control
433 codes).
436 codes).
434
437
435 On some systems (such as MSYS in Windows), the terminal may support
438 On some systems (such as MSYS in Windows), the terminal may support
436 a different color mode than the pager program.
439 a different color mode than the pager program.
437
440
438 ``commands``
441 ``commands``
439 ------------
442 ------------
440
443
441 ``commit.post-status``
444 ``commit.post-status``
442 Show status of files in the working directory after successful commit.
445 Show status of files in the working directory after successful commit.
443 (default: False)
446 (default: False)
444
447
445 ``merge.require-rev``
448 ``merge.require-rev``
446 Require that the revision to merge the current commit with be specified on
449 Require that the revision to merge the current commit with be specified on
447 the command line. If this is enabled and a revision is not specified, the
450 the command line. If this is enabled and a revision is not specified, the
448 command aborts.
451 command aborts.
449 (default: False)
452 (default: False)
450
453
451 ``push.require-revs``
454 ``push.require-revs``
452 Require revisions to push be specified using one or more mechanisms such as
455 Require revisions to push be specified using one or more mechanisms such as
453 specifying them positionally on the command line, using ``-r``, ``-b``,
456 specifying them positionally on the command line, using ``-r``, ``-b``,
454 and/or ``-B`` on the command line, or using ``paths.<path>:pushrev`` in the
457 and/or ``-B`` on the command line, or using ``paths.<path>:pushrev`` in the
455 configuration. If this is enabled and revisions are not specified, the
458 configuration. If this is enabled and revisions are not specified, the
456 command aborts.
459 command aborts.
457 (default: False)
460 (default: False)
458
461
459 ``resolve.confirm``
462 ``resolve.confirm``
460 Confirm before performing action if no filename is passed.
463 Confirm before performing action if no filename is passed.
461 (default: False)
464 (default: False)
462
465
463 ``resolve.explicit-re-merge``
466 ``resolve.explicit-re-merge``
464 Require uses of ``hg resolve`` to specify which action it should perform,
467 Require uses of ``hg resolve`` to specify which action it should perform,
465 instead of re-merging files by default.
468 instead of re-merging files by default.
466 (default: False)
469 (default: False)
467
470
468 ``resolve.mark-check``
471 ``resolve.mark-check``
469 Determines what level of checking :hg:`resolve --mark` will perform before
472 Determines what level of checking :hg:`resolve --mark` will perform before
470 marking files as resolved. Valid values are ``none`, ``warn``, and
473 marking files as resolved. Valid values are ``none`, ``warn``, and
471 ``abort``. ``warn`` will output a warning listing the file(s) that still
474 ``abort``. ``warn`` will output a warning listing the file(s) that still
472 have conflict markers in them, but will still mark everything resolved.
475 have conflict markers in them, but will still mark everything resolved.
473 ``abort`` will output the same warning but will not mark things as resolved.
476 ``abort`` will output the same warning but will not mark things as resolved.
474 If --all is passed and this is set to ``abort``, only a warning will be
477 If --all is passed and this is set to ``abort``, only a warning will be
475 shown (an error will not be raised).
478 shown (an error will not be raised).
476 (default: ``none``)
479 (default: ``none``)
477
480
478 ``status.relative``
481 ``status.relative``
479 Make paths in :hg:`status` output relative to the current directory.
482 Make paths in :hg:`status` output relative to the current directory.
480 (default: False)
483 (default: False)
481
484
482 ``status.terse``
485 ``status.terse``
483 Default value for the --terse flag, which condenses status output.
486 Default value for the --terse flag, which condenses status output.
484 (default: empty)
487 (default: empty)
485
488
486 ``update.check``
489 ``update.check``
487 Determines what level of checking :hg:`update` will perform before moving
490 Determines what level of checking :hg:`update` will perform before moving
488 to a destination revision. Valid values are ``abort``, ``none``,
491 to a destination revision. Valid values are ``abort``, ``none``,
489 ``linear``, and ``noconflict``. ``abort`` always fails if the working
492 ``linear``, and ``noconflict``. ``abort`` always fails if the working
490 directory has uncommitted changes. ``none`` performs no checking, and may
493 directory has uncommitted changes. ``none`` performs no checking, and may
491 result in a merge with uncommitted changes. ``linear`` allows any update
494 result in a merge with uncommitted changes. ``linear`` allows any update
492 as long as it follows a straight line in the revision history, and may
495 as long as it follows a straight line in the revision history, and may
493 trigger a merge with uncommitted changes. ``noconflict`` will allow any
496 trigger a merge with uncommitted changes. ``noconflict`` will allow any
494 update which would not trigger a merge with uncommitted changes, if any
497 update which would not trigger a merge with uncommitted changes, if any
495 are present.
498 are present.
496 (default: ``linear``)
499 (default: ``linear``)
497
500
498 ``update.requiredest``
501 ``update.requiredest``
499 Require that the user pass a destination when running :hg:`update`.
502 Require that the user pass a destination when running :hg:`update`.
500 For example, :hg:`update .::` will be allowed, but a plain :hg:`update`
503 For example, :hg:`update .::` will be allowed, but a plain :hg:`update`
501 will be disallowed.
504 will be disallowed.
502 (default: False)
505 (default: False)
503
506
504 ``committemplate``
507 ``committemplate``
505 ------------------
508 ------------------
506
509
507 ``changeset``
510 ``changeset``
508 String: configuration in this section is used as the template to
511 String: configuration in this section is used as the template to
509 customize the text shown in the editor when committing.
512 customize the text shown in the editor when committing.
510
513
511 In addition to pre-defined template keywords, commit log specific one
514 In addition to pre-defined template keywords, commit log specific one
512 below can be used for customization:
515 below can be used for customization:
513
516
514 ``extramsg``
517 ``extramsg``
515 String: Extra message (typically 'Leave message empty to abort
518 String: Extra message (typically 'Leave message empty to abort
516 commit.'). This may be changed by some commands or extensions.
519 commit.'). This may be changed by some commands or extensions.
517
520
518 For example, the template configuration below shows as same text as
521 For example, the template configuration below shows as same text as
519 one shown by default::
522 one shown by default::
520
523
521 [committemplate]
524 [committemplate]
522 changeset = {desc}\n\n
525 changeset = {desc}\n\n
523 HG: Enter commit message. Lines beginning with 'HG:' are removed.
526 HG: Enter commit message. Lines beginning with 'HG:' are removed.
524 HG: {extramsg}
527 HG: {extramsg}
525 HG: --
528 HG: --
526 HG: user: {author}\n{ifeq(p2rev, "-1", "",
529 HG: user: {author}\n{ifeq(p2rev, "-1", "",
527 "HG: branch merge\n")
530 "HG: branch merge\n")
528 }HG: branch '{branch}'\n{if(activebookmark,
531 }HG: branch '{branch}'\n{if(activebookmark,
529 "HG: bookmark '{activebookmark}'\n") }{subrepos %
532 "HG: bookmark '{activebookmark}'\n") }{subrepos %
530 "HG: subrepo {subrepo}\n" }{file_adds %
533 "HG: subrepo {subrepo}\n" }{file_adds %
531 "HG: added {file}\n" }{file_mods %
534 "HG: added {file}\n" }{file_mods %
532 "HG: changed {file}\n" }{file_dels %
535 "HG: changed {file}\n" }{file_dels %
533 "HG: removed {file}\n" }{if(files, "",
536 "HG: removed {file}\n" }{if(files, "",
534 "HG: no files changed\n")}
537 "HG: no files changed\n")}
535
538
536 ``diff()``
539 ``diff()``
537 String: show the diff (see :hg:`help templates` for detail)
540 String: show the diff (see :hg:`help templates` for detail)
538
541
539 Sometimes it is helpful to show the diff of the changeset in the editor without
542 Sometimes it is helpful to show the diff of the changeset in the editor without
540 having to prefix 'HG: ' to each line so that highlighting works correctly. For
543 having to prefix 'HG: ' to each line so that highlighting works correctly. For
541 this, Mercurial provides a special string which will ignore everything below
544 this, Mercurial provides a special string which will ignore everything below
542 it::
545 it::
543
546
544 HG: ------------------------ >8 ------------------------
547 HG: ------------------------ >8 ------------------------
545
548
546 For example, the template configuration below will show the diff below the
549 For example, the template configuration below will show the diff below the
547 extra message::
550 extra message::
548
551
549 [committemplate]
552 [committemplate]
550 changeset = {desc}\n\n
553 changeset = {desc}\n\n
551 HG: Enter commit message. Lines beginning with 'HG:' are removed.
554 HG: Enter commit message. Lines beginning with 'HG:' are removed.
552 HG: {extramsg}
555 HG: {extramsg}
553 HG: ------------------------ >8 ------------------------
556 HG: ------------------------ >8 ------------------------
554 HG: Do not touch the line above.
557 HG: Do not touch the line above.
555 HG: Everything below will be removed.
558 HG: Everything below will be removed.
556 {diff()}
559 {diff()}
557
560
558 .. note::
561 .. note::
559
562
560 For some problematic encodings (see :hg:`help win32mbcs` for
563 For some problematic encodings (see :hg:`help win32mbcs` for
561 detail), this customization should be configured carefully, to
564 detail), this customization should be configured carefully, to
562 avoid showing broken characters.
565 avoid showing broken characters.
563
566
564 For example, if a multibyte character ending with backslash (0x5c) is
567 For example, if a multibyte character ending with backslash (0x5c) is
565 followed by the ASCII character 'n' in the customized template,
568 followed by the ASCII character 'n' in the customized template,
566 the sequence of backslash and 'n' is treated as line-feed unexpectedly
569 the sequence of backslash and 'n' is treated as line-feed unexpectedly
567 (and the multibyte character is broken, too).
570 (and the multibyte character is broken, too).
568
571
569 Customized template is used for commands below (``--edit`` may be
572 Customized template is used for commands below (``--edit`` may be
570 required):
573 required):
571
574
572 - :hg:`backout`
575 - :hg:`backout`
573 - :hg:`commit`
576 - :hg:`commit`
574 - :hg:`fetch` (for merge commit only)
577 - :hg:`fetch` (for merge commit only)
575 - :hg:`graft`
578 - :hg:`graft`
576 - :hg:`histedit`
579 - :hg:`histedit`
577 - :hg:`import`
580 - :hg:`import`
578 - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
581 - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
579 - :hg:`rebase`
582 - :hg:`rebase`
580 - :hg:`shelve`
583 - :hg:`shelve`
581 - :hg:`sign`
584 - :hg:`sign`
582 - :hg:`tag`
585 - :hg:`tag`
583 - :hg:`transplant`
586 - :hg:`transplant`
584
587
585 Configuring items below instead of ``changeset`` allows showing
588 Configuring items below instead of ``changeset`` allows showing
586 customized message only for specific actions, or showing different
589 customized message only for specific actions, or showing different
587 messages for each action.
590 messages for each action.
588
591
589 - ``changeset.backout`` for :hg:`backout`
592 - ``changeset.backout`` for :hg:`backout`
590 - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
593 - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
591 - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
594 - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
592 - ``changeset.commit.normal.merge`` for :hg:`commit` on merges
595 - ``changeset.commit.normal.merge`` for :hg:`commit` on merges
593 - ``changeset.commit.normal.normal`` for :hg:`commit` on other
596 - ``changeset.commit.normal.normal`` for :hg:`commit` on other
594 - ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
597 - ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
595 - ``changeset.gpg.sign`` for :hg:`sign`
598 - ``changeset.gpg.sign`` for :hg:`sign`
596 - ``changeset.graft`` for :hg:`graft`
599 - ``changeset.graft`` for :hg:`graft`
597 - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
600 - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
598 - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
601 - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
599 - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
602 - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
600 - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
603 - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
601 - ``changeset.import.bypass`` for :hg:`import --bypass`
604 - ``changeset.import.bypass`` for :hg:`import --bypass`
602 - ``changeset.import.normal.merge`` for :hg:`import` on merges
605 - ``changeset.import.normal.merge`` for :hg:`import` on merges
603 - ``changeset.import.normal.normal`` for :hg:`import` on other
606 - ``changeset.import.normal.normal`` for :hg:`import` on other
604 - ``changeset.mq.qnew`` for :hg:`qnew`
607 - ``changeset.mq.qnew`` for :hg:`qnew`
605 - ``changeset.mq.qfold`` for :hg:`qfold`
608 - ``changeset.mq.qfold`` for :hg:`qfold`
606 - ``changeset.mq.qrefresh`` for :hg:`qrefresh`
609 - ``changeset.mq.qrefresh`` for :hg:`qrefresh`
607 - ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
610 - ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
608 - ``changeset.rebase.merge`` for :hg:`rebase` on merges
611 - ``changeset.rebase.merge`` for :hg:`rebase` on merges
609 - ``changeset.rebase.normal`` for :hg:`rebase` on other
612 - ``changeset.rebase.normal`` for :hg:`rebase` on other
610 - ``changeset.shelve.shelve`` for :hg:`shelve`
613 - ``changeset.shelve.shelve`` for :hg:`shelve`
611 - ``changeset.tag.add`` for :hg:`tag` without ``--remove``
614 - ``changeset.tag.add`` for :hg:`tag` without ``--remove``
612 - ``changeset.tag.remove`` for :hg:`tag --remove`
615 - ``changeset.tag.remove`` for :hg:`tag --remove`
613 - ``changeset.transplant.merge`` for :hg:`transplant` on merges
616 - ``changeset.transplant.merge`` for :hg:`transplant` on merges
614 - ``changeset.transplant.normal`` for :hg:`transplant` on other
617 - ``changeset.transplant.normal`` for :hg:`transplant` on other
615
618
616 These dot-separated lists of names are treated as hierarchical ones.
619 These dot-separated lists of names are treated as hierarchical ones.
617 For example, ``changeset.tag.remove`` customizes the commit message
620 For example, ``changeset.tag.remove`` customizes the commit message
618 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
621 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
619 commit message for :hg:`tag` regardless of ``--remove`` option.
622 commit message for :hg:`tag` regardless of ``--remove`` option.
620
623
621 When the external editor is invoked for a commit, the corresponding
624 When the external editor is invoked for a commit, the corresponding
622 dot-separated list of names without the ``changeset.`` prefix
625 dot-separated list of names without the ``changeset.`` prefix
623 (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment
626 (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment
624 variable.
627 variable.
625
628
626 In this section, items other than ``changeset`` can be referred from
629 In this section, items other than ``changeset`` can be referred from
627 others. For example, the configuration to list committed files up
630 others. For example, the configuration to list committed files up
628 below can be referred as ``{listupfiles}``::
631 below can be referred as ``{listupfiles}``::
629
632
630 [committemplate]
633 [committemplate]
631 listupfiles = {file_adds %
634 listupfiles = {file_adds %
632 "HG: added {file}\n" }{file_mods %
635 "HG: added {file}\n" }{file_mods %
633 "HG: changed {file}\n" }{file_dels %
636 "HG: changed {file}\n" }{file_dels %
634 "HG: removed {file}\n" }{if(files, "",
637 "HG: removed {file}\n" }{if(files, "",
635 "HG: no files changed\n")}
638 "HG: no files changed\n")}
636
639
637 ``decode/encode``
640 ``decode/encode``
638 -----------------
641 -----------------
639
642
640 Filters for transforming files on checkout/checkin. This would
643 Filters for transforming files on checkout/checkin. This would
641 typically be used for newline processing or other
644 typically be used for newline processing or other
642 localization/canonicalization of files.
645 localization/canonicalization of files.
643
646
644 Filters consist of a filter pattern followed by a filter command.
647 Filters consist of a filter pattern followed by a filter command.
645 Filter patterns are globs by default, rooted at the repository root.
648 Filter patterns are globs by default, rooted at the repository root.
646 For example, to match any file ending in ``.txt`` in the root
649 For example, to match any file ending in ``.txt`` in the root
647 directory only, use the pattern ``*.txt``. To match any file ending
650 directory only, use the pattern ``*.txt``. To match any file ending
648 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
651 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
649 For each file only the first matching filter applies.
652 For each file only the first matching filter applies.
650
653
651 The filter command can start with a specifier, either ``pipe:`` or
654 The filter command can start with a specifier, either ``pipe:`` or
652 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
655 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
653
656
654 A ``pipe:`` command must accept data on stdin and return the transformed
657 A ``pipe:`` command must accept data on stdin and return the transformed
655 data on stdout.
658 data on stdout.
656
659
657 Pipe example::
660 Pipe example::
658
661
659 [encode]
662 [encode]
660 # uncompress gzip files on checkin to improve delta compression
663 # uncompress gzip files on checkin to improve delta compression
661 # note: not necessarily a good idea, just an example
664 # note: not necessarily a good idea, just an example
662 *.gz = pipe: gunzip
665 *.gz = pipe: gunzip
663
666
664 [decode]
667 [decode]
665 # recompress gzip files when writing them to the working dir (we
668 # recompress gzip files when writing them to the working dir (we
666 # can safely omit "pipe:", because it's the default)
669 # can safely omit "pipe:", because it's the default)
667 *.gz = gzip
670 *.gz = gzip
668
671
669 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
672 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
670 with the name of a temporary file that contains the data to be
673 with the name of a temporary file that contains the data to be
671 filtered by the command. The string ``OUTFILE`` is replaced with the name
674 filtered by the command. The string ``OUTFILE`` is replaced with the name
672 of an empty temporary file, where the filtered data must be written by
675 of an empty temporary file, where the filtered data must be written by
673 the command.
676 the command.
674
677
675 .. container:: windows
678 .. container:: windows
676
679
677 .. note::
680 .. note::
678
681
679 The tempfile mechanism is recommended for Windows systems,
682 The tempfile mechanism is recommended for Windows systems,
680 where the standard shell I/O redirection operators often have
683 where the standard shell I/O redirection operators often have
681 strange effects and may corrupt the contents of your files.
684 strange effects and may corrupt the contents of your files.
682
685
683 This filter mechanism is used internally by the ``eol`` extension to
686 This filter mechanism is used internally by the ``eol`` extension to
684 translate line ending characters between Windows (CRLF) and Unix (LF)
687 translate line ending characters between Windows (CRLF) and Unix (LF)
685 format. We suggest you use the ``eol`` extension for convenience.
688 format. We suggest you use the ``eol`` extension for convenience.
686
689
687
690
688 ``defaults``
691 ``defaults``
689 ------------
692 ------------
690
693
691 (defaults are deprecated. Don't use them. Use aliases instead.)
694 (defaults are deprecated. Don't use them. Use aliases instead.)
692
695
693 Use the ``[defaults]`` section to define command defaults, i.e. the
696 Use the ``[defaults]`` section to define command defaults, i.e. the
694 default options/arguments to pass to the specified commands.
697 default options/arguments to pass to the specified commands.
695
698
696 The following example makes :hg:`log` run in verbose mode, and
699 The following example makes :hg:`log` run in verbose mode, and
697 :hg:`status` show only the modified files, by default::
700 :hg:`status` show only the modified files, by default::
698
701
699 [defaults]
702 [defaults]
700 log = -v
703 log = -v
701 status = -m
704 status = -m
702
705
703 The actual commands, instead of their aliases, must be used when
706 The actual commands, instead of their aliases, must be used when
704 defining command defaults. The command defaults will also be applied
707 defining command defaults. The command defaults will also be applied
705 to the aliases of the commands defined.
708 to the aliases of the commands defined.
706
709
707
710
708 ``diff``
711 ``diff``
709 --------
712 --------
710
713
711 Settings used when displaying diffs. Everything except for ``unified``
714 Settings used when displaying diffs. Everything except for ``unified``
712 is a Boolean and defaults to False. See :hg:`help config.annotate`
715 is a Boolean and defaults to False. See :hg:`help config.annotate`
713 for related options for the annotate command.
716 for related options for the annotate command.
714
717
715 ``git``
718 ``git``
716 Use git extended diff format.
719 Use git extended diff format.
717
720
718 ``nobinary``
721 ``nobinary``
719 Omit git binary patches.
722 Omit git binary patches.
720
723
721 ``nodates``
724 ``nodates``
722 Don't include dates in diff headers.
725 Don't include dates in diff headers.
723
726
724 ``noprefix``
727 ``noprefix``
725 Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
728 Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
726
729
727 ``showfunc``
730 ``showfunc``
728 Show which function each change is in.
731 Show which function each change is in.
729
732
730 ``ignorews``
733 ``ignorews``
731 Ignore white space when comparing lines.
734 Ignore white space when comparing lines.
732
735
733 ``ignorewsamount``
736 ``ignorewsamount``
734 Ignore changes in the amount of white space.
737 Ignore changes in the amount of white space.
735
738
736 ``ignoreblanklines``
739 ``ignoreblanklines``
737 Ignore changes whose lines are all blank.
740 Ignore changes whose lines are all blank.
738
741
739 ``unified``
742 ``unified``
740 Number of lines of context to show.
743 Number of lines of context to show.
741
744
742 ``word-diff``
745 ``word-diff``
743 Highlight changed words.
746 Highlight changed words.
744
747
745 ``email``
748 ``email``
746 ---------
749 ---------
747
750
748 Settings for extensions that send email messages.
751 Settings for extensions that send email messages.
749
752
750 ``from``
753 ``from``
751 Optional. Email address to use in "From" header and SMTP envelope
754 Optional. Email address to use in "From" header and SMTP envelope
752 of outgoing messages.
755 of outgoing messages.
753
756
754 ``to``
757 ``to``
755 Optional. Comma-separated list of recipients' email addresses.
758 Optional. Comma-separated list of recipients' email addresses.
756
759
757 ``cc``
760 ``cc``
758 Optional. Comma-separated list of carbon copy recipients'
761 Optional. Comma-separated list of carbon copy recipients'
759 email addresses.
762 email addresses.
760
763
761 ``bcc``
764 ``bcc``
762 Optional. Comma-separated list of blind carbon copy recipients'
765 Optional. Comma-separated list of blind carbon copy recipients'
763 email addresses.
766 email addresses.
764
767
765 ``method``
768 ``method``
766 Optional. Method to use to send email messages. If value is ``smtp``
769 Optional. Method to use to send email messages. If value is ``smtp``
767 (default), use SMTP (see the ``[smtp]`` section for configuration).
770 (default), use SMTP (see the ``[smtp]`` section for configuration).
768 Otherwise, use as name of program to run that acts like sendmail
771 Otherwise, use as name of program to run that acts like sendmail
769 (takes ``-f`` option for sender, list of recipients on command line,
772 (takes ``-f`` option for sender, list of recipients on command line,
770 message on stdin). Normally, setting this to ``sendmail`` or
773 message on stdin). Normally, setting this to ``sendmail`` or
771 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
774 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
772
775
773 ``charsets``
776 ``charsets``
774 Optional. Comma-separated list of character sets considered
777 Optional. Comma-separated list of character sets considered
775 convenient for recipients. Addresses, headers, and parts not
778 convenient for recipients. Addresses, headers, and parts not
776 containing patches of outgoing messages will be encoded in the
779 containing patches of outgoing messages will be encoded in the
777 first character set to which conversion from local encoding
780 first character set to which conversion from local encoding
778 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
781 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
779 conversion fails, the text in question is sent as is.
782 conversion fails, the text in question is sent as is.
780 (default: '')
783 (default: '')
781
784
782 Order of outgoing email character sets:
785 Order of outgoing email character sets:
783
786
784 1. ``us-ascii``: always first, regardless of settings
787 1. ``us-ascii``: always first, regardless of settings
785 2. ``email.charsets``: in order given by user
788 2. ``email.charsets``: in order given by user
786 3. ``ui.fallbackencoding``: if not in email.charsets
789 3. ``ui.fallbackencoding``: if not in email.charsets
787 4. ``$HGENCODING``: if not in email.charsets
790 4. ``$HGENCODING``: if not in email.charsets
788 5. ``utf-8``: always last, regardless of settings
791 5. ``utf-8``: always last, regardless of settings
789
792
790 Email example::
793 Email example::
791
794
792 [email]
795 [email]
793 from = Joseph User <joe.user@example.com>
796 from = Joseph User <joe.user@example.com>
794 method = /usr/sbin/sendmail
797 method = /usr/sbin/sendmail
795 # charsets for western Europeans
798 # charsets for western Europeans
796 # us-ascii, utf-8 omitted, as they are tried first and last
799 # us-ascii, utf-8 omitted, as they are tried first and last
797 charsets = iso-8859-1, iso-8859-15, windows-1252
800 charsets = iso-8859-1, iso-8859-15, windows-1252
798
801
799
802
800 ``extensions``
803 ``extensions``
801 --------------
804 --------------
802
805
803 Mercurial has an extension mechanism for adding new features. To
806 Mercurial has an extension mechanism for adding new features. To
804 enable an extension, create an entry for it in this section.
807 enable an extension, create an entry for it in this section.
805
808
806 If you know that the extension is already in Python's search path,
809 If you know that the extension is already in Python's search path,
807 you can give the name of the module, followed by ``=``, with nothing
810 you can give the name of the module, followed by ``=``, with nothing
808 after the ``=``.
811 after the ``=``.
809
812
810 Otherwise, give a name that you choose, followed by ``=``, followed by
813 Otherwise, give a name that you choose, followed by ``=``, followed by
811 the path to the ``.py`` file (including the file name extension) that
814 the path to the ``.py`` file (including the file name extension) that
812 defines the extension.
815 defines the extension.
813
816
814 To explicitly disable an extension that is enabled in an hgrc of
817 To explicitly disable an extension that is enabled in an hgrc of
815 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
818 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
816 or ``foo = !`` when path is not supplied.
819 or ``foo = !`` when path is not supplied.
817
820
818 Example for ``~/.hgrc``::
821 Example for ``~/.hgrc``::
819
822
820 [extensions]
823 [extensions]
821 # (the churn extension will get loaded from Mercurial's path)
824 # (the churn extension will get loaded from Mercurial's path)
822 churn =
825 churn =
823 # (this extension will get loaded from the file specified)
826 # (this extension will get loaded from the file specified)
824 myfeature = ~/.hgext/myfeature.py
827 myfeature = ~/.hgext/myfeature.py
825
828
826
829
827 ``format``
830 ``format``
828 ----------
831 ----------
829
832
830 Configuration that controls the repository format. Newer format options are more
833 Configuration that controls the repository format. Newer format options are more
831 powerful but incompatible with some older versions of Mercurial. Format options
834 powerful but incompatible with some older versions of Mercurial. Format options
832 are considered at repository initialization only. You need to make a new clone
835 are considered at repository initialization only. You need to make a new clone
833 for config change to be taken into account.
836 for config change to be taken into account.
834
837
835 For more details about repository format and version compatibility, see
838 For more details about repository format and version compatibility, see
836 https://www.mercurial-scm.org/wiki/MissingRequirement
839 https://www.mercurial-scm.org/wiki/MissingRequirement
837
840
838 ``usegeneraldelta``
841 ``usegeneraldelta``
839 Enable or disable the "generaldelta" repository format which improves
842 Enable or disable the "generaldelta" repository format which improves
840 repository compression by allowing "revlog" to store delta against arbitrary
843 repository compression by allowing "revlog" to store delta against arbitrary
841 revision instead of the previous stored one. This provides significant
844 revision instead of the previous stored one. This provides significant
842 improvement for repositories with branches.
845 improvement for repositories with branches.
843
846
844 Repositories with this on-disk format require Mercurial version 1.9.
847 Repositories with this on-disk format require Mercurial version 1.9.
845
848
846 Enabled by default.
849 Enabled by default.
847
850
848 ``dotencode``
851 ``dotencode``
849 Enable or disable the "dotencode" repository format which enhances
852 Enable or disable the "dotencode" repository format which enhances
850 the "fncache" repository format (which has to be enabled to use
853 the "fncache" repository format (which has to be enabled to use
851 dotencode) to avoid issues with filenames starting with ._ on
854 dotencode) to avoid issues with filenames starting with ._ on
852 Mac OS X and spaces on Windows.
855 Mac OS X and spaces on Windows.
853
856
854 Repositories with this on-disk format require Mercurial version 1.7.
857 Repositories with this on-disk format require Mercurial version 1.7.
855
858
856 Enabled by default.
859 Enabled by default.
857
860
858 ``usefncache``
861 ``usefncache``
859 Enable or disable the "fncache" repository format which enhances
862 Enable or disable the "fncache" repository format which enhances
860 the "store" repository format (which has to be enabled to use
863 the "store" repository format (which has to be enabled to use
861 fncache) to allow longer filenames and avoids using Windows
864 fncache) to allow longer filenames and avoids using Windows
862 reserved names, e.g. "nul".
865 reserved names, e.g. "nul".
863
866
864 Repositories with this on-disk format require Mercurial version 1.1.
867 Repositories with this on-disk format require Mercurial version 1.1.
865
868
866 Enabled by default.
869 Enabled by default.
867
870
868 ``usestore``
871 ``usestore``
869 Enable or disable the "store" repository format which improves
872 Enable or disable the "store" repository format which improves
870 compatibility with systems that fold case or otherwise mangle
873 compatibility with systems that fold case or otherwise mangle
871 filenames. Disabling this option will allow you to store longer filenames
874 filenames. Disabling this option will allow you to store longer filenames
872 in some situations at the expense of compatibility.
875 in some situations at the expense of compatibility.
873
876
874 Repositories with this on-disk format require Mercurial version 0.9.4.
877 Repositories with this on-disk format require Mercurial version 0.9.4.
875
878
876 Enabled by default.
879 Enabled by default.
877
880
878 ``sparse-revlog``
881 ``sparse-revlog``
879 Enable or disable the ``sparse-revlog`` delta strategy. This format improves
882 Enable or disable the ``sparse-revlog`` delta strategy. This format improves
880 delta re-use inside revlog. For very branchy repositories, it results in a
883 delta re-use inside revlog. For very branchy repositories, it results in a
881 smaller store. For repositories with many revisions, it also helps
884 smaller store. For repositories with many revisions, it also helps
882 performance (by using shortened delta chains.)
885 performance (by using shortened delta chains.)
883
886
884 Repositories with this on-disk format require Mercurial version 4.7
887 Repositories with this on-disk format require Mercurial version 4.7
885
888
886 Enabled by default.
889 Enabled by default.
887
890
888 ``revlog-compression``
891 ``revlog-compression``
889 Compression algorithm used by revlog. Supported value are `zlib` and `zstd`.
892 Compression algorithm used by revlog. Supported value are `zlib` and `zstd`.
890 The `zlib` engine is the historical default of Mercurial. `zstd` is a newer
893 The `zlib` engine is the historical default of Mercurial. `zstd` is a newer
891 format that is usually a net win over `zlib` operating faster at better
894 format that is usually a net win over `zlib` operating faster at better
892 compression rate. Use `zstd` to reduce CPU usage.
895 compression rate. Use `zstd` to reduce CPU usage.
893
896
894 On some system, Mercurial installation may lack `zstd` supports. Default is `zlib`.
897 On some system, Mercurial installation may lack `zstd` supports. Default is `zlib`.
895
898
896 ``bookmarks-in-store``
899 ``bookmarks-in-store``
897 Store bookmarks in .hg/store/. This means that bookmarks are shared when
900 Store bookmarks in .hg/store/. This means that bookmarks are shared when
898 using `hg share` regardless of the `-B` option.
901 using `hg share` regardless of the `-B` option.
899
902
900 Repositories with this on-disk format require Mercurial version 5.1.
903 Repositories with this on-disk format require Mercurial version 5.1.
901
904
902 Disabled by default.
905 Disabled by default.
903
906
904
907
905 ``graph``
908 ``graph``
906 ---------
909 ---------
907
910
908 Web graph view configuration. This section let you change graph
911 Web graph view configuration. This section let you change graph
909 elements display properties by branches, for instance to make the
912 elements display properties by branches, for instance to make the
910 ``default`` branch stand out.
913 ``default`` branch stand out.
911
914
912 Each line has the following format::
915 Each line has the following format::
913
916
914 <branch>.<argument> = <value>
917 <branch>.<argument> = <value>
915
918
916 where ``<branch>`` is the name of the branch being
919 where ``<branch>`` is the name of the branch being
917 customized. Example::
920 customized. Example::
918
921
919 [graph]
922 [graph]
920 # 2px width
923 # 2px width
921 default.width = 2
924 default.width = 2
922 # red color
925 # red color
923 default.color = FF0000
926 default.color = FF0000
924
927
925 Supported arguments:
928 Supported arguments:
926
929
927 ``width``
930 ``width``
928 Set branch edges width in pixels.
931 Set branch edges width in pixels.
929
932
930 ``color``
933 ``color``
931 Set branch edges color in hexadecimal RGB notation.
934 Set branch edges color in hexadecimal RGB notation.
932
935
933 ``hooks``
936 ``hooks``
934 ---------
937 ---------
935
938
936 Commands or Python functions that get automatically executed by
939 Commands or Python functions that get automatically executed by
937 various actions such as starting or finishing a commit. Multiple
940 various actions such as starting or finishing a commit. Multiple
938 hooks can be run for the same action by appending a suffix to the
941 hooks can be run for the same action by appending a suffix to the
939 action. Overriding a site-wide hook can be done by changing its
942 action. Overriding a site-wide hook can be done by changing its
940 value or setting it to an empty string. Hooks can be prioritized
943 value or setting it to an empty string. Hooks can be prioritized
941 by adding a prefix of ``priority.`` to the hook name on a new line
944 by adding a prefix of ``priority.`` to the hook name on a new line
942 and setting the priority. The default priority is 0.
945 and setting the priority. The default priority is 0.
943
946
944 Example ``.hg/hgrc``::
947 Example ``.hg/hgrc``::
945
948
946 [hooks]
949 [hooks]
947 # update working directory after adding changesets
950 # update working directory after adding changesets
948 changegroup.update = hg update
951 changegroup.update = hg update
949 # do not use the site-wide hook
952 # do not use the site-wide hook
950 incoming =
953 incoming =
951 incoming.email = /my/email/hook
954 incoming.email = /my/email/hook
952 incoming.autobuild = /my/build/hook
955 incoming.autobuild = /my/build/hook
953 # force autobuild hook to run before other incoming hooks
956 # force autobuild hook to run before other incoming hooks
954 priority.incoming.autobuild = 1
957 priority.incoming.autobuild = 1
955
958
956 Most hooks are run with environment variables set that give useful
959 Most hooks are run with environment variables set that give useful
957 additional information. For each hook below, the environment variables
960 additional information. For each hook below, the environment variables
958 it is passed are listed with names in the form ``$HG_foo``. The
961 it is passed are listed with names in the form ``$HG_foo``. The
959 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
962 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
960 They contain the type of hook which triggered the run and the full name
963 They contain the type of hook which triggered the run and the full name
961 of the hook in the config, respectively. In the example above, this will
964 of the hook in the config, respectively. In the example above, this will
962 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
965 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
963
966
964 .. container:: windows
967 .. container:: windows
965
968
966 Some basic Unix syntax can be enabled for portability, including ``$VAR``
969 Some basic Unix syntax can be enabled for portability, including ``$VAR``
967 and ``${VAR}`` style variables. A ``~`` followed by ``\`` or ``/`` will
970 and ``${VAR}`` style variables. A ``~`` followed by ``\`` or ``/`` will
968 be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion
971 be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion
969 on Unix. To use a literal ``$`` or ``~``, it must be escaped with a back
972 on Unix. To use a literal ``$`` or ``~``, it must be escaped with a back
970 slash or inside of a strong quote. Strong quotes will be replaced by
973 slash or inside of a strong quote. Strong quotes will be replaced by
971 double quotes after processing.
974 double quotes after processing.
972
975
973 This feature is enabled by adding a prefix of ``tonative.`` to the hook
976 This feature is enabled by adding a prefix of ``tonative.`` to the hook
974 name on a new line, and setting it to ``True``. For example::
977 name on a new line, and setting it to ``True``. For example::
975
978
976 [hooks]
979 [hooks]
977 incoming.autobuild = /my/build/hook
980 incoming.autobuild = /my/build/hook
978 # enable translation to cmd.exe syntax for autobuild hook
981 # enable translation to cmd.exe syntax for autobuild hook
979 tonative.incoming.autobuild = True
982 tonative.incoming.autobuild = True
980
983
981 ``changegroup``
984 ``changegroup``
982 Run after a changegroup has been added via push, pull or unbundle. The ID of
985 Run after a changegroup has been added via push, pull or unbundle. The ID of
983 the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
986 the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
984 The URL from which changes came is in ``$HG_URL``.
987 The URL from which changes came is in ``$HG_URL``.
985
988
986 ``commit``
989 ``commit``
987 Run after a changeset has been created in the local repository. The ID
990 Run after a changeset has been created in the local repository. The ID
988 of the newly created changeset is in ``$HG_NODE``. Parent changeset
991 of the newly created changeset is in ``$HG_NODE``. Parent changeset
989 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
992 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
990
993
991 ``incoming``
994 ``incoming``
992 Run after a changeset has been pulled, pushed, or unbundled into
995 Run after a changeset has been pulled, pushed, or unbundled into
993 the local repository. The ID of the newly arrived changeset is in
996 the local repository. The ID of the newly arrived changeset is in
994 ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
997 ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
995
998
996 ``outgoing``
999 ``outgoing``
997 Run after sending changes from the local repository to another. The ID of
1000 Run after sending changes from the local repository to another. The ID of
998 first changeset sent is in ``$HG_NODE``. The source of operation is in
1001 first changeset sent is in ``$HG_NODE``. The source of operation is in
999 ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
1002 ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
1000
1003
1001 ``post-<command>``
1004 ``post-<command>``
1002 Run after successful invocations of the associated command. The
1005 Run after successful invocations of the associated command. The
1003 contents of the command line are passed as ``$HG_ARGS`` and the result
1006 contents of the command line are passed as ``$HG_ARGS`` and the result
1004 code in ``$HG_RESULT``. Parsed command line arguments are passed as
1007 code in ``$HG_RESULT``. Parsed command line arguments are passed as
1005 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
1008 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
1006 the python data internally passed to <command>. ``$HG_OPTS`` is a
1009 the python data internally passed to <command>. ``$HG_OPTS`` is a
1007 dictionary of options (with unspecified options set to their defaults).
1010 dictionary of options (with unspecified options set to their defaults).
1008 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
1011 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
1009
1012
1010 ``fail-<command>``
1013 ``fail-<command>``
1011 Run after a failed invocation of an associated command. The contents
1014 Run after a failed invocation of an associated command. The contents
1012 of the command line are passed as ``$HG_ARGS``. Parsed command line
1015 of the command line are passed as ``$HG_ARGS``. Parsed command line
1013 arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
1016 arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
1014 string representations of the python data internally passed to
1017 string representations of the python data internally passed to
1015 <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
1018 <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
1016 options set to their defaults). ``$HG_PATS`` is a list of arguments.
1019 options set to their defaults). ``$HG_PATS`` is a list of arguments.
1017 Hook failure is ignored.
1020 Hook failure is ignored.
1018
1021
1019 ``pre-<command>``
1022 ``pre-<command>``
1020 Run before executing the associated command. The contents of the
1023 Run before executing the associated command. The contents of the
1021 command line are passed as ``$HG_ARGS``. Parsed command line arguments
1024 command line are passed as ``$HG_ARGS``. Parsed command line arguments
1022 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
1025 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
1023 representations of the data internally passed to <command>. ``$HG_OPTS``
1026 representations of the data internally passed to <command>. ``$HG_OPTS``
1024 is a dictionary of options (with unspecified options set to their
1027 is a dictionary of options (with unspecified options set to their
1025 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
1028 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
1026 failure, the command doesn't execute and Mercurial returns the failure
1029 failure, the command doesn't execute and Mercurial returns the failure
1027 code.
1030 code.
1028
1031
1029 ``prechangegroup``
1032 ``prechangegroup``
1030 Run before a changegroup is added via push, pull or unbundle. Exit
1033 Run before a changegroup is added via push, pull or unbundle. Exit
1031 status 0 allows the changegroup to proceed. A non-zero status will
1034 status 0 allows the changegroup to proceed. A non-zero status will
1032 cause the push, pull or unbundle to fail. The URL from which changes
1035 cause the push, pull or unbundle to fail. The URL from which changes
1033 will come is in ``$HG_URL``.
1036 will come is in ``$HG_URL``.
1034
1037
1035 ``precommit``
1038 ``precommit``
1036 Run before starting a local commit. Exit status 0 allows the
1039 Run before starting a local commit. Exit status 0 allows the
1037 commit to proceed. A non-zero status will cause the commit to fail.
1040 commit to proceed. A non-zero status will cause the commit to fail.
1038 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1041 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1039
1042
1040 ``prelistkeys``
1043 ``prelistkeys``
1041 Run before listing pushkeys (like bookmarks) in the
1044 Run before listing pushkeys (like bookmarks) in the
1042 repository. A non-zero status will cause failure. The key namespace is
1045 repository. A non-zero status will cause failure. The key namespace is
1043 in ``$HG_NAMESPACE``.
1046 in ``$HG_NAMESPACE``.
1044
1047
1045 ``preoutgoing``
1048 ``preoutgoing``
1046 Run before collecting changes to send from the local repository to
1049 Run before collecting changes to send from the local repository to
1047 another. A non-zero status will cause failure. This lets you prevent
1050 another. A non-zero status will cause failure. This lets you prevent
1048 pull over HTTP or SSH. It can also prevent propagating commits (via
1051 pull over HTTP or SSH. It can also prevent propagating commits (via
1049 local pull, push (outbound) or bundle commands), but not completely,
1052 local pull, push (outbound) or bundle commands), but not completely,
1050 since you can just copy files instead. The source of operation is in
1053 since you can just copy files instead. The source of operation is in
1051 ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
1054 ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
1052 SSH or HTTP repository. If "push", "pull" or "bundle", the operation
1055 SSH or HTTP repository. If "push", "pull" or "bundle", the operation
1053 is happening on behalf of a repository on same system.
1056 is happening on behalf of a repository on same system.
1054
1057
1055 ``prepushkey``
1058 ``prepushkey``
1056 Run before a pushkey (like a bookmark) is added to the
1059 Run before a pushkey (like a bookmark) is added to the
1057 repository. A non-zero status will cause the key to be rejected. The
1060 repository. A non-zero status will cause the key to be rejected. The
1058 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
1061 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
1059 the old value (if any) is in ``$HG_OLD``, and the new value is in
1062 the old value (if any) is in ``$HG_OLD``, and the new value is in
1060 ``$HG_NEW``.
1063 ``$HG_NEW``.
1061
1064
1062 ``pretag``
1065 ``pretag``
1063 Run before creating a tag. Exit status 0 allows the tag to be
1066 Run before creating a tag. Exit status 0 allows the tag to be
1064 created. A non-zero status will cause the tag to fail. The ID of the
1067 created. A non-zero status will cause the tag to fail. The ID of the
1065 changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
1068 changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
1066 tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
1069 tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
1067
1070
1068 ``pretxnopen``
1071 ``pretxnopen``
1069 Run before any new repository transaction is open. The reason for the
1072 Run before any new repository transaction is open. The reason for the
1070 transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
1073 transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
1071 transaction will be in ``HG_TXNID``. A non-zero status will prevent the
1074 transaction will be in ``HG_TXNID``. A non-zero status will prevent the
1072 transaction from being opened.
1075 transaction from being opened.
1073
1076
1074 ``pretxnclose``
1077 ``pretxnclose``
1075 Run right before the transaction is actually finalized. Any repository change
1078 Run right before the transaction is actually finalized. Any repository change
1076 will be visible to the hook program. This lets you validate the transaction
1079 will be visible to the hook program. This lets you validate the transaction
1077 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1080 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1078 status will cause the transaction to be rolled back. The reason for the
1081 status will cause the transaction to be rolled back. The reason for the
1079 transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
1082 transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
1080 the transaction will be in ``HG_TXNID``. The rest of the available data will
1083 the transaction will be in ``HG_TXNID``. The rest of the available data will
1081 vary according the transaction type. New changesets will add ``$HG_NODE``
1084 vary according the transaction type. New changesets will add ``$HG_NODE``
1082 (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
1085 (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
1083 added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and
1086 added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and
1084 phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
1087 phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
1085 respectively, etc.
1088 respectively, etc.
1086
1089
1087 ``pretxnclose-bookmark``
1090 ``pretxnclose-bookmark``
1088 Run right before a bookmark change is actually finalized. Any repository
1091 Run right before a bookmark change is actually finalized. Any repository
1089 change will be visible to the hook program. This lets you validate the
1092 change will be visible to the hook program. This lets you validate the
1090 transaction content or change it. Exit status 0 allows the commit to
1093 transaction content or change it. Exit status 0 allows the commit to
1091 proceed. A non-zero status will cause the transaction to be rolled back.
1094 proceed. A non-zero status will cause the transaction to be rolled back.
1092 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
1095 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
1093 bookmark location will be available in ``$HG_NODE`` while the previous
1096 bookmark location will be available in ``$HG_NODE`` while the previous
1094 location will be available in ``$HG_OLDNODE``. In case of a bookmark
1097 location will be available in ``$HG_OLDNODE``. In case of a bookmark
1095 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1098 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1096 will be empty.
1099 will be empty.
1097 In addition, the reason for the transaction opening will be in
1100 In addition, the reason for the transaction opening will be in
1098 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1101 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1099 ``HG_TXNID``.
1102 ``HG_TXNID``.
1100
1103
1101 ``pretxnclose-phase``
1104 ``pretxnclose-phase``
1102 Run right before a phase change is actually finalized. Any repository change
1105 Run right before a phase change is actually finalized. Any repository change
1103 will be visible to the hook program. This lets you validate the transaction
1106 will be visible to the hook program. This lets you validate the transaction
1104 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1107 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1105 status will cause the transaction to be rolled back. The hook is called
1108 status will cause the transaction to be rolled back. The hook is called
1106 multiple times, once for each revision affected by a phase change.
1109 multiple times, once for each revision affected by a phase change.
1107 The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
1110 The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
1108 while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
1111 while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
1109 will be empty. In addition, the reason for the transaction opening will be in
1112 will be empty. In addition, the reason for the transaction opening will be in
1110 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1113 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1111 ``HG_TXNID``. The hook is also run for newly added revisions. In this case
1114 ``HG_TXNID``. The hook is also run for newly added revisions. In this case
1112 the ``$HG_OLDPHASE`` entry will be empty.
1115 the ``$HG_OLDPHASE`` entry will be empty.
1113
1116
1114 ``txnclose``
1117 ``txnclose``
1115 Run after any repository transaction has been committed. At this
1118 Run after any repository transaction has been committed. At this
1116 point, the transaction can no longer be rolled back. The hook will run
1119 point, the transaction can no longer be rolled back. The hook will run
1117 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
1120 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
1118 details about available variables.
1121 details about available variables.
1119
1122
1120 ``txnclose-bookmark``
1123 ``txnclose-bookmark``
1121 Run after any bookmark change has been committed. At this point, the
1124 Run after any bookmark change has been committed. At this point, the
1122 transaction can no longer be rolled back. The hook will run after the lock
1125 transaction can no longer be rolled back. The hook will run after the lock
1123 is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
1126 is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
1124 about available variables.
1127 about available variables.
1125
1128
1126 ``txnclose-phase``
1129 ``txnclose-phase``
1127 Run after any phase change has been committed. At this point, the
1130 Run after any phase change has been committed. At this point, the
1128 transaction can no longer be rolled back. The hook will run after the lock
1131 transaction can no longer be rolled back. The hook will run after the lock
1129 is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
1132 is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
1130 available variables.
1133 available variables.
1131
1134
1132 ``txnabort``
1135 ``txnabort``
1133 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
1136 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
1134 for details about available variables.
1137 for details about available variables.
1135
1138
1136 ``pretxnchangegroup``
1139 ``pretxnchangegroup``
1137 Run after a changegroup has been added via push, pull or unbundle, but before
1140 Run after a changegroup has been added via push, pull or unbundle, but before
1138 the transaction has been committed. The changegroup is visible to the hook
1141 the transaction has been committed. The changegroup is visible to the hook
1139 program. This allows validation of incoming changes before accepting them.
1142 program. This allows validation of incoming changes before accepting them.
1140 The ID of the first new changeset is in ``$HG_NODE`` and last is in
1143 The ID of the first new changeset is in ``$HG_NODE`` and last is in
1141 ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
1144 ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
1142 status will cause the transaction to be rolled back, and the push, pull or
1145 status will cause the transaction to be rolled back, and the push, pull or
1143 unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
1146 unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
1144
1147
1145 ``pretxncommit``
1148 ``pretxncommit``
1146 Run after a changeset has been created, but before the transaction is
1149 Run after a changeset has been created, but before the transaction is
1147 committed. The changeset is visible to the hook program. This allows
1150 committed. The changeset is visible to the hook program. This allows
1148 validation of the commit message and changes. Exit status 0 allows the
1151 validation of the commit message and changes. Exit status 0 allows the
1149 commit to proceed. A non-zero status will cause the transaction to
1152 commit to proceed. A non-zero status will cause the transaction to
1150 be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
1153 be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
1151 changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1154 changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1152
1155
1153 ``preupdate``
1156 ``preupdate``
1154 Run before updating the working directory. Exit status 0 allows
1157 Run before updating the working directory. Exit status 0 allows
1155 the update to proceed. A non-zero status will prevent the update.
1158 the update to proceed. A non-zero status will prevent the update.
1156 The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
1159 The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
1157 merge, the ID of second new parent is in ``$HG_PARENT2``.
1160 merge, the ID of second new parent is in ``$HG_PARENT2``.
1158
1161
1159 ``listkeys``
1162 ``listkeys``
1160 Run after listing pushkeys (like bookmarks) in the repository. The
1163 Run after listing pushkeys (like bookmarks) in the repository. The
1161 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
1164 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
1162 dictionary containing the keys and values.
1165 dictionary containing the keys and values.
1163
1166
1164 ``pushkey``
1167 ``pushkey``
1165 Run after a pushkey (like a bookmark) is added to the
1168 Run after a pushkey (like a bookmark) is added to the
1166 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
1169 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
1167 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
1170 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
1168 value is in ``$HG_NEW``.
1171 value is in ``$HG_NEW``.
1169
1172
1170 ``tag``
1173 ``tag``
1171 Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
1174 Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
1172 The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
1175 The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
1173 the repository if ``$HG_LOCAL=0``.
1176 the repository if ``$HG_LOCAL=0``.
1174
1177
1175 ``update``
1178 ``update``
1176 Run after updating the working directory. The changeset ID of first
1179 Run after updating the working directory. The changeset ID of first
1177 new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
1180 new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
1178 parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1181 parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1179 update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
1182 update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
1180
1183
1181 .. note::
1184 .. note::
1182
1185
1183 It is generally better to use standard hooks rather than the
1186 It is generally better to use standard hooks rather than the
1184 generic pre- and post- command hooks, as they are guaranteed to be
1187 generic pre- and post- command hooks, as they are guaranteed to be
1185 called in the appropriate contexts for influencing transactions.
1188 called in the appropriate contexts for influencing transactions.
1186 Also, hooks like "commit" will be called in all contexts that
1189 Also, hooks like "commit" will be called in all contexts that
1187 generate a commit (e.g. tag) and not just the commit command.
1190 generate a commit (e.g. tag) and not just the commit command.
1188
1191
1189 .. note::
1192 .. note::
1190
1193
1191 Environment variables with empty values may not be passed to
1194 Environment variables with empty values may not be passed to
1192 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
1195 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
1193 will have an empty value under Unix-like platforms for non-merge
1196 will have an empty value under Unix-like platforms for non-merge
1194 changesets, while it will not be available at all under Windows.
1197 changesets, while it will not be available at all under Windows.
1195
1198
1196 The syntax for Python hooks is as follows::
1199 The syntax for Python hooks is as follows::
1197
1200
1198 hookname = python:modulename.submodule.callable
1201 hookname = python:modulename.submodule.callable
1199 hookname = python:/path/to/python/module.py:callable
1202 hookname = python:/path/to/python/module.py:callable
1200
1203
1201 Python hooks are run within the Mercurial process. Each hook is
1204 Python hooks are run within the Mercurial process. Each hook is
1202 called with at least three keyword arguments: a ui object (keyword
1205 called with at least three keyword arguments: a ui object (keyword
1203 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
1206 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
1204 keyword that tells what kind of hook is used. Arguments listed as
1207 keyword that tells what kind of hook is used. Arguments listed as
1205 environment variables above are passed as keyword arguments, with no
1208 environment variables above are passed as keyword arguments, with no
1206 ``HG_`` prefix, and names in lower case.
1209 ``HG_`` prefix, and names in lower case.
1207
1210
1208 If a Python hook returns a "true" value or raises an exception, this
1211 If a Python hook returns a "true" value or raises an exception, this
1209 is treated as a failure.
1212 is treated as a failure.
1210
1213
1211
1214
1212 ``hostfingerprints``
1215 ``hostfingerprints``
1213 --------------------
1216 --------------------
1214
1217
1215 (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
1218 (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
1216
1219
1217 Fingerprints of the certificates of known HTTPS servers.
1220 Fingerprints of the certificates of known HTTPS servers.
1218
1221
1219 A HTTPS connection to a server with a fingerprint configured here will
1222 A HTTPS connection to a server with a fingerprint configured here will
1220 only succeed if the servers certificate matches the fingerprint.
1223 only succeed if the servers certificate matches the fingerprint.
1221 This is very similar to how ssh known hosts works.
1224 This is very similar to how ssh known hosts works.
1222
1225
1223 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
1226 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
1224 Multiple values can be specified (separated by spaces or commas). This can
1227 Multiple values can be specified (separated by spaces or commas). This can
1225 be used to define both old and new fingerprints while a host transitions
1228 be used to define both old and new fingerprints while a host transitions
1226 to a new certificate.
1229 to a new certificate.
1227
1230
1228 The CA chain and web.cacerts is not used for servers with a fingerprint.
1231 The CA chain and web.cacerts is not used for servers with a fingerprint.
1229
1232
1230 For example::
1233 For example::
1231
1234
1232 [hostfingerprints]
1235 [hostfingerprints]
1233 hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1236 hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1234 hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1237 hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1235
1238
1236 ``hostsecurity``
1239 ``hostsecurity``
1237 ----------------
1240 ----------------
1238
1241
1239 Used to specify global and per-host security settings for connecting to
1242 Used to specify global and per-host security settings for connecting to
1240 other machines.
1243 other machines.
1241
1244
1242 The following options control default behavior for all hosts.
1245 The following options control default behavior for all hosts.
1243
1246
1244 ``ciphers``
1247 ``ciphers``
1245 Defines the cryptographic ciphers to use for connections.
1248 Defines the cryptographic ciphers to use for connections.
1246
1249
1247 Value must be a valid OpenSSL Cipher List Format as documented at
1250 Value must be a valid OpenSSL Cipher List Format as documented at
1248 https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
1251 https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
1249
1252
1250 This setting is for advanced users only. Setting to incorrect values
1253 This setting is for advanced users only. Setting to incorrect values
1251 can significantly lower connection security or decrease performance.
1254 can significantly lower connection security or decrease performance.
1252 You have been warned.
1255 You have been warned.
1253
1256
1254 This option requires Python 2.7.
1257 This option requires Python 2.7.
1255
1258
1256 ``minimumprotocol``
1259 ``minimumprotocol``
1257 Defines the minimum channel encryption protocol to use.
1260 Defines the minimum channel encryption protocol to use.
1258
1261
1259 By default, the highest version of TLS supported by both client and server
1262 By default, the highest version of TLS supported by both client and server
1260 is used.
1263 is used.
1261
1264
1262 Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
1265 Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
1263
1266
1264 When running on an old Python version, only ``tls1.0`` is allowed since
1267 When running on an old Python version, only ``tls1.0`` is allowed since
1265 old versions of Python only support up to TLS 1.0.
1268 old versions of Python only support up to TLS 1.0.
1266
1269
1267 When running a Python that supports modern TLS versions, the default is
1270 When running a Python that supports modern TLS versions, the default is
1268 ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
1271 ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
1269 weakens security and should only be used as a feature of last resort if
1272 weakens security and should only be used as a feature of last resort if
1270 a server does not support TLS 1.1+.
1273 a server does not support TLS 1.1+.
1271
1274
1272 Options in the ``[hostsecurity]`` section can have the form
1275 Options in the ``[hostsecurity]`` section can have the form
1273 ``hostname``:``setting``. This allows multiple settings to be defined on a
1276 ``hostname``:``setting``. This allows multiple settings to be defined on a
1274 per-host basis.
1277 per-host basis.
1275
1278
1276 The following per-host settings can be defined.
1279 The following per-host settings can be defined.
1277
1280
1278 ``ciphers``
1281 ``ciphers``
1279 This behaves like ``ciphers`` as described above except it only applies
1282 This behaves like ``ciphers`` as described above except it only applies
1280 to the host on which it is defined.
1283 to the host on which it is defined.
1281
1284
1282 ``fingerprints``
1285 ``fingerprints``
1283 A list of hashes of the DER encoded peer/remote certificate. Values have
1286 A list of hashes of the DER encoded peer/remote certificate. Values have
1284 the form ``algorithm``:``fingerprint``. e.g.
1287 the form ``algorithm``:``fingerprint``. e.g.
1285 ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
1288 ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
1286 In addition, colons (``:``) can appear in the fingerprint part.
1289 In addition, colons (``:``) can appear in the fingerprint part.
1287
1290
1288 The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
1291 The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
1289 ``sha512``.
1292 ``sha512``.
1290
1293
1291 Use of ``sha256`` or ``sha512`` is preferred.
1294 Use of ``sha256`` or ``sha512`` is preferred.
1292
1295
1293 If a fingerprint is specified, the CA chain is not validated for this
1296 If a fingerprint is specified, the CA chain is not validated for this
1294 host and Mercurial will require the remote certificate to match one
1297 host and Mercurial will require the remote certificate to match one
1295 of the fingerprints specified. This means if the server updates its
1298 of the fingerprints specified. This means if the server updates its
1296 certificate, Mercurial will abort until a new fingerprint is defined.
1299 certificate, Mercurial will abort until a new fingerprint is defined.
1297 This can provide stronger security than traditional CA-based validation
1300 This can provide stronger security than traditional CA-based validation
1298 at the expense of convenience.
1301 at the expense of convenience.
1299
1302
1300 This option takes precedence over ``verifycertsfile``.
1303 This option takes precedence over ``verifycertsfile``.
1301
1304
1302 ``minimumprotocol``
1305 ``minimumprotocol``
1303 This behaves like ``minimumprotocol`` as described above except it
1306 This behaves like ``minimumprotocol`` as described above except it
1304 only applies to the host on which it is defined.
1307 only applies to the host on which it is defined.
1305
1308
1306 ``verifycertsfile``
1309 ``verifycertsfile``
1307 Path to file a containing a list of PEM encoded certificates used to
1310 Path to file a containing a list of PEM encoded certificates used to
1308 verify the server certificate. Environment variables and ``~user``
1311 verify the server certificate. Environment variables and ``~user``
1309 constructs are expanded in the filename.
1312 constructs are expanded in the filename.
1310
1313
1311 The server certificate or the certificate's certificate authority (CA)
1314 The server certificate or the certificate's certificate authority (CA)
1312 must match a certificate from this file or certificate verification
1315 must match a certificate from this file or certificate verification
1313 will fail and connections to the server will be refused.
1316 will fail and connections to the server will be refused.
1314
1317
1315 If defined, only certificates provided by this file will be used:
1318 If defined, only certificates provided by this file will be used:
1316 ``web.cacerts`` and any system/default certificates will not be
1319 ``web.cacerts`` and any system/default certificates will not be
1317 used.
1320 used.
1318
1321
1319 This option has no effect if the per-host ``fingerprints`` option
1322 This option has no effect if the per-host ``fingerprints`` option
1320 is set.
1323 is set.
1321
1324
1322 The format of the file is as follows::
1325 The format of the file is as follows::
1323
1326
1324 -----BEGIN CERTIFICATE-----
1327 -----BEGIN CERTIFICATE-----
1325 ... (certificate in base64 PEM encoding) ...
1328 ... (certificate in base64 PEM encoding) ...
1326 -----END CERTIFICATE-----
1329 -----END CERTIFICATE-----
1327 -----BEGIN CERTIFICATE-----
1330 -----BEGIN CERTIFICATE-----
1328 ... (certificate in base64 PEM encoding) ...
1331 ... (certificate in base64 PEM encoding) ...
1329 -----END CERTIFICATE-----
1332 -----END CERTIFICATE-----
1330
1333
1331 For example::
1334 For example::
1332
1335
1333 [hostsecurity]
1336 [hostsecurity]
1334 hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
1337 hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
1335 hg2.example.com:fingerprints = sha1:914f1aff87249c09b6859b88b1906d30756491ca, sha1:fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1338 hg2.example.com:fingerprints = sha1:914f1aff87249c09b6859b88b1906d30756491ca, sha1:fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1336 hg3.example.com:fingerprints = sha256:9a:b0:dc:e2:75:ad:8a:b7:84:58:e5:1f:07:32:f1:87:e6:bd:24:22:af:b7:ce:8e:9c:b4:10:cf:b9:f4:0e:d2
1339 hg3.example.com:fingerprints = sha256:9a:b0:dc:e2:75:ad:8a:b7:84:58:e5:1f:07:32:f1:87:e6:bd:24:22:af:b7:ce:8e:9c:b4:10:cf:b9:f4:0e:d2
1337 foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
1340 foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
1338
1341
1339 To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
1342 To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
1340 when connecting to ``hg.example.com``::
1343 when connecting to ``hg.example.com``::
1341
1344
1342 [hostsecurity]
1345 [hostsecurity]
1343 minimumprotocol = tls1.2
1346 minimumprotocol = tls1.2
1344 hg.example.com:minimumprotocol = tls1.1
1347 hg.example.com:minimumprotocol = tls1.1
1345
1348
1346 ``http_proxy``
1349 ``http_proxy``
1347 --------------
1350 --------------
1348
1351
1349 Used to access web-based Mercurial repositories through a HTTP
1352 Used to access web-based Mercurial repositories through a HTTP
1350 proxy.
1353 proxy.
1351
1354
1352 ``host``
1355 ``host``
1353 Host name and (optional) port of the proxy server, for example
1356 Host name and (optional) port of the proxy server, for example
1354 "myproxy:8000".
1357 "myproxy:8000".
1355
1358
1356 ``no``
1359 ``no``
1357 Optional. Comma-separated list of host names that should bypass
1360 Optional. Comma-separated list of host names that should bypass
1358 the proxy.
1361 the proxy.
1359
1362
1360 ``passwd``
1363 ``passwd``
1361 Optional. Password to authenticate with at the proxy server.
1364 Optional. Password to authenticate with at the proxy server.
1362
1365
1363 ``user``
1366 ``user``
1364 Optional. User name to authenticate with at the proxy server.
1367 Optional. User name to authenticate with at the proxy server.
1365
1368
1366 ``always``
1369 ``always``
1367 Optional. Always use the proxy, even for localhost and any entries
1370 Optional. Always use the proxy, even for localhost and any entries
1368 in ``http_proxy.no``. (default: False)
1371 in ``http_proxy.no``. (default: False)
1369
1372
1370 ``http``
1373 ``http``
1371 ----------
1374 ----------
1372
1375
1373 Used to configure access to Mercurial repositories via HTTP.
1376 Used to configure access to Mercurial repositories via HTTP.
1374
1377
1375 ``timeout``
1378 ``timeout``
1376 If set, blocking operations will timeout after that many seconds.
1379 If set, blocking operations will timeout after that many seconds.
1377 (default: None)
1380 (default: None)
1378
1381
1379 ``merge``
1382 ``merge``
1380 ---------
1383 ---------
1381
1384
1382 This section specifies behavior during merges and updates.
1385 This section specifies behavior during merges and updates.
1383
1386
1384 ``checkignored``
1387 ``checkignored``
1385 Controls behavior when an ignored file on disk has the same name as a tracked
1388 Controls behavior when an ignored file on disk has the same name as a tracked
1386 file in the changeset being merged or updated to, and has different
1389 file in the changeset being merged or updated to, and has different
1387 contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
1390 contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
1388 abort on such files. With ``warn``, warn on such files and back them up as
1391 abort on such files. With ``warn``, warn on such files and back them up as
1389 ``.orig``. With ``ignore``, don't print a warning and back them up as
1392 ``.orig``. With ``ignore``, don't print a warning and back them up as
1390 ``.orig``. (default: ``abort``)
1393 ``.orig``. (default: ``abort``)
1391
1394
1392 ``checkunknown``
1395 ``checkunknown``
1393 Controls behavior when an unknown file that isn't ignored has the same name
1396 Controls behavior when an unknown file that isn't ignored has the same name
1394 as a tracked file in the changeset being merged or updated to, and has
1397 as a tracked file in the changeset being merged or updated to, and has
1395 different contents. Similar to ``merge.checkignored``, except for files that
1398 different contents. Similar to ``merge.checkignored``, except for files that
1396 are not ignored. (default: ``abort``)
1399 are not ignored. (default: ``abort``)
1397
1400
1398 ``on-failure``
1401 ``on-failure``
1399 When set to ``continue`` (the default), the merge process attempts to
1402 When set to ``continue`` (the default), the merge process attempts to
1400 merge all unresolved files using the merge chosen tool, regardless of
1403 merge all unresolved files using the merge chosen tool, regardless of
1401 whether previous file merge attempts during the process succeeded or not.
1404 whether previous file merge attempts during the process succeeded or not.
1402 Setting this to ``prompt`` will prompt after any merge failure continue
1405 Setting this to ``prompt`` will prompt after any merge failure continue
1403 or halt the merge process. Setting this to ``halt`` will automatically
1406 or halt the merge process. Setting this to ``halt`` will automatically
1404 halt the merge process on any merge tool failure. The merge process
1407 halt the merge process on any merge tool failure. The merge process
1405 can be restarted by using the ``resolve`` command. When a merge is
1408 can be restarted by using the ``resolve`` command. When a merge is
1406 halted, the repository is left in a normal ``unresolved`` merge state.
1409 halted, the repository is left in a normal ``unresolved`` merge state.
1407 (default: ``continue``)
1410 (default: ``continue``)
1408
1411
1409 ``strict-capability-check``
1412 ``strict-capability-check``
1410 Whether capabilities of internal merge tools are checked strictly
1413 Whether capabilities of internal merge tools are checked strictly
1411 or not, while examining rules to decide merge tool to be used.
1414 or not, while examining rules to decide merge tool to be used.
1412 (default: False)
1415 (default: False)
1413
1416
1414 ``merge-patterns``
1417 ``merge-patterns``
1415 ------------------
1418 ------------------
1416
1419
1417 This section specifies merge tools to associate with particular file
1420 This section specifies merge tools to associate with particular file
1418 patterns. Tools matched here will take precedence over the default
1421 patterns. Tools matched here will take precedence over the default
1419 merge tool. Patterns are globs by default, rooted at the repository
1422 merge tool. Patterns are globs by default, rooted at the repository
1420 root.
1423 root.
1421
1424
1422 Example::
1425 Example::
1423
1426
1424 [merge-patterns]
1427 [merge-patterns]
1425 **.c = kdiff3
1428 **.c = kdiff3
1426 **.jpg = myimgmerge
1429 **.jpg = myimgmerge
1427
1430
1428 ``merge-tools``
1431 ``merge-tools``
1429 ---------------
1432 ---------------
1430
1433
1431 This section configures external merge tools to use for file-level
1434 This section configures external merge tools to use for file-level
1432 merges. This section has likely been preconfigured at install time.
1435 merges. This section has likely been preconfigured at install time.
1433 Use :hg:`config merge-tools` to check the existing configuration.
1436 Use :hg:`config merge-tools` to check the existing configuration.
1434 Also see :hg:`help merge-tools` for more details.
1437 Also see :hg:`help merge-tools` for more details.
1435
1438
1436 Example ``~/.hgrc``::
1439 Example ``~/.hgrc``::
1437
1440
1438 [merge-tools]
1441 [merge-tools]
1439 # Override stock tool location
1442 # Override stock tool location
1440 kdiff3.executable = ~/bin/kdiff3
1443 kdiff3.executable = ~/bin/kdiff3
1441 # Specify command line
1444 # Specify command line
1442 kdiff3.args = $base $local $other -o $output
1445 kdiff3.args = $base $local $other -o $output
1443 # Give higher priority
1446 # Give higher priority
1444 kdiff3.priority = 1
1447 kdiff3.priority = 1
1445
1448
1446 # Changing the priority of preconfigured tool
1449 # Changing the priority of preconfigured tool
1447 meld.priority = 0
1450 meld.priority = 0
1448
1451
1449 # Disable a preconfigured tool
1452 # Disable a preconfigured tool
1450 vimdiff.disabled = yes
1453 vimdiff.disabled = yes
1451
1454
1452 # Define new tool
1455 # Define new tool
1453 myHtmlTool.args = -m $local $other $base $output
1456 myHtmlTool.args = -m $local $other $base $output
1454 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
1457 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
1455 myHtmlTool.priority = 1
1458 myHtmlTool.priority = 1
1456
1459
1457 Supported arguments:
1460 Supported arguments:
1458
1461
1459 ``priority``
1462 ``priority``
1460 The priority in which to evaluate this tool.
1463 The priority in which to evaluate this tool.
1461 (default: 0)
1464 (default: 0)
1462
1465
1463 ``executable``
1466 ``executable``
1464 Either just the name of the executable or its pathname.
1467 Either just the name of the executable or its pathname.
1465
1468
1466 .. container:: windows
1469 .. container:: windows
1467
1470
1468 On Windows, the path can use environment variables with ${ProgramFiles}
1471 On Windows, the path can use environment variables with ${ProgramFiles}
1469 syntax.
1472 syntax.
1470
1473
1471 (default: the tool name)
1474 (default: the tool name)
1472
1475
1473 ``args``
1476 ``args``
1474 The arguments to pass to the tool executable. You can refer to the
1477 The arguments to pass to the tool executable. You can refer to the
1475 files being merged as well as the output file through these
1478 files being merged as well as the output file through these
1476 variables: ``$base``, ``$local``, ``$other``, ``$output``.
1479 variables: ``$base``, ``$local``, ``$other``, ``$output``.
1477
1480
1478 The meaning of ``$local`` and ``$other`` can vary depending on which action is
1481 The meaning of ``$local`` and ``$other`` can vary depending on which action is
1479 being performed. During an update or merge, ``$local`` represents the original
1482 being performed. During an update or merge, ``$local`` represents the original
1480 state of the file, while ``$other`` represents the commit you are updating to or
1483 state of the file, while ``$other`` represents the commit you are updating to or
1481 the commit you are merging with. During a rebase, ``$local`` represents the
1484 the commit you are merging with. During a rebase, ``$local`` represents the
1482 destination of the rebase, and ``$other`` represents the commit being rebased.
1485 destination of the rebase, and ``$other`` represents the commit being rebased.
1483
1486
1484 Some operations define custom labels to assist with identifying the revisions,
1487 Some operations define custom labels to assist with identifying the revisions,
1485 accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
1488 accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
1486 labels are not available, these will be ``local``, ``other``, and ``base``,
1489 labels are not available, these will be ``local``, ``other``, and ``base``,
1487 respectively.
1490 respectively.
1488 (default: ``$local $base $other``)
1491 (default: ``$local $base $other``)
1489
1492
1490 ``premerge``
1493 ``premerge``
1491 Attempt to run internal non-interactive 3-way merge tool before
1494 Attempt to run internal non-interactive 3-way merge tool before
1492 launching external tool. Options are ``true``, ``false``, ``keep`` or
1495 launching external tool. Options are ``true``, ``false``, ``keep`` or
1493 ``keep-merge3``. The ``keep`` option will leave markers in the file if the
1496 ``keep-merge3``. The ``keep`` option will leave markers in the file if the
1494 premerge fails. The ``keep-merge3`` will do the same but include information
1497 premerge fails. The ``keep-merge3`` will do the same but include information
1495 about the base of the merge in the marker (see internal :merge3 in
1498 about the base of the merge in the marker (see internal :merge3 in
1496 :hg:`help merge-tools`).
1499 :hg:`help merge-tools`).
1497 (default: True)
1500 (default: True)
1498
1501
1499 ``binary``
1502 ``binary``
1500 This tool can merge binary files. (default: False, unless tool
1503 This tool can merge binary files. (default: False, unless tool
1501 was selected by file pattern match)
1504 was selected by file pattern match)
1502
1505
1503 ``symlink``
1506 ``symlink``
1504 This tool can merge symlinks. (default: False)
1507 This tool can merge symlinks. (default: False)
1505
1508
1506 ``check``
1509 ``check``
1507 A list of merge success-checking options:
1510 A list of merge success-checking options:
1508
1511
1509 ``changed``
1512 ``changed``
1510 Ask whether merge was successful when the merged file shows no changes.
1513 Ask whether merge was successful when the merged file shows no changes.
1511 ``conflicts``
1514 ``conflicts``
1512 Check whether there are conflicts even though the tool reported success.
1515 Check whether there are conflicts even though the tool reported success.
1513 ``prompt``
1516 ``prompt``
1514 Always prompt for merge success, regardless of success reported by tool.
1517 Always prompt for merge success, regardless of success reported by tool.
1515
1518
1516 ``fixeol``
1519 ``fixeol``
1517 Attempt to fix up EOL changes caused by the merge tool.
1520 Attempt to fix up EOL changes caused by the merge tool.
1518 (default: False)
1521 (default: False)
1519
1522
1520 ``gui``
1523 ``gui``
1521 This tool requires a graphical interface to run. (default: False)
1524 This tool requires a graphical interface to run. (default: False)
1522
1525
1523 ``mergemarkers``
1526 ``mergemarkers``
1524 Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
1527 Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
1525 ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
1528 ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
1526 ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
1529 ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
1527 markers generated during premerge will be ``detailed`` if either this option or
1530 markers generated during premerge will be ``detailed`` if either this option or
1528 the corresponding option in the ``[ui]`` section is ``detailed``.
1531 the corresponding option in the ``[ui]`` section is ``detailed``.
1529 (default: ``basic``)
1532 (default: ``basic``)
1530
1533
1531 ``mergemarkertemplate``
1534 ``mergemarkertemplate``
1532 This setting can be used to override ``mergemarkertemplate`` from the ``[ui]``
1535 This setting can be used to override ``mergemarkertemplate`` from the ``[ui]``
1533 section on a per-tool basis; this applies to the ``$label``-prefixed variables
1536 section on a per-tool basis; this applies to the ``$label``-prefixed variables
1534 and to the conflict markers that are generated if ``premerge`` is ``keep` or
1537 and to the conflict markers that are generated if ``premerge`` is ``keep` or
1535 ``keep-merge3``. See the corresponding variable in ``[ui]`` for more
1538 ``keep-merge3``. See the corresponding variable in ``[ui]`` for more
1536 information.
1539 information.
1537
1540
1538 .. container:: windows
1541 .. container:: windows
1539
1542
1540 ``regkey``
1543 ``regkey``
1541 Windows registry key which describes install location of this
1544 Windows registry key which describes install location of this
1542 tool. Mercurial will search for this key first under
1545 tool. Mercurial will search for this key first under
1543 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1546 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1544 (default: None)
1547 (default: None)
1545
1548
1546 ``regkeyalt``
1549 ``regkeyalt``
1547 An alternate Windows registry key to try if the first key is not
1550 An alternate Windows registry key to try if the first key is not
1548 found. The alternate key uses the same ``regname`` and ``regappend``
1551 found. The alternate key uses the same ``regname`` and ``regappend``
1549 semantics of the primary key. The most common use for this key
1552 semantics of the primary key. The most common use for this key
1550 is to search for 32bit applications on 64bit operating systems.
1553 is to search for 32bit applications on 64bit operating systems.
1551 (default: None)
1554 (default: None)
1552
1555
1553 ``regname``
1556 ``regname``
1554 Name of value to read from specified registry key.
1557 Name of value to read from specified registry key.
1555 (default: the unnamed (default) value)
1558 (default: the unnamed (default) value)
1556
1559
1557 ``regappend``
1560 ``regappend``
1558 String to append to the value read from the registry, typically
1561 String to append to the value read from the registry, typically
1559 the executable name of the tool.
1562 the executable name of the tool.
1560 (default: None)
1563 (default: None)
1561
1564
1562 ``pager``
1565 ``pager``
1563 ---------
1566 ---------
1564
1567
1565 Setting used to control when to paginate and with what external tool. See
1568 Setting used to control when to paginate and with what external tool. See
1566 :hg:`help pager` for details.
1569 :hg:`help pager` for details.
1567
1570
1568 ``pager``
1571 ``pager``
1569 Define the external tool used as pager.
1572 Define the external tool used as pager.
1570
1573
1571 If no pager is set, Mercurial uses the environment variable $PAGER.
1574 If no pager is set, Mercurial uses the environment variable $PAGER.
1572 If neither pager.pager, nor $PAGER is set, a default pager will be
1575 If neither pager.pager, nor $PAGER is set, a default pager will be
1573 used, typically `less` on Unix and `more` on Windows. Example::
1576 used, typically `less` on Unix and `more` on Windows. Example::
1574
1577
1575 [pager]
1578 [pager]
1576 pager = less -FRX
1579 pager = less -FRX
1577
1580
1578 ``ignore``
1581 ``ignore``
1579 List of commands to disable the pager for. Example::
1582 List of commands to disable the pager for. Example::
1580
1583
1581 [pager]
1584 [pager]
1582 ignore = version, help, update
1585 ignore = version, help, update
1583
1586
1584 ``patch``
1587 ``patch``
1585 ---------
1588 ---------
1586
1589
1587 Settings used when applying patches, for instance through the 'import'
1590 Settings used when applying patches, for instance through the 'import'
1588 command or with Mercurial Queues extension.
1591 command or with Mercurial Queues extension.
1589
1592
1590 ``eol``
1593 ``eol``
1591 When set to 'strict' patch content and patched files end of lines
1594 When set to 'strict' patch content and patched files end of lines
1592 are preserved. When set to ``lf`` or ``crlf``, both files end of
1595 are preserved. When set to ``lf`` or ``crlf``, both files end of
1593 lines are ignored when patching and the result line endings are
1596 lines are ignored when patching and the result line endings are
1594 normalized to either LF (Unix) or CRLF (Windows). When set to
1597 normalized to either LF (Unix) or CRLF (Windows). When set to
1595 ``auto``, end of lines are again ignored while patching but line
1598 ``auto``, end of lines are again ignored while patching but line
1596 endings in patched files are normalized to their original setting
1599 endings in patched files are normalized to their original setting
1597 on a per-file basis. If target file does not exist or has no end
1600 on a per-file basis. If target file does not exist or has no end
1598 of line, patch line endings are preserved.
1601 of line, patch line endings are preserved.
1599 (default: strict)
1602 (default: strict)
1600
1603
1601 ``fuzz``
1604 ``fuzz``
1602 The number of lines of 'fuzz' to allow when applying patches. This
1605 The number of lines of 'fuzz' to allow when applying patches. This
1603 controls how much context the patcher is allowed to ignore when
1606 controls how much context the patcher is allowed to ignore when
1604 trying to apply a patch.
1607 trying to apply a patch.
1605 (default: 2)
1608 (default: 2)
1606
1609
1607 ``paths``
1610 ``paths``
1608 ---------
1611 ---------
1609
1612
1610 Assigns symbolic names and behavior to repositories.
1613 Assigns symbolic names and behavior to repositories.
1611
1614
1612 Options are symbolic names defining the URL or directory that is the
1615 Options are symbolic names defining the URL or directory that is the
1613 location of the repository. Example::
1616 location of the repository. Example::
1614
1617
1615 [paths]
1618 [paths]
1616 my_server = https://example.com/my_repo
1619 my_server = https://example.com/my_repo
1617 local_path = /home/me/repo
1620 local_path = /home/me/repo
1618
1621
1619 These symbolic names can be used from the command line. To pull
1622 These symbolic names can be used from the command line. To pull
1620 from ``my_server``: :hg:`pull my_server`. To push to ``local_path``:
1623 from ``my_server``: :hg:`pull my_server`. To push to ``local_path``:
1621 :hg:`push local_path`.
1624 :hg:`push local_path`.
1622
1625
1623 Options containing colons (``:``) denote sub-options that can influence
1626 Options containing colons (``:``) denote sub-options that can influence
1624 behavior for that specific path. Example::
1627 behavior for that specific path. Example::
1625
1628
1626 [paths]
1629 [paths]
1627 my_server = https://example.com/my_path
1630 my_server = https://example.com/my_path
1628 my_server:pushurl = ssh://example.com/my_path
1631 my_server:pushurl = ssh://example.com/my_path
1629
1632
1630 The following sub-options can be defined:
1633 The following sub-options can be defined:
1631
1634
1632 ``pushurl``
1635 ``pushurl``
1633 The URL to use for push operations. If not defined, the location
1636 The URL to use for push operations. If not defined, the location
1634 defined by the path's main entry is used.
1637 defined by the path's main entry is used.
1635
1638
1636 ``pushrev``
1639 ``pushrev``
1637 A revset defining which revisions to push by default.
1640 A revset defining which revisions to push by default.
1638
1641
1639 When :hg:`push` is executed without a ``-r`` argument, the revset
1642 When :hg:`push` is executed without a ``-r`` argument, the revset
1640 defined by this sub-option is evaluated to determine what to push.
1643 defined by this sub-option is evaluated to determine what to push.
1641
1644
1642 For example, a value of ``.`` will push the working directory's
1645 For example, a value of ``.`` will push the working directory's
1643 revision by default.
1646 revision by default.
1644
1647
1645 Revsets specifying bookmarks will not result in the bookmark being
1648 Revsets specifying bookmarks will not result in the bookmark being
1646 pushed.
1649 pushed.
1647
1650
1648 The following special named paths exist:
1651 The following special named paths exist:
1649
1652
1650 ``default``
1653 ``default``
1651 The URL or directory to use when no source or remote is specified.
1654 The URL or directory to use when no source or remote is specified.
1652
1655
1653 :hg:`clone` will automatically define this path to the location the
1656 :hg:`clone` will automatically define this path to the location the
1654 repository was cloned from.
1657 repository was cloned from.
1655
1658
1656 ``default-push``
1659 ``default-push``
1657 (deprecated) The URL or directory for the default :hg:`push` location.
1660 (deprecated) The URL or directory for the default :hg:`push` location.
1658 ``default:pushurl`` should be used instead.
1661 ``default:pushurl`` should be used instead.
1659
1662
1660 ``phases``
1663 ``phases``
1661 ----------
1664 ----------
1662
1665
1663 Specifies default handling of phases. See :hg:`help phases` for more
1666 Specifies default handling of phases. See :hg:`help phases` for more
1664 information about working with phases.
1667 information about working with phases.
1665
1668
1666 ``publish``
1669 ``publish``
1667 Controls draft phase behavior when working as a server. When true,
1670 Controls draft phase behavior when working as a server. When true,
1668 pushed changesets are set to public in both client and server and
1671 pushed changesets are set to public in both client and server and
1669 pulled or cloned changesets are set to public in the client.
1672 pulled or cloned changesets are set to public in the client.
1670 (default: True)
1673 (default: True)
1671
1674
1672 ``new-commit``
1675 ``new-commit``
1673 Phase of newly-created commits.
1676 Phase of newly-created commits.
1674 (default: draft)
1677 (default: draft)
1675
1678
1676 ``checksubrepos``
1679 ``checksubrepos``
1677 Check the phase of the current revision of each subrepository. Allowed
1680 Check the phase of the current revision of each subrepository. Allowed
1678 values are "ignore", "follow" and "abort". For settings other than
1681 values are "ignore", "follow" and "abort". For settings other than
1679 "ignore", the phase of the current revision of each subrepository is
1682 "ignore", the phase of the current revision of each subrepository is
1680 checked before committing the parent repository. If any of those phases is
1683 checked before committing the parent repository. If any of those phases is
1681 greater than the phase of the parent repository (e.g. if a subrepo is in a
1684 greater than the phase of the parent repository (e.g. if a subrepo is in a
1682 "secret" phase while the parent repo is in "draft" phase), the commit is
1685 "secret" phase while the parent repo is in "draft" phase), the commit is
1683 either aborted (if checksubrepos is set to "abort") or the higher phase is
1686 either aborted (if checksubrepos is set to "abort") or the higher phase is
1684 used for the parent repository commit (if set to "follow").
1687 used for the parent repository commit (if set to "follow").
1685 (default: follow)
1688 (default: follow)
1686
1689
1687
1690
1688 ``profiling``
1691 ``profiling``
1689 -------------
1692 -------------
1690
1693
1691 Specifies profiling type, format, and file output. Two profilers are
1694 Specifies profiling type, format, and file output. Two profilers are
1692 supported: an instrumenting profiler (named ``ls``), and a sampling
1695 supported: an instrumenting profiler (named ``ls``), and a sampling
1693 profiler (named ``stat``).
1696 profiler (named ``stat``).
1694
1697
1695 In this section description, 'profiling data' stands for the raw data
1698 In this section description, 'profiling data' stands for the raw data
1696 collected during profiling, while 'profiling report' stands for a
1699 collected during profiling, while 'profiling report' stands for a
1697 statistical text report generated from the profiling data.
1700 statistical text report generated from the profiling data.
1698
1701
1699 ``enabled``
1702 ``enabled``
1700 Enable the profiler.
1703 Enable the profiler.
1701 (default: false)
1704 (default: false)
1702
1705
1703 This is equivalent to passing ``--profile`` on the command line.
1706 This is equivalent to passing ``--profile`` on the command line.
1704
1707
1705 ``type``
1708 ``type``
1706 The type of profiler to use.
1709 The type of profiler to use.
1707 (default: stat)
1710 (default: stat)
1708
1711
1709 ``ls``
1712 ``ls``
1710 Use Python's built-in instrumenting profiler. This profiler
1713 Use Python's built-in instrumenting profiler. This profiler
1711 works on all platforms, but each line number it reports is the
1714 works on all platforms, but each line number it reports is the
1712 first line of a function. This restriction makes it difficult to
1715 first line of a function. This restriction makes it difficult to
1713 identify the expensive parts of a non-trivial function.
1716 identify the expensive parts of a non-trivial function.
1714 ``stat``
1717 ``stat``
1715 Use a statistical profiler, statprof. This profiler is most
1718 Use a statistical profiler, statprof. This profiler is most
1716 useful for profiling commands that run for longer than about 0.1
1719 useful for profiling commands that run for longer than about 0.1
1717 seconds.
1720 seconds.
1718
1721
1719 ``format``
1722 ``format``
1720 Profiling format. Specific to the ``ls`` instrumenting profiler.
1723 Profiling format. Specific to the ``ls`` instrumenting profiler.
1721 (default: text)
1724 (default: text)
1722
1725
1723 ``text``
1726 ``text``
1724 Generate a profiling report. When saving to a file, it should be
1727 Generate a profiling report. When saving to a file, it should be
1725 noted that only the report is saved, and the profiling data is
1728 noted that only the report is saved, and the profiling data is
1726 not kept.
1729 not kept.
1727 ``kcachegrind``
1730 ``kcachegrind``
1728 Format profiling data for kcachegrind use: when saving to a
1731 Format profiling data for kcachegrind use: when saving to a
1729 file, the generated file can directly be loaded into
1732 file, the generated file can directly be loaded into
1730 kcachegrind.
1733 kcachegrind.
1731
1734
1732 ``statformat``
1735 ``statformat``
1733 Profiling format for the ``stat`` profiler.
1736 Profiling format for the ``stat`` profiler.
1734 (default: hotpath)
1737 (default: hotpath)
1735
1738
1736 ``hotpath``
1739 ``hotpath``
1737 Show a tree-based display containing the hot path of execution (where
1740 Show a tree-based display containing the hot path of execution (where
1738 most time was spent).
1741 most time was spent).
1739 ``bymethod``
1742 ``bymethod``
1740 Show a table of methods ordered by how frequently they are active.
1743 Show a table of methods ordered by how frequently they are active.
1741 ``byline``
1744 ``byline``
1742 Show a table of lines in files ordered by how frequently they are active.
1745 Show a table of lines in files ordered by how frequently they are active.
1743 ``json``
1746 ``json``
1744 Render profiling data as JSON.
1747 Render profiling data as JSON.
1745
1748
1746 ``frequency``
1749 ``frequency``
1747 Sampling frequency. Specific to the ``stat`` sampling profiler.
1750 Sampling frequency. Specific to the ``stat`` sampling profiler.
1748 (default: 1000)
1751 (default: 1000)
1749
1752
1750 ``output``
1753 ``output``
1751 File path where profiling data or report should be saved. If the
1754 File path where profiling data or report should be saved. If the
1752 file exists, it is replaced. (default: None, data is printed on
1755 file exists, it is replaced. (default: None, data is printed on
1753 stderr)
1756 stderr)
1754
1757
1755 ``sort``
1758 ``sort``
1756 Sort field. Specific to the ``ls`` instrumenting profiler.
1759 Sort field. Specific to the ``ls`` instrumenting profiler.
1757 One of ``callcount``, ``reccallcount``, ``totaltime`` and
1760 One of ``callcount``, ``reccallcount``, ``totaltime`` and
1758 ``inlinetime``.
1761 ``inlinetime``.
1759 (default: inlinetime)
1762 (default: inlinetime)
1760
1763
1761 ``time-track``
1764 ``time-track``
1762 Control if the stat profiler track ``cpu`` or ``real`` time.
1765 Control if the stat profiler track ``cpu`` or ``real`` time.
1763 (default: ``cpu`` on Windows, otherwise ``real``)
1766 (default: ``cpu`` on Windows, otherwise ``real``)
1764
1767
1765 ``limit``
1768 ``limit``
1766 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
1769 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
1767 (default: 30)
1770 (default: 30)
1768
1771
1769 ``nested``
1772 ``nested``
1770 Show at most this number of lines of drill-down info after each main entry.
1773 Show at most this number of lines of drill-down info after each main entry.
1771 This can help explain the difference between Total and Inline.
1774 This can help explain the difference between Total and Inline.
1772 Specific to the ``ls`` instrumenting profiler.
1775 Specific to the ``ls`` instrumenting profiler.
1773 (default: 0)
1776 (default: 0)
1774
1777
1775 ``showmin``
1778 ``showmin``
1776 Minimum fraction of samples an entry must have for it to be displayed.
1779 Minimum fraction of samples an entry must have for it to be displayed.
1777 Can be specified as a float between ``0.0`` and ``1.0`` or can have a
1780 Can be specified as a float between ``0.0`` and ``1.0`` or can have a
1778 ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
1781 ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
1779
1782
1780 Only used by the ``stat`` profiler.
1783 Only used by the ``stat`` profiler.
1781
1784
1782 For the ``hotpath`` format, default is ``0.05``.
1785 For the ``hotpath`` format, default is ``0.05``.
1783 For the ``chrome`` format, default is ``0.005``.
1786 For the ``chrome`` format, default is ``0.005``.
1784
1787
1785 The option is unused on other formats.
1788 The option is unused on other formats.
1786
1789
1787 ``showmax``
1790 ``showmax``
1788 Maximum fraction of samples an entry can have before it is ignored in
1791 Maximum fraction of samples an entry can have before it is ignored in
1789 display. Values format is the same as ``showmin``.
1792 display. Values format is the same as ``showmin``.
1790
1793
1791 Only used by the ``stat`` profiler.
1794 Only used by the ``stat`` profiler.
1792
1795
1793 For the ``chrome`` format, default is ``0.999``.
1796 For the ``chrome`` format, default is ``0.999``.
1794
1797
1795 The option is unused on other formats.
1798 The option is unused on other formats.
1796
1799
1797 ``showtime``
1800 ``showtime``
1798 Show time taken as absolute durations, in addition to percentages.
1801 Show time taken as absolute durations, in addition to percentages.
1799 Only used by the ``hotpath`` format.
1802 Only used by the ``hotpath`` format.
1800 (default: true)
1803 (default: true)
1801
1804
1802 ``progress``
1805 ``progress``
1803 ------------
1806 ------------
1804
1807
1805 Mercurial commands can draw progress bars that are as informative as
1808 Mercurial commands can draw progress bars that are as informative as
1806 possible. Some progress bars only offer indeterminate information, while others
1809 possible. Some progress bars only offer indeterminate information, while others
1807 have a definite end point.
1810 have a definite end point.
1808
1811
1809 ``debug``
1812 ``debug``
1810 Whether to print debug info when updating the progress bar. (default: False)
1813 Whether to print debug info when updating the progress bar. (default: False)
1811
1814
1812 ``delay``
1815 ``delay``
1813 Number of seconds (float) before showing the progress bar. (default: 3)
1816 Number of seconds (float) before showing the progress bar. (default: 3)
1814
1817
1815 ``changedelay``
1818 ``changedelay``
1816 Minimum delay before showing a new topic. When set to less than 3 * refresh,
1819 Minimum delay before showing a new topic. When set to less than 3 * refresh,
1817 that value will be used instead. (default: 1)
1820 that value will be used instead. (default: 1)
1818
1821
1819 ``estimateinterval``
1822 ``estimateinterval``
1820 Maximum sampling interval in seconds for speed and estimated time
1823 Maximum sampling interval in seconds for speed and estimated time
1821 calculation. (default: 60)
1824 calculation. (default: 60)
1822
1825
1823 ``refresh``
1826 ``refresh``
1824 Time in seconds between refreshes of the progress bar. (default: 0.1)
1827 Time in seconds between refreshes of the progress bar. (default: 0.1)
1825
1828
1826 ``format``
1829 ``format``
1827 Format of the progress bar.
1830 Format of the progress bar.
1828
1831
1829 Valid entries for the format field are ``topic``, ``bar``, ``number``,
1832 Valid entries for the format field are ``topic``, ``bar``, ``number``,
1830 ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
1833 ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
1831 last 20 characters of the item, but this can be changed by adding either
1834 last 20 characters of the item, but this can be changed by adding either
1832 ``-<num>`` which would take the last num characters, or ``+<num>`` for the
1835 ``-<num>`` which would take the last num characters, or ``+<num>`` for the
1833 first num characters.
1836 first num characters.
1834
1837
1835 (default: topic bar number estimate)
1838 (default: topic bar number estimate)
1836
1839
1837 ``width``
1840 ``width``
1838 If set, the maximum width of the progress information (that is, min(width,
1841 If set, the maximum width of the progress information (that is, min(width,
1839 term width) will be used).
1842 term width) will be used).
1840
1843
1841 ``clear-complete``
1844 ``clear-complete``
1842 Clear the progress bar after it's done. (default: True)
1845 Clear the progress bar after it's done. (default: True)
1843
1846
1844 ``disable``
1847 ``disable``
1845 If true, don't show a progress bar.
1848 If true, don't show a progress bar.
1846
1849
1847 ``assume-tty``
1850 ``assume-tty``
1848 If true, ALWAYS show a progress bar, unless disable is given.
1851 If true, ALWAYS show a progress bar, unless disable is given.
1849
1852
1850 ``rebase``
1853 ``rebase``
1851 ----------
1854 ----------
1852
1855
1853 ``evolution.allowdivergence``
1856 ``evolution.allowdivergence``
1854 Default to False, when True allow creating divergence when performing
1857 Default to False, when True allow creating divergence when performing
1855 rebase of obsolete changesets.
1858 rebase of obsolete changesets.
1856
1859
1857 ``revsetalias``
1860 ``revsetalias``
1858 ---------------
1861 ---------------
1859
1862
1860 Alias definitions for revsets. See :hg:`help revsets` for details.
1863 Alias definitions for revsets. See :hg:`help revsets` for details.
1861
1864
1862 ``rewrite``
1865 ``rewrite``
1863 -----------
1866 -----------
1864
1867
1865 ``backup-bundle``
1868 ``backup-bundle``
1866 Whether to save stripped changesets to a bundle file. (default: True)
1869 Whether to save stripped changesets to a bundle file. (default: True)
1867
1870
1868 ``update-timestamp``
1871 ``update-timestamp``
1869 If true, updates the date and time of the changeset to current. It is only
1872 If true, updates the date and time of the changeset to current. It is only
1870 applicable for `hg amend`, `hg commit --amend` and `hg uncommit` in the
1873 applicable for `hg amend`, `hg commit --amend` and `hg uncommit` in the
1871 current version.
1874 current version.
1872
1875
1873 ``storage``
1876 ``storage``
1874 -----------
1877 -----------
1875
1878
1876 Control the strategy Mercurial uses internally to store history. Options in this
1879 Control the strategy Mercurial uses internally to store history. Options in this
1877 category impact performance and repository size.
1880 category impact performance and repository size.
1878
1881
1879 ``revlog.optimize-delta-parent-choice``
1882 ``revlog.optimize-delta-parent-choice``
1880 When storing a merge revision, both parents will be equally considered as
1883 When storing a merge revision, both parents will be equally considered as
1881 a possible delta base. This results in better delta selection and improved
1884 a possible delta base. This results in better delta selection and improved
1882 revlog compression. This option is enabled by default.
1885 revlog compression. This option is enabled by default.
1883
1886
1884 Turning this option off can result in large increase of repository size for
1887 Turning this option off can result in large increase of repository size for
1885 repository with many merges.
1888 repository with many merges.
1886
1889
1887 ``revlog.reuse-external-delta-parent``
1890 ``revlog.reuse-external-delta-parent``
1888 Control the order in which delta parents are considered when adding new
1891 Control the order in which delta parents are considered when adding new
1889 revisions from an external source.
1892 revisions from an external source.
1890 (typically: apply bundle from `hg pull` or `hg push`).
1893 (typically: apply bundle from `hg pull` or `hg push`).
1891
1894
1892 New revisions are usually provided as a delta against other revisions. By
1895 New revisions are usually provided as a delta against other revisions. By
1893 default, Mercurial will try to reuse this delta first, therefore using the
1896 default, Mercurial will try to reuse this delta first, therefore using the
1894 same "delta parent" as the source. Directly using delta's from the source
1897 same "delta parent" as the source. Directly using delta's from the source
1895 reduces CPU usage and usually speeds up operation. However, in some case,
1898 reduces CPU usage and usually speeds up operation. However, in some case,
1896 the source might have sub-optimal delta bases and forcing their reevaluation
1899 the source might have sub-optimal delta bases and forcing their reevaluation
1897 is useful. For example, pushes from an old client could have sub-optimal
1900 is useful. For example, pushes from an old client could have sub-optimal
1898 delta's parent that the server want to optimize. (lack of general delta, bad
1901 delta's parent that the server want to optimize. (lack of general delta, bad
1899 parents, choice, lack of sparse-revlog, etc).
1902 parents, choice, lack of sparse-revlog, etc).
1900
1903
1901 This option is enabled by default. Turning it off will ensure bad delta
1904 This option is enabled by default. Turning it off will ensure bad delta
1902 parent choices from older client do not propagate to this repository, at
1905 parent choices from older client do not propagate to this repository, at
1903 the cost of a small increase in CPU consumption.
1906 the cost of a small increase in CPU consumption.
1904
1907
1905 Note: this option only control the order in which delta parents are
1908 Note: this option only control the order in which delta parents are
1906 considered. Even when disabled, the existing delta from the source will be
1909 considered. Even when disabled, the existing delta from the source will be
1907 reused if the same delta parent is selected.
1910 reused if the same delta parent is selected.
1908
1911
1909 ``revlog.reuse-external-delta``
1912 ``revlog.reuse-external-delta``
1910 Control the reuse of delta from external source.
1913 Control the reuse of delta from external source.
1911 (typically: apply bundle from `hg pull` or `hg push`).
1914 (typically: apply bundle from `hg pull` or `hg push`).
1912
1915
1913 New revisions are usually provided as a delta against another revision. By
1916 New revisions are usually provided as a delta against another revision. By
1914 default, Mercurial will not recompute the same delta again, trusting
1917 default, Mercurial will not recompute the same delta again, trusting
1915 externally provided deltas. There have been rare cases of small adjustment
1918 externally provided deltas. There have been rare cases of small adjustment
1916 to the diffing algorithm in the past. So in some rare case, recomputing
1919 to the diffing algorithm in the past. So in some rare case, recomputing
1917 delta provided by ancient clients can provides better results. Disabling
1920 delta provided by ancient clients can provides better results. Disabling
1918 this option means going through a full delta recomputation for all incoming
1921 this option means going through a full delta recomputation for all incoming
1919 revisions. It means a large increase in CPU usage and will slow operations
1922 revisions. It means a large increase in CPU usage and will slow operations
1920 down.
1923 down.
1921
1924
1922 This option is enabled by default. When disabled, it also disables the
1925 This option is enabled by default. When disabled, it also disables the
1923 related ``storage.revlog.reuse-external-delta-parent`` option.
1926 related ``storage.revlog.reuse-external-delta-parent`` option.
1924
1927
1925 ``revlog.zlib.level``
1928 ``revlog.zlib.level``
1926 Zlib compression level used when storing data into the repository. Accepted
1929 Zlib compression level used when storing data into the repository. Accepted
1927 Value range from 1 (lowest compression) to 9 (highest compression). Zlib
1930 Value range from 1 (lowest compression) to 9 (highest compression). Zlib
1928 default value is 6.
1931 default value is 6.
1929
1932
1930
1933
1931 ``revlog.zstd.level``
1934 ``revlog.zstd.level``
1932 zstd compression level used when storing data into the repository. Accepted
1935 zstd compression level used when storing data into the repository. Accepted
1933 Value range from 1 (lowest compression) to 22 (highest compression).
1936 Value range from 1 (lowest compression) to 22 (highest compression).
1934 (default 3)
1937 (default 3)
1935
1938
1936 ``server``
1939 ``server``
1937 ----------
1940 ----------
1938
1941
1939 Controls generic server settings.
1942 Controls generic server settings.
1940
1943
1941 ``bookmarks-pushkey-compat``
1944 ``bookmarks-pushkey-compat``
1942 Trigger pushkey hook when being pushed bookmark updates. This config exist
1945 Trigger pushkey hook when being pushed bookmark updates. This config exist
1943 for compatibility purpose (default to True)
1946 for compatibility purpose (default to True)
1944
1947
1945 If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
1948 If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
1946 movement we recommend you migrate them to ``txnclose-bookmark`` and
1949 movement we recommend you migrate them to ``txnclose-bookmark`` and
1947 ``pretxnclose-bookmark``.
1950 ``pretxnclose-bookmark``.
1948
1951
1949 ``compressionengines``
1952 ``compressionengines``
1950 List of compression engines and their relative priority to advertise
1953 List of compression engines and their relative priority to advertise
1951 to clients.
1954 to clients.
1952
1955
1953 The order of compression engines determines their priority, the first
1956 The order of compression engines determines their priority, the first
1954 having the highest priority. If a compression engine is not listed
1957 having the highest priority. If a compression engine is not listed
1955 here, it won't be advertised to clients.
1958 here, it won't be advertised to clients.
1956
1959
1957 If not set (the default), built-in defaults are used. Run
1960 If not set (the default), built-in defaults are used. Run
1958 :hg:`debuginstall` to list available compression engines and their
1961 :hg:`debuginstall` to list available compression engines and their
1959 default wire protocol priority.
1962 default wire protocol priority.
1960
1963
1961 Older Mercurial clients only support zlib compression and this setting
1964 Older Mercurial clients only support zlib compression and this setting
1962 has no effect for legacy clients.
1965 has no effect for legacy clients.
1963
1966
1964 ``uncompressed``
1967 ``uncompressed``
1965 Whether to allow clients to clone a repository using the
1968 Whether to allow clients to clone a repository using the
1966 uncompressed streaming protocol. This transfers about 40% more
1969 uncompressed streaming protocol. This transfers about 40% more
1967 data than a regular clone, but uses less memory and CPU on both
1970 data than a regular clone, but uses less memory and CPU on both
1968 server and client. Over a LAN (100 Mbps or better) or a very fast
1971 server and client. Over a LAN (100 Mbps or better) or a very fast
1969 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
1972 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
1970 regular clone. Over most WAN connections (anything slower than
1973 regular clone. Over most WAN connections (anything slower than
1971 about 6 Mbps), uncompressed streaming is slower, because of the
1974 about 6 Mbps), uncompressed streaming is slower, because of the
1972 extra data transfer overhead. This mode will also temporarily hold
1975 extra data transfer overhead. This mode will also temporarily hold
1973 the write lock while determining what data to transfer.
1976 the write lock while determining what data to transfer.
1974 (default: True)
1977 (default: True)
1975
1978
1976 ``uncompressedallowsecret``
1979 ``uncompressedallowsecret``
1977 Whether to allow stream clones when the repository contains secret
1980 Whether to allow stream clones when the repository contains secret
1978 changesets. (default: False)
1981 changesets. (default: False)
1979
1982
1980 ``preferuncompressed``
1983 ``preferuncompressed``
1981 When set, clients will try to use the uncompressed streaming
1984 When set, clients will try to use the uncompressed streaming
1982 protocol. (default: False)
1985 protocol. (default: False)
1983
1986
1984 ``disablefullbundle``
1987 ``disablefullbundle``
1985 When set, servers will refuse attempts to do pull-based clones.
1988 When set, servers will refuse attempts to do pull-based clones.
1986 If this option is set, ``preferuncompressed`` and/or clone bundles
1989 If this option is set, ``preferuncompressed`` and/or clone bundles
1987 are highly recommended. Partial clones will still be allowed.
1990 are highly recommended. Partial clones will still be allowed.
1988 (default: False)
1991 (default: False)
1989
1992
1990 ``streamunbundle``
1993 ``streamunbundle``
1991 When set, servers will apply data sent from the client directly,
1994 When set, servers will apply data sent from the client directly,
1992 otherwise it will be written to a temporary file first. This option
1995 otherwise it will be written to a temporary file first. This option
1993 effectively prevents concurrent pushes.
1996 effectively prevents concurrent pushes.
1994
1997
1995 ``pullbundle``
1998 ``pullbundle``
1996 When set, the server will check pullbundle.manifest for bundles
1999 When set, the server will check pullbundle.manifest for bundles
1997 covering the requested heads and common nodes. The first matching
2000 covering the requested heads and common nodes. The first matching
1998 entry will be streamed to the client.
2001 entry will be streamed to the client.
1999
2002
2000 For HTTP transport, the stream will still use zlib compression
2003 For HTTP transport, the stream will still use zlib compression
2001 for older clients.
2004 for older clients.
2002
2005
2003 ``concurrent-push-mode``
2006 ``concurrent-push-mode``
2004 Level of allowed race condition between two pushing clients.
2007 Level of allowed race condition between two pushing clients.
2005
2008
2006 - 'strict': push is abort if another client touched the repository
2009 - 'strict': push is abort if another client touched the repository
2007 while the push was preparing. (default)
2010 while the push was preparing. (default)
2008 - 'check-related': push is only aborted if it affects head that got also
2011 - 'check-related': push is only aborted if it affects head that got also
2009 affected while the push was preparing.
2012 affected while the push was preparing.
2010
2013
2011 This requires compatible client (version 4.3 and later). Old client will
2014 This requires compatible client (version 4.3 and later). Old client will
2012 use 'strict'.
2015 use 'strict'.
2013
2016
2014 ``validate``
2017 ``validate``
2015 Whether to validate the completeness of pushed changesets by
2018 Whether to validate the completeness of pushed changesets by
2016 checking that all new file revisions specified in manifests are
2019 checking that all new file revisions specified in manifests are
2017 present. (default: False)
2020 present. (default: False)
2018
2021
2019 ``maxhttpheaderlen``
2022 ``maxhttpheaderlen``
2020 Instruct HTTP clients not to send request headers longer than this
2023 Instruct HTTP clients not to send request headers longer than this
2021 many bytes. (default: 1024)
2024 many bytes. (default: 1024)
2022
2025
2023 ``bundle1``
2026 ``bundle1``
2024 Whether to allow clients to push and pull using the legacy bundle1
2027 Whether to allow clients to push and pull using the legacy bundle1
2025 exchange format. (default: True)
2028 exchange format. (default: True)
2026
2029
2027 ``bundle1gd``
2030 ``bundle1gd``
2028 Like ``bundle1`` but only used if the repository is using the
2031 Like ``bundle1`` but only used if the repository is using the
2029 *generaldelta* storage format. (default: True)
2032 *generaldelta* storage format. (default: True)
2030
2033
2031 ``bundle1.push``
2034 ``bundle1.push``
2032 Whether to allow clients to push using the legacy bundle1 exchange
2035 Whether to allow clients to push using the legacy bundle1 exchange
2033 format. (default: True)
2036 format. (default: True)
2034
2037
2035 ``bundle1gd.push``
2038 ``bundle1gd.push``
2036 Like ``bundle1.push`` but only used if the repository is using the
2039 Like ``bundle1.push`` but only used if the repository is using the
2037 *generaldelta* storage format. (default: True)
2040 *generaldelta* storage format. (default: True)
2038
2041
2039 ``bundle1.pull``
2042 ``bundle1.pull``
2040 Whether to allow clients to pull using the legacy bundle1 exchange
2043 Whether to allow clients to pull using the legacy bundle1 exchange
2041 format. (default: True)
2044 format. (default: True)
2042
2045
2043 ``bundle1gd.pull``
2046 ``bundle1gd.pull``
2044 Like ``bundle1.pull`` but only used if the repository is using the
2047 Like ``bundle1.pull`` but only used if the repository is using the
2045 *generaldelta* storage format. (default: True)
2048 *generaldelta* storage format. (default: True)
2046
2049
2047 Large repositories using the *generaldelta* storage format should
2050 Large repositories using the *generaldelta* storage format should
2048 consider setting this option because converting *generaldelta*
2051 consider setting this option because converting *generaldelta*
2049 repositories to the exchange format required by the bundle1 data
2052 repositories to the exchange format required by the bundle1 data
2050 format can consume a lot of CPU.
2053 format can consume a lot of CPU.
2051
2054
2052 ``bundle2.stream``
2055 ``bundle2.stream``
2053 Whether to allow clients to pull using the bundle2 streaming protocol.
2056 Whether to allow clients to pull using the bundle2 streaming protocol.
2054 (default: True)
2057 (default: True)
2055
2058
2056 ``zliblevel``
2059 ``zliblevel``
2057 Integer between ``-1`` and ``9`` that controls the zlib compression level
2060 Integer between ``-1`` and ``9`` that controls the zlib compression level
2058 for wire protocol commands that send zlib compressed output (notably the
2061 for wire protocol commands that send zlib compressed output (notably the
2059 commands that send repository history data).
2062 commands that send repository history data).
2060
2063
2061 The default (``-1``) uses the default zlib compression level, which is
2064 The default (``-1``) uses the default zlib compression level, which is
2062 likely equivalent to ``6``. ``0`` means no compression. ``9`` means
2065 likely equivalent to ``6``. ``0`` means no compression. ``9`` means
2063 maximum compression.
2066 maximum compression.
2064
2067
2065 Setting this option allows server operators to make trade-offs between
2068 Setting this option allows server operators to make trade-offs between
2066 bandwidth and CPU used. Lowering the compression lowers CPU utilization
2069 bandwidth and CPU used. Lowering the compression lowers CPU utilization
2067 but sends more bytes to clients.
2070 but sends more bytes to clients.
2068
2071
2069 This option only impacts the HTTP server.
2072 This option only impacts the HTTP server.
2070
2073
2071 ``zstdlevel``
2074 ``zstdlevel``
2072 Integer between ``1`` and ``22`` that controls the zstd compression level
2075 Integer between ``1`` and ``22`` that controls the zstd compression level
2073 for wire protocol commands. ``1`` is the minimal amount of compression and
2076 for wire protocol commands. ``1`` is the minimal amount of compression and
2074 ``22`` is the highest amount of compression.
2077 ``22`` is the highest amount of compression.
2075
2078
2076 The default (``3``) should be significantly faster than zlib while likely
2079 The default (``3``) should be significantly faster than zlib while likely
2077 delivering better compression ratios.
2080 delivering better compression ratios.
2078
2081
2079 This option only impacts the HTTP server.
2082 This option only impacts the HTTP server.
2080
2083
2081 See also ``server.zliblevel``.
2084 See also ``server.zliblevel``.
2082
2085
2083 ``view``
2086 ``view``
2084 Repository filter used when exchanging revisions with the peer.
2087 Repository filter used when exchanging revisions with the peer.
2085
2088
2086 The default view (``served``) excludes secret and hidden changesets.
2089 The default view (``served``) excludes secret and hidden changesets.
2087 Another useful value is ``immutable`` (no draft, secret or hidden
2090 Another useful value is ``immutable`` (no draft, secret or hidden
2088 changesets). (EXPERIMENTAL)
2091 changesets). (EXPERIMENTAL)
2089
2092
2090 ``smtp``
2093 ``smtp``
2091 --------
2094 --------
2092
2095
2093 Configuration for extensions that need to send email messages.
2096 Configuration for extensions that need to send email messages.
2094
2097
2095 ``host``
2098 ``host``
2096 Host name of mail server, e.g. "mail.example.com".
2099 Host name of mail server, e.g. "mail.example.com".
2097
2100
2098 ``port``
2101 ``port``
2099 Optional. Port to connect to on mail server. (default: 465 if
2102 Optional. Port to connect to on mail server. (default: 465 if
2100 ``tls`` is smtps; 25 otherwise)
2103 ``tls`` is smtps; 25 otherwise)
2101
2104
2102 ``tls``
2105 ``tls``
2103 Optional. Method to enable TLS when connecting to mail server: starttls,
2106 Optional. Method to enable TLS when connecting to mail server: starttls,
2104 smtps or none. (default: none)
2107 smtps or none. (default: none)
2105
2108
2106 ``username``
2109 ``username``
2107 Optional. User name for authenticating with the SMTP server.
2110 Optional. User name for authenticating with the SMTP server.
2108 (default: None)
2111 (default: None)
2109
2112
2110 ``password``
2113 ``password``
2111 Optional. Password for authenticating with the SMTP server. If not
2114 Optional. Password for authenticating with the SMTP server. If not
2112 specified, interactive sessions will prompt the user for a
2115 specified, interactive sessions will prompt the user for a
2113 password; non-interactive sessions will fail. (default: None)
2116 password; non-interactive sessions will fail. (default: None)
2114
2117
2115 ``local_hostname``
2118 ``local_hostname``
2116 Optional. The hostname that the sender can use to identify
2119 Optional. The hostname that the sender can use to identify
2117 itself to the MTA.
2120 itself to the MTA.
2118
2121
2119
2122
2120 ``subpaths``
2123 ``subpaths``
2121 ------------
2124 ------------
2122
2125
2123 Subrepository source URLs can go stale if a remote server changes name
2126 Subrepository source URLs can go stale if a remote server changes name
2124 or becomes temporarily unavailable. This section lets you define
2127 or becomes temporarily unavailable. This section lets you define
2125 rewrite rules of the form::
2128 rewrite rules of the form::
2126
2129
2127 <pattern> = <replacement>
2130 <pattern> = <replacement>
2128
2131
2129 where ``pattern`` is a regular expression matching a subrepository
2132 where ``pattern`` is a regular expression matching a subrepository
2130 source URL and ``replacement`` is the replacement string used to
2133 source URL and ``replacement`` is the replacement string used to
2131 rewrite it. Groups can be matched in ``pattern`` and referenced in
2134 rewrite it. Groups can be matched in ``pattern`` and referenced in
2132 ``replacements``. For instance::
2135 ``replacements``. For instance::
2133
2136
2134 http://server/(.*)-hg/ = http://hg.server/\1/
2137 http://server/(.*)-hg/ = http://hg.server/\1/
2135
2138
2136 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
2139 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
2137
2140
2138 Relative subrepository paths are first made absolute, and the
2141 Relative subrepository paths are first made absolute, and the
2139 rewrite rules are then applied on the full (absolute) path. If ``pattern``
2142 rewrite rules are then applied on the full (absolute) path. If ``pattern``
2140 doesn't match the full path, an attempt is made to apply it on the
2143 doesn't match the full path, an attempt is made to apply it on the
2141 relative path alone. The rules are applied in definition order.
2144 relative path alone. The rules are applied in definition order.
2142
2145
2143 ``subrepos``
2146 ``subrepos``
2144 ------------
2147 ------------
2145
2148
2146 This section contains options that control the behavior of the
2149 This section contains options that control the behavior of the
2147 subrepositories feature. See also :hg:`help subrepos`.
2150 subrepositories feature. See also :hg:`help subrepos`.
2148
2151
2149 Security note: auditing in Mercurial is known to be insufficient to
2152 Security note: auditing in Mercurial is known to be insufficient to
2150 prevent clone-time code execution with carefully constructed Git
2153 prevent clone-time code execution with carefully constructed Git
2151 subrepos. It is unknown if a similar detect is present in Subversion
2154 subrepos. It is unknown if a similar detect is present in Subversion
2152 subrepos. Both Git and Subversion subrepos are disabled by default
2155 subrepos. Both Git and Subversion subrepos are disabled by default
2153 out of security concerns. These subrepo types can be enabled using
2156 out of security concerns. These subrepo types can be enabled using
2154 the respective options below.
2157 the respective options below.
2155
2158
2156 ``allowed``
2159 ``allowed``
2157 Whether subrepositories are allowed in the working directory.
2160 Whether subrepositories are allowed in the working directory.
2158
2161
2159 When false, commands involving subrepositories (like :hg:`update`)
2162 When false, commands involving subrepositories (like :hg:`update`)
2160 will fail for all subrepository types.
2163 will fail for all subrepository types.
2161 (default: true)
2164 (default: true)
2162
2165
2163 ``hg:allowed``
2166 ``hg:allowed``
2164 Whether Mercurial subrepositories are allowed in the working
2167 Whether Mercurial subrepositories are allowed in the working
2165 directory. This option only has an effect if ``subrepos.allowed``
2168 directory. This option only has an effect if ``subrepos.allowed``
2166 is true.
2169 is true.
2167 (default: true)
2170 (default: true)
2168
2171
2169 ``git:allowed``
2172 ``git:allowed``
2170 Whether Git subrepositories are allowed in the working directory.
2173 Whether Git subrepositories are allowed in the working directory.
2171 This option only has an effect if ``subrepos.allowed`` is true.
2174 This option only has an effect if ``subrepos.allowed`` is true.
2172
2175
2173 See the security note above before enabling Git subrepos.
2176 See the security note above before enabling Git subrepos.
2174 (default: false)
2177 (default: false)
2175
2178
2176 ``svn:allowed``
2179 ``svn:allowed``
2177 Whether Subversion subrepositories are allowed in the working
2180 Whether Subversion subrepositories are allowed in the working
2178 directory. This option only has an effect if ``subrepos.allowed``
2181 directory. This option only has an effect if ``subrepos.allowed``
2179 is true.
2182 is true.
2180
2183
2181 See the security note above before enabling Subversion subrepos.
2184 See the security note above before enabling Subversion subrepos.
2182 (default: false)
2185 (default: false)
2183
2186
2184 ``templatealias``
2187 ``templatealias``
2185 -----------------
2188 -----------------
2186
2189
2187 Alias definitions for templates. See :hg:`help templates` for details.
2190 Alias definitions for templates. See :hg:`help templates` for details.
2188
2191
2189 ``templates``
2192 ``templates``
2190 -------------
2193 -------------
2191
2194
2192 Use the ``[templates]`` section to define template strings.
2195 Use the ``[templates]`` section to define template strings.
2193 See :hg:`help templates` for details.
2196 See :hg:`help templates` for details.
2194
2197
2195 ``trusted``
2198 ``trusted``
2196 -----------
2199 -----------
2197
2200
2198 Mercurial will not use the settings in the
2201 Mercurial will not use the settings in the
2199 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
2202 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
2200 user or to a trusted group, as various hgrc features allow arbitrary
2203 user or to a trusted group, as various hgrc features allow arbitrary
2201 commands to be run. This issue is often encountered when configuring
2204 commands to be run. This issue is often encountered when configuring
2202 hooks or extensions for shared repositories or servers. However,
2205 hooks or extensions for shared repositories or servers. However,
2203 the web interface will use some safe settings from the ``[web]``
2206 the web interface will use some safe settings from the ``[web]``
2204 section.
2207 section.
2205
2208
2206 This section specifies what users and groups are trusted. The
2209 This section specifies what users and groups are trusted. The
2207 current user is always trusted. To trust everybody, list a user or a
2210 current user is always trusted. To trust everybody, list a user or a
2208 group with name ``*``. These settings must be placed in an
2211 group with name ``*``. These settings must be placed in an
2209 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
2212 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
2210 user or service running Mercurial.
2213 user or service running Mercurial.
2211
2214
2212 ``users``
2215 ``users``
2213 Comma-separated list of trusted users.
2216 Comma-separated list of trusted users.
2214
2217
2215 ``groups``
2218 ``groups``
2216 Comma-separated list of trusted groups.
2219 Comma-separated list of trusted groups.
2217
2220
2218
2221
2219 ``ui``
2222 ``ui``
2220 ------
2223 ------
2221
2224
2222 User interface controls.
2225 User interface controls.
2223
2226
2224 ``archivemeta``
2227 ``archivemeta``
2225 Whether to include the .hg_archival.txt file containing meta data
2228 Whether to include the .hg_archival.txt file containing meta data
2226 (hashes for the repository base and for tip) in archives created
2229 (hashes for the repository base and for tip) in archives created
2227 by the :hg:`archive` command or downloaded via hgweb.
2230 by the :hg:`archive` command or downloaded via hgweb.
2228 (default: True)
2231 (default: True)
2229
2232
2230 ``askusername``
2233 ``askusername``
2231 Whether to prompt for a username when committing. If True, and
2234 Whether to prompt for a username when committing. If True, and
2232 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
2235 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
2233 be prompted to enter a username. If no username is entered, the
2236 be prompted to enter a username. If no username is entered, the
2234 default ``USER@HOST`` is used instead.
2237 default ``USER@HOST`` is used instead.
2235 (default: False)
2238 (default: False)
2236
2239
2237 ``clonebundles``
2240 ``clonebundles``
2238 Whether the "clone bundles" feature is enabled.
2241 Whether the "clone bundles" feature is enabled.
2239
2242
2240 When enabled, :hg:`clone` may download and apply a server-advertised
2243 When enabled, :hg:`clone` may download and apply a server-advertised
2241 bundle file from a URL instead of using the normal exchange mechanism.
2244 bundle file from a URL instead of using the normal exchange mechanism.
2242
2245
2243 This can likely result in faster and more reliable clones.
2246 This can likely result in faster and more reliable clones.
2244
2247
2245 (default: True)
2248 (default: True)
2246
2249
2247 ``clonebundlefallback``
2250 ``clonebundlefallback``
2248 Whether failure to apply an advertised "clone bundle" from a server
2251 Whether failure to apply an advertised "clone bundle" from a server
2249 should result in fallback to a regular clone.
2252 should result in fallback to a regular clone.
2250
2253
2251 This is disabled by default because servers advertising "clone
2254 This is disabled by default because servers advertising "clone
2252 bundles" often do so to reduce server load. If advertised bundles
2255 bundles" often do so to reduce server load. If advertised bundles
2253 start mass failing and clients automatically fall back to a regular
2256 start mass failing and clients automatically fall back to a regular
2254 clone, this would add significant and unexpected load to the server
2257 clone, this would add significant and unexpected load to the server
2255 since the server is expecting clone operations to be offloaded to
2258 since the server is expecting clone operations to be offloaded to
2256 pre-generated bundles. Failing fast (the default behavior) ensures
2259 pre-generated bundles. Failing fast (the default behavior) ensures
2257 clients don't overwhelm the server when "clone bundle" application
2260 clients don't overwhelm the server when "clone bundle" application
2258 fails.
2261 fails.
2259
2262
2260 (default: False)
2263 (default: False)
2261
2264
2262 ``clonebundleprefers``
2265 ``clonebundleprefers``
2263 Defines preferences for which "clone bundles" to use.
2266 Defines preferences for which "clone bundles" to use.
2264
2267
2265 Servers advertising "clone bundles" may advertise multiple available
2268 Servers advertising "clone bundles" may advertise multiple available
2266 bundles. Each bundle may have different attributes, such as the bundle
2269 bundles. Each bundle may have different attributes, such as the bundle
2267 type and compression format. This option is used to prefer a particular
2270 type and compression format. This option is used to prefer a particular
2268 bundle over another.
2271 bundle over another.
2269
2272
2270 The following keys are defined by Mercurial:
2273 The following keys are defined by Mercurial:
2271
2274
2272 BUNDLESPEC
2275 BUNDLESPEC
2273 A bundle type specifier. These are strings passed to :hg:`bundle -t`.
2276 A bundle type specifier. These are strings passed to :hg:`bundle -t`.
2274 e.g. ``gzip-v2`` or ``bzip2-v1``.
2277 e.g. ``gzip-v2`` or ``bzip2-v1``.
2275
2278
2276 COMPRESSION
2279 COMPRESSION
2277 The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
2280 The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
2278
2281
2279 Server operators may define custom keys.
2282 Server operators may define custom keys.
2280
2283
2281 Example values: ``COMPRESSION=bzip2``,
2284 Example values: ``COMPRESSION=bzip2``,
2282 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
2285 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
2283
2286
2284 By default, the first bundle advertised by the server is used.
2287 By default, the first bundle advertised by the server is used.
2285
2288
2286 ``color``
2289 ``color``
2287 When to colorize output. Possible value are Boolean ("yes" or "no"), or
2290 When to colorize output. Possible value are Boolean ("yes" or "no"), or
2288 "debug", or "always". (default: "yes"). "yes" will use color whenever it
2291 "debug", or "always". (default: "yes"). "yes" will use color whenever it
2289 seems possible. See :hg:`help color` for details.
2292 seems possible. See :hg:`help color` for details.
2290
2293
2291 ``commitsubrepos``
2294 ``commitsubrepos``
2292 Whether to commit modified subrepositories when committing the
2295 Whether to commit modified subrepositories when committing the
2293 parent repository. If False and one subrepository has uncommitted
2296 parent repository. If False and one subrepository has uncommitted
2294 changes, abort the commit.
2297 changes, abort the commit.
2295 (default: False)
2298 (default: False)
2296
2299
2297 ``debug``
2300 ``debug``
2298 Print debugging information. (default: False)
2301 Print debugging information. (default: False)
2299
2302
2300 ``editor``
2303 ``editor``
2301 The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
2304 The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
2302
2305
2303 ``fallbackencoding``
2306 ``fallbackencoding``
2304 Encoding to try if it's not possible to decode the changelog using
2307 Encoding to try if it's not possible to decode the changelog using
2305 UTF-8. (default: ISO-8859-1)
2308 UTF-8. (default: ISO-8859-1)
2306
2309
2307 ``graphnodetemplate``
2310 ``graphnodetemplate``
2308 The template used to print changeset nodes in an ASCII revision graph.
2311 The template used to print changeset nodes in an ASCII revision graph.
2309 (default: ``{graphnode}``)
2312 (default: ``{graphnode}``)
2310
2313
2311 ``ignore``
2314 ``ignore``
2312 A file to read per-user ignore patterns from. This file should be
2315 A file to read per-user ignore patterns from. This file should be
2313 in the same format as a repository-wide .hgignore file. Filenames
2316 in the same format as a repository-wide .hgignore file. Filenames
2314 are relative to the repository root. This option supports hook syntax,
2317 are relative to the repository root. This option supports hook syntax,
2315 so if you want to specify multiple ignore files, you can do so by
2318 so if you want to specify multiple ignore files, you can do so by
2316 setting something like ``ignore.other = ~/.hgignore2``. For details
2319 setting something like ``ignore.other = ~/.hgignore2``. For details
2317 of the ignore file format, see the ``hgignore(5)`` man page.
2320 of the ignore file format, see the ``hgignore(5)`` man page.
2318
2321
2319 ``interactive``
2322 ``interactive``
2320 Allow to prompt the user. (default: True)
2323 Allow to prompt the user. (default: True)
2321
2324
2322 ``interface``
2325 ``interface``
2323 Select the default interface for interactive features (default: text).
2326 Select the default interface for interactive features (default: text).
2324 Possible values are 'text' and 'curses'.
2327 Possible values are 'text' and 'curses'.
2325
2328
2326 ``interface.chunkselector``
2329 ``interface.chunkselector``
2327 Select the interface for change recording (e.g. :hg:`commit -i`).
2330 Select the interface for change recording (e.g. :hg:`commit -i`).
2328 Possible values are 'text' and 'curses'.
2331 Possible values are 'text' and 'curses'.
2329 This config overrides the interface specified by ui.interface.
2332 This config overrides the interface specified by ui.interface.
2330
2333
2331 ``large-file-limit``
2334 ``large-file-limit``
2332 Largest file size that gives no memory use warning.
2335 Largest file size that gives no memory use warning.
2333 Possible values are integers or 0 to disable the check.
2336 Possible values are integers or 0 to disable the check.
2334 (default: 10000000)
2337 (default: 10000000)
2335
2338
2336 ``logtemplate``
2339 ``logtemplate``
2337 Template string for commands that print changesets.
2340 Template string for commands that print changesets.
2338
2341
2339 ``merge``
2342 ``merge``
2340 The conflict resolution program to use during a manual merge.
2343 The conflict resolution program to use during a manual merge.
2341 For more information on merge tools see :hg:`help merge-tools`.
2344 For more information on merge tools see :hg:`help merge-tools`.
2342 For configuring merge tools see the ``[merge-tools]`` section.
2345 For configuring merge tools see the ``[merge-tools]`` section.
2343
2346
2344 ``mergemarkers``
2347 ``mergemarkers``
2345 Sets the merge conflict marker label styling. The ``detailed``
2348 Sets the merge conflict marker label styling. The ``detailed``
2346 style uses the ``mergemarkertemplate`` setting to style the labels.
2349 style uses the ``mergemarkertemplate`` setting to style the labels.
2347 The ``basic`` style just uses 'local' and 'other' as the marker label.
2350 The ``basic`` style just uses 'local' and 'other' as the marker label.
2348 One of ``basic`` or ``detailed``.
2351 One of ``basic`` or ``detailed``.
2349 (default: ``basic``)
2352 (default: ``basic``)
2350
2353
2351 ``mergemarkertemplate``
2354 ``mergemarkertemplate``
2352 The template used to print the commit description next to each conflict
2355 The template used to print the commit description next to each conflict
2353 marker during merge conflicts. See :hg:`help templates` for the template
2356 marker during merge conflicts. See :hg:`help templates` for the template
2354 format.
2357 format.
2355
2358
2356 Defaults to showing the hash, tags, branches, bookmarks, author, and
2359 Defaults to showing the hash, tags, branches, bookmarks, author, and
2357 the first line of the commit description.
2360 the first line of the commit description.
2358
2361
2359 If you use non-ASCII characters in names for tags, branches, bookmarks,
2362 If you use non-ASCII characters in names for tags, branches, bookmarks,
2360 authors, and/or commit descriptions, you must pay attention to encodings of
2363 authors, and/or commit descriptions, you must pay attention to encodings of
2361 managed files. At template expansion, non-ASCII characters use the encoding
2364 managed files. At template expansion, non-ASCII characters use the encoding
2362 specified by the ``--encoding`` global option, ``HGENCODING`` or other
2365 specified by the ``--encoding`` global option, ``HGENCODING`` or other
2363 environment variables that govern your locale. If the encoding of the merge
2366 environment variables that govern your locale. If the encoding of the merge
2364 markers is different from the encoding of the merged files,
2367 markers is different from the encoding of the merged files,
2365 serious problems may occur.
2368 serious problems may occur.
2366
2369
2367 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
2370 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
2368
2371
2369 ``message-output``
2372 ``message-output``
2370 Where to write status and error messages. (default: ``stdio``)
2373 Where to write status and error messages. (default: ``stdio``)
2371
2374
2372 ``stderr``
2375 ``stderr``
2373 Everything to stderr.
2376 Everything to stderr.
2374 ``stdio``
2377 ``stdio``
2375 Status to stdout, and error to stderr.
2378 Status to stdout, and error to stderr.
2376
2379
2377 ``origbackuppath``
2380 ``origbackuppath``
2378 The path to a directory used to store generated .orig files. If the path is
2381 The path to a directory used to store generated .orig files. If the path is
2379 not a directory, one will be created. If set, files stored in this
2382 not a directory, one will be created. If set, files stored in this
2380 directory have the same name as the original file and do not have a .orig
2383 directory have the same name as the original file and do not have a .orig
2381 suffix.
2384 suffix.
2382
2385
2383 ``paginate``
2386 ``paginate``
2384 Control the pagination of command output (default: True). See :hg:`help pager`
2387 Control the pagination of command output (default: True). See :hg:`help pager`
2385 for details.
2388 for details.
2386
2389
2387 ``patch``
2390 ``patch``
2388 An optional external tool that ``hg import`` and some extensions
2391 An optional external tool that ``hg import`` and some extensions
2389 will use for applying patches. By default Mercurial uses an
2392 will use for applying patches. By default Mercurial uses an
2390 internal patch utility. The external tool must work as the common
2393 internal patch utility. The external tool must work as the common
2391 Unix ``patch`` program. In particular, it must accept a ``-p``
2394 Unix ``patch`` program. In particular, it must accept a ``-p``
2392 argument to strip patch headers, a ``-d`` argument to specify the
2395 argument to strip patch headers, a ``-d`` argument to specify the
2393 current directory, a file name to patch, and a patch file to take
2396 current directory, a file name to patch, and a patch file to take
2394 from stdin.
2397 from stdin.
2395
2398
2396 It is possible to specify a patch tool together with extra
2399 It is possible to specify a patch tool together with extra
2397 arguments. For example, setting this option to ``patch --merge``
2400 arguments. For example, setting this option to ``patch --merge``
2398 will use the ``patch`` program with its 2-way merge option.
2401 will use the ``patch`` program with its 2-way merge option.
2399
2402
2400 ``portablefilenames``
2403 ``portablefilenames``
2401 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
2404 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
2402 (default: ``warn``)
2405 (default: ``warn``)
2403
2406
2404 ``warn``
2407 ``warn``
2405 Print a warning message on POSIX platforms, if a file with a non-portable
2408 Print a warning message on POSIX platforms, if a file with a non-portable
2406 filename is added (e.g. a file with a name that can't be created on
2409 filename is added (e.g. a file with a name that can't be created on
2407 Windows because it contains reserved parts like ``AUX``, reserved
2410 Windows because it contains reserved parts like ``AUX``, reserved
2408 characters like ``:``, or would cause a case collision with an existing
2411 characters like ``:``, or would cause a case collision with an existing
2409 file).
2412 file).
2410
2413
2411 ``ignore``
2414 ``ignore``
2412 Don't print a warning.
2415 Don't print a warning.
2413
2416
2414 ``abort``
2417 ``abort``
2415 The command is aborted.
2418 The command is aborted.
2416
2419
2417 ``true``
2420 ``true``
2418 Alias for ``warn``.
2421 Alias for ``warn``.
2419
2422
2420 ``false``
2423 ``false``
2421 Alias for ``ignore``.
2424 Alias for ``ignore``.
2422
2425
2423 .. container:: windows
2426 .. container:: windows
2424
2427
2425 On Windows, this configuration option is ignored and the command aborted.
2428 On Windows, this configuration option is ignored and the command aborted.
2426
2429
2427 ``pre-merge-tool-output-template``
2430 ``pre-merge-tool-output-template``
2428 A template that is printed before executing an external merge tool. This can
2431 A template that is printed before executing an external merge tool. This can
2429 be used to print out additional context that might be useful to have during
2432 be used to print out additional context that might be useful to have during
2430 the conflict resolution, such as the description of the various commits
2433 the conflict resolution, such as the description of the various commits
2431 involved or bookmarks/tags.
2434 involved or bookmarks/tags.
2432
2435
2433 Additional information is available in the ``local`, ``base``, and ``other``
2436 Additional information is available in the ``local`, ``base``, and ``other``
2434 dicts. For example: ``{local.label}``, ``{base.name}``, or
2437 dicts. For example: ``{local.label}``, ``{base.name}``, or
2435 ``{other.islink}``.
2438 ``{other.islink}``.
2436
2439
2437 ``quiet``
2440 ``quiet``
2438 Reduce the amount of output printed.
2441 Reduce the amount of output printed.
2439 (default: False)
2442 (default: False)
2440
2443
2441 ``relative-paths``
2444 ``relative-paths``
2442 Prefer relative paths in the UI.
2445 Prefer relative paths in the UI.
2443
2446
2444 ``remotecmd``
2447 ``remotecmd``
2445 Remote command to use for clone/push/pull operations.
2448 Remote command to use for clone/push/pull operations.
2446 (default: ``hg``)
2449 (default: ``hg``)
2447
2450
2448 ``report_untrusted``
2451 ``report_untrusted``
2449 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
2452 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
2450 trusted user or group.
2453 trusted user or group.
2451 (default: True)
2454 (default: True)
2452
2455
2453 ``slash``
2456 ``slash``
2454 (Deprecated. Use ``slashpath`` template filter instead.)
2457 (Deprecated. Use ``slashpath`` template filter instead.)
2455
2458
2456 Display paths using a slash (``/``) as the path separator. This
2459 Display paths using a slash (``/``) as the path separator. This
2457 only makes a difference on systems where the default path
2460 only makes a difference on systems where the default path
2458 separator is not the slash character (e.g. Windows uses the
2461 separator is not the slash character (e.g. Windows uses the
2459 backslash character (``\``)).
2462 backslash character (``\``)).
2460 (default: False)
2463 (default: False)
2461
2464
2462 ``statuscopies``
2465 ``statuscopies``
2463 Display copies in the status command.
2466 Display copies in the status command.
2464
2467
2465 ``ssh``
2468 ``ssh``
2466 Command to use for SSH connections. (default: ``ssh``)
2469 Command to use for SSH connections. (default: ``ssh``)
2467
2470
2468 ``ssherrorhint``
2471 ``ssherrorhint``
2469 A hint shown to the user in the case of SSH error (e.g.
2472 A hint shown to the user in the case of SSH error (e.g.
2470 ``Please see http://company/internalwiki/ssh.html``)
2473 ``Please see http://company/internalwiki/ssh.html``)
2471
2474
2472 ``strict``
2475 ``strict``
2473 Require exact command names, instead of allowing unambiguous
2476 Require exact command names, instead of allowing unambiguous
2474 abbreviations. (default: False)
2477 abbreviations. (default: False)
2475
2478
2476 ``style``
2479 ``style``
2477 Name of style to use for command output.
2480 Name of style to use for command output.
2478
2481
2479 ``supportcontact``
2482 ``supportcontact``
2480 A URL where users should report a Mercurial traceback. Use this if you are a
2483 A URL where users should report a Mercurial traceback. Use this if you are a
2481 large organisation with its own Mercurial deployment process and crash
2484 large organisation with its own Mercurial deployment process and crash
2482 reports should be addressed to your internal support.
2485 reports should be addressed to your internal support.
2483
2486
2484 ``textwidth``
2487 ``textwidth``
2485 Maximum width of help text. A longer line generated by ``hg help`` or
2488 Maximum width of help text. A longer line generated by ``hg help`` or
2486 ``hg subcommand --help`` will be broken after white space to get this
2489 ``hg subcommand --help`` will be broken after white space to get this
2487 width or the terminal width, whichever comes first.
2490 width or the terminal width, whichever comes first.
2488 A non-positive value will disable this and the terminal width will be
2491 A non-positive value will disable this and the terminal width will be
2489 used. (default: 78)
2492 used. (default: 78)
2490
2493
2491 ``timeout``
2494 ``timeout``
2492 The timeout used when a lock is held (in seconds), a negative value
2495 The timeout used when a lock is held (in seconds), a negative value
2493 means no timeout. (default: 600)
2496 means no timeout. (default: 600)
2494
2497
2495 ``timeout.warn``
2498 ``timeout.warn``
2496 Time (in seconds) before a warning is printed about held lock. A negative
2499 Time (in seconds) before a warning is printed about held lock. A negative
2497 value means no warning. (default: 0)
2500 value means no warning. (default: 0)
2498
2501
2499 ``traceback``
2502 ``traceback``
2500 Mercurial always prints a traceback when an unknown exception
2503 Mercurial always prints a traceback when an unknown exception
2501 occurs. Setting this to True will make Mercurial print a traceback
2504 occurs. Setting this to True will make Mercurial print a traceback
2502 on all exceptions, even those recognized by Mercurial (such as
2505 on all exceptions, even those recognized by Mercurial (such as
2503 IOError or MemoryError). (default: False)
2506 IOError or MemoryError). (default: False)
2504
2507
2505 ``tweakdefaults``
2508 ``tweakdefaults``
2506
2509
2507 By default Mercurial's behavior changes very little from release
2510 By default Mercurial's behavior changes very little from release
2508 to release, but over time the recommended config settings
2511 to release, but over time the recommended config settings
2509 shift. Enable this config to opt in to get automatic tweaks to
2512 shift. Enable this config to opt in to get automatic tweaks to
2510 Mercurial's behavior over time. This config setting will have no
2513 Mercurial's behavior over time. This config setting will have no
2511 effect if ``HGPLAIN`` is set or ``HGPLAINEXCEPT`` is set and does
2514 effect if ``HGPLAIN`` is set or ``HGPLAINEXCEPT`` is set and does
2512 not include ``tweakdefaults``. (default: False)
2515 not include ``tweakdefaults``. (default: False)
2513
2516
2514 It currently means::
2517 It currently means::
2515
2518
2516 .. tweakdefaultsmarker
2519 .. tweakdefaultsmarker
2517
2520
2518 ``username``
2521 ``username``
2519 The committer of a changeset created when running "commit".
2522 The committer of a changeset created when running "commit".
2520 Typically a person's name and email address, e.g. ``Fred Widget
2523 Typically a person's name and email address, e.g. ``Fred Widget
2521 <fred@example.com>``. Environment variables in the
2524 <fred@example.com>``. Environment variables in the
2522 username are expanded.
2525 username are expanded.
2523
2526
2524 (default: ``$EMAIL`` or ``username@hostname``. If the username in
2527 (default: ``$EMAIL`` or ``username@hostname``. If the username in
2525 hgrc is empty, e.g. if the system admin set ``username =`` in the
2528 hgrc is empty, e.g. if the system admin set ``username =`` in the
2526 system hgrc, it has to be specified manually or in a different
2529 system hgrc, it has to be specified manually or in a different
2527 hgrc file)
2530 hgrc file)
2528
2531
2529 ``verbose``
2532 ``verbose``
2530 Increase the amount of output printed. (default: False)
2533 Increase the amount of output printed. (default: False)
2531
2534
2532
2535
2533 ``web``
2536 ``web``
2534 -------
2537 -------
2535
2538
2536 Web interface configuration. The settings in this section apply to
2539 Web interface configuration. The settings in this section apply to
2537 both the builtin webserver (started by :hg:`serve`) and the script you
2540 both the builtin webserver (started by :hg:`serve`) and the script you
2538 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
2541 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
2539 and WSGI).
2542 and WSGI).
2540
2543
2541 The Mercurial webserver does no authentication (it does not prompt for
2544 The Mercurial webserver does no authentication (it does not prompt for
2542 usernames and passwords to validate *who* users are), but it does do
2545 usernames and passwords to validate *who* users are), but it does do
2543 authorization (it grants or denies access for *authenticated users*
2546 authorization (it grants or denies access for *authenticated users*
2544 based on settings in this section). You must either configure your
2547 based on settings in this section). You must either configure your
2545 webserver to do authentication for you, or disable the authorization
2548 webserver to do authentication for you, or disable the authorization
2546 checks.
2549 checks.
2547
2550
2548 For a quick setup in a trusted environment, e.g., a private LAN, where
2551 For a quick setup in a trusted environment, e.g., a private LAN, where
2549 you want it to accept pushes from anybody, you can use the following
2552 you want it to accept pushes from anybody, you can use the following
2550 command line::
2553 command line::
2551
2554
2552 $ hg --config web.allow-push=* --config web.push_ssl=False serve
2555 $ hg --config web.allow-push=* --config web.push_ssl=False serve
2553
2556
2554 Note that this will allow anybody to push anything to the server and
2557 Note that this will allow anybody to push anything to the server and
2555 that this should not be used for public servers.
2558 that this should not be used for public servers.
2556
2559
2557 The full set of options is:
2560 The full set of options is:
2558
2561
2559 ``accesslog``
2562 ``accesslog``
2560 Where to output the access log. (default: stdout)
2563 Where to output the access log. (default: stdout)
2561
2564
2562 ``address``
2565 ``address``
2563 Interface address to bind to. (default: all)
2566 Interface address to bind to. (default: all)
2564
2567
2565 ``allow-archive``
2568 ``allow-archive``
2566 List of archive format (bz2, gz, zip) allowed for downloading.
2569 List of archive format (bz2, gz, zip) allowed for downloading.
2567 (default: empty)
2570 (default: empty)
2568
2571
2569 ``allowbz2``
2572 ``allowbz2``
2570 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
2573 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
2571 revisions.
2574 revisions.
2572 (default: False)
2575 (default: False)
2573
2576
2574 ``allowgz``
2577 ``allowgz``
2575 (DEPRECATED) Whether to allow .tar.gz downloading of repository
2578 (DEPRECATED) Whether to allow .tar.gz downloading of repository
2576 revisions.
2579 revisions.
2577 (default: False)
2580 (default: False)
2578
2581
2579 ``allow-pull``
2582 ``allow-pull``
2580 Whether to allow pulling from the repository. (default: True)
2583 Whether to allow pulling from the repository. (default: True)
2581
2584
2582 ``allow-push``
2585 ``allow-push``
2583 Whether to allow pushing to the repository. If empty or not set,
2586 Whether to allow pushing to the repository. If empty or not set,
2584 pushing is not allowed. If the special value ``*``, any remote
2587 pushing is not allowed. If the special value ``*``, any remote
2585 user can push, including unauthenticated users. Otherwise, the
2588 user can push, including unauthenticated users. Otherwise, the
2586 remote user must have been authenticated, and the authenticated
2589 remote user must have been authenticated, and the authenticated
2587 user name must be present in this list. The contents of the
2590 user name must be present in this list. The contents of the
2588 allow-push list are examined after the deny_push list.
2591 allow-push list are examined after the deny_push list.
2589
2592
2590 ``allow_read``
2593 ``allow_read``
2591 If the user has not already been denied repository access due to
2594 If the user has not already been denied repository access due to
2592 the contents of deny_read, this list determines whether to grant
2595 the contents of deny_read, this list determines whether to grant
2593 repository access to the user. If this list is not empty, and the
2596 repository access to the user. If this list is not empty, and the
2594 user is unauthenticated or not present in the list, then access is
2597 user is unauthenticated or not present in the list, then access is
2595 denied for the user. If the list is empty or not set, then access
2598 denied for the user. If the list is empty or not set, then access
2596 is permitted to all users by default. Setting allow_read to the
2599 is permitted to all users by default. Setting allow_read to the
2597 special value ``*`` is equivalent to it not being set (i.e. access
2600 special value ``*`` is equivalent to it not being set (i.e. access
2598 is permitted to all users). The contents of the allow_read list are
2601 is permitted to all users). The contents of the allow_read list are
2599 examined after the deny_read list.
2602 examined after the deny_read list.
2600
2603
2601 ``allowzip``
2604 ``allowzip``
2602 (DEPRECATED) Whether to allow .zip downloading of repository
2605 (DEPRECATED) Whether to allow .zip downloading of repository
2603 revisions. This feature creates temporary files.
2606 revisions. This feature creates temporary files.
2604 (default: False)
2607 (default: False)
2605
2608
2606 ``archivesubrepos``
2609 ``archivesubrepos``
2607 Whether to recurse into subrepositories when archiving.
2610 Whether to recurse into subrepositories when archiving.
2608 (default: False)
2611 (default: False)
2609
2612
2610 ``baseurl``
2613 ``baseurl``
2611 Base URL to use when publishing URLs in other locations, so
2614 Base URL to use when publishing URLs in other locations, so
2612 third-party tools like email notification hooks can construct
2615 third-party tools like email notification hooks can construct
2613 URLs. Example: ``http://hgserver/repos/``.
2616 URLs. Example: ``http://hgserver/repos/``.
2614
2617
2615 ``cacerts``
2618 ``cacerts``
2616 Path to file containing a list of PEM encoded certificate
2619 Path to file containing a list of PEM encoded certificate
2617 authority certificates. Environment variables and ``~user``
2620 authority certificates. Environment variables and ``~user``
2618 constructs are expanded in the filename. If specified on the
2621 constructs are expanded in the filename. If specified on the
2619 client, then it will verify the identity of remote HTTPS servers
2622 client, then it will verify the identity of remote HTTPS servers
2620 with these certificates.
2623 with these certificates.
2621
2624
2622 To disable SSL verification temporarily, specify ``--insecure`` from
2625 To disable SSL verification temporarily, specify ``--insecure`` from
2623 command line.
2626 command line.
2624
2627
2625 You can use OpenSSL's CA certificate file if your platform has
2628 You can use OpenSSL's CA certificate file if your platform has
2626 one. On most Linux systems this will be
2629 one. On most Linux systems this will be
2627 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
2630 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
2628 generate this file manually. The form must be as follows::
2631 generate this file manually. The form must be as follows::
2629
2632
2630 -----BEGIN CERTIFICATE-----
2633 -----BEGIN CERTIFICATE-----
2631 ... (certificate in base64 PEM encoding) ...
2634 ... (certificate in base64 PEM encoding) ...
2632 -----END CERTIFICATE-----
2635 -----END CERTIFICATE-----
2633 -----BEGIN CERTIFICATE-----
2636 -----BEGIN CERTIFICATE-----
2634 ... (certificate in base64 PEM encoding) ...
2637 ... (certificate in base64 PEM encoding) ...
2635 -----END CERTIFICATE-----
2638 -----END CERTIFICATE-----
2636
2639
2637 ``cache``
2640 ``cache``
2638 Whether to support caching in hgweb. (default: True)
2641 Whether to support caching in hgweb. (default: True)
2639
2642
2640 ``certificate``
2643 ``certificate``
2641 Certificate to use when running :hg:`serve`.
2644 Certificate to use when running :hg:`serve`.
2642
2645
2643 ``collapse``
2646 ``collapse``
2644 With ``descend`` enabled, repositories in subdirectories are shown at
2647 With ``descend`` enabled, repositories in subdirectories are shown at
2645 a single level alongside repositories in the current path. With
2648 a single level alongside repositories in the current path. With
2646 ``collapse`` also enabled, repositories residing at a deeper level than
2649 ``collapse`` also enabled, repositories residing at a deeper level than
2647 the current path are grouped behind navigable directory entries that
2650 the current path are grouped behind navigable directory entries that
2648 lead to the locations of these repositories. In effect, this setting
2651 lead to the locations of these repositories. In effect, this setting
2649 collapses each collection of repositories found within a subdirectory
2652 collapses each collection of repositories found within a subdirectory
2650 into a single entry for that subdirectory. (default: False)
2653 into a single entry for that subdirectory. (default: False)
2651
2654
2652 ``comparisoncontext``
2655 ``comparisoncontext``
2653 Number of lines of context to show in side-by-side file comparison. If
2656 Number of lines of context to show in side-by-side file comparison. If
2654 negative or the value ``full``, whole files are shown. (default: 5)
2657 negative or the value ``full``, whole files are shown. (default: 5)
2655
2658
2656 This setting can be overridden by a ``context`` request parameter to the
2659 This setting can be overridden by a ``context`` request parameter to the
2657 ``comparison`` command, taking the same values.
2660 ``comparison`` command, taking the same values.
2658
2661
2659 ``contact``
2662 ``contact``
2660 Name or email address of the person in charge of the repository.
2663 Name or email address of the person in charge of the repository.
2661 (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
2664 (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
2662
2665
2663 ``csp``
2666 ``csp``
2664 Send a ``Content-Security-Policy`` HTTP header with this value.
2667 Send a ``Content-Security-Policy`` HTTP header with this value.
2665
2668
2666 The value may contain a special string ``%nonce%``, which will be replaced
2669 The value may contain a special string ``%nonce%``, which will be replaced
2667 by a randomly-generated one-time use value. If the value contains
2670 by a randomly-generated one-time use value. If the value contains
2668 ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
2671 ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
2669 one-time property of the nonce. This nonce will also be inserted into
2672 one-time property of the nonce. This nonce will also be inserted into
2670 ``<script>`` elements containing inline JavaScript.
2673 ``<script>`` elements containing inline JavaScript.
2671
2674
2672 Note: lots of HTML content sent by the server is derived from repository
2675 Note: lots of HTML content sent by the server is derived from repository
2673 data. Please consider the potential for malicious repository data to
2676 data. Please consider the potential for malicious repository data to
2674 "inject" itself into generated HTML content as part of your security
2677 "inject" itself into generated HTML content as part of your security
2675 threat model.
2678 threat model.
2676
2679
2677 ``deny_push``
2680 ``deny_push``
2678 Whether to deny pushing to the repository. If empty or not set,
2681 Whether to deny pushing to the repository. If empty or not set,
2679 push is not denied. If the special value ``*``, all remote users are
2682 push is not denied. If the special value ``*``, all remote users are
2680 denied push. Otherwise, unauthenticated users are all denied, and
2683 denied push. Otherwise, unauthenticated users are all denied, and
2681 any authenticated user name present in this list is also denied. The
2684 any authenticated user name present in this list is also denied. The
2682 contents of the deny_push list are examined before the allow-push list.
2685 contents of the deny_push list are examined before the allow-push list.
2683
2686
2684 ``deny_read``
2687 ``deny_read``
2685 Whether to deny reading/viewing of the repository. If this list is
2688 Whether to deny reading/viewing of the repository. If this list is
2686 not empty, unauthenticated users are all denied, and any
2689 not empty, unauthenticated users are all denied, and any
2687 authenticated user name present in this list is also denied access to
2690 authenticated user name present in this list is also denied access to
2688 the repository. If set to the special value ``*``, all remote users
2691 the repository. If set to the special value ``*``, all remote users
2689 are denied access (rarely needed ;). If deny_read is empty or not set,
2692 are denied access (rarely needed ;). If deny_read is empty or not set,
2690 the determination of repository access depends on the presence and
2693 the determination of repository access depends on the presence and
2691 content of the allow_read list (see description). If both
2694 content of the allow_read list (see description). If both
2692 deny_read and allow_read are empty or not set, then access is
2695 deny_read and allow_read are empty or not set, then access is
2693 permitted to all users by default. If the repository is being
2696 permitted to all users by default. If the repository is being
2694 served via hgwebdir, denied users will not be able to see it in
2697 served via hgwebdir, denied users will not be able to see it in
2695 the list of repositories. The contents of the deny_read list have
2698 the list of repositories. The contents of the deny_read list have
2696 priority over (are examined before) the contents of the allow_read
2699 priority over (are examined before) the contents of the allow_read
2697 list.
2700 list.
2698
2701
2699 ``descend``
2702 ``descend``
2700 hgwebdir indexes will not descend into subdirectories. Only repositories
2703 hgwebdir indexes will not descend into subdirectories. Only repositories
2701 directly in the current path will be shown (other repositories are still
2704 directly in the current path will be shown (other repositories are still
2702 available from the index corresponding to their containing path).
2705 available from the index corresponding to their containing path).
2703
2706
2704 ``description``
2707 ``description``
2705 Textual description of the repository's purpose or contents.
2708 Textual description of the repository's purpose or contents.
2706 (default: "unknown")
2709 (default: "unknown")
2707
2710
2708 ``encoding``
2711 ``encoding``
2709 Character encoding name. (default: the current locale charset)
2712 Character encoding name. (default: the current locale charset)
2710 Example: "UTF-8".
2713 Example: "UTF-8".
2711
2714
2712 ``errorlog``
2715 ``errorlog``
2713 Where to output the error log. (default: stderr)
2716 Where to output the error log. (default: stderr)
2714
2717
2715 ``guessmime``
2718 ``guessmime``
2716 Control MIME types for raw download of file content.
2719 Control MIME types for raw download of file content.
2717 Set to True to let hgweb guess the content type from the file
2720 Set to True to let hgweb guess the content type from the file
2718 extension. This will serve HTML files as ``text/html`` and might
2721 extension. This will serve HTML files as ``text/html`` and might
2719 allow cross-site scripting attacks when serving untrusted
2722 allow cross-site scripting attacks when serving untrusted
2720 repositories. (default: False)
2723 repositories. (default: False)
2721
2724
2722 ``hidden``
2725 ``hidden``
2723 Whether to hide the repository in the hgwebdir index.
2726 Whether to hide the repository in the hgwebdir index.
2724 (default: False)
2727 (default: False)
2725
2728
2726 ``ipv6``
2729 ``ipv6``
2727 Whether to use IPv6. (default: False)
2730 Whether to use IPv6. (default: False)
2728
2731
2729 ``labels``
2732 ``labels``
2730 List of string *labels* associated with the repository.
2733 List of string *labels* associated with the repository.
2731
2734
2732 Labels are exposed as a template keyword and can be used to customize
2735 Labels are exposed as a template keyword and can be used to customize
2733 output. e.g. the ``index`` template can group or filter repositories
2736 output. e.g. the ``index`` template can group or filter repositories
2734 by labels and the ``summary`` template can display additional content
2737 by labels and the ``summary`` template can display additional content
2735 if a specific label is present.
2738 if a specific label is present.
2736
2739
2737 ``logoimg``
2740 ``logoimg``
2738 File name of the logo image that some templates display on each page.
2741 File name of the logo image that some templates display on each page.
2739 The file name is relative to ``staticurl``. That is, the full path to
2742 The file name is relative to ``staticurl``. That is, the full path to
2740 the logo image is "staticurl/logoimg".
2743 the logo image is "staticurl/logoimg".
2741 If unset, ``hglogo.png`` will be used.
2744 If unset, ``hglogo.png`` will be used.
2742
2745
2743 ``logourl``
2746 ``logourl``
2744 Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
2747 Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
2745 will be used.
2748 will be used.
2746
2749
2747 ``maxchanges``
2750 ``maxchanges``
2748 Maximum number of changes to list on the changelog. (default: 10)
2751 Maximum number of changes to list on the changelog. (default: 10)
2749
2752
2750 ``maxfiles``
2753 ``maxfiles``
2751 Maximum number of files to list per changeset. (default: 10)
2754 Maximum number of files to list per changeset. (default: 10)
2752
2755
2753 ``maxshortchanges``
2756 ``maxshortchanges``
2754 Maximum number of changes to list on the shortlog, graph or filelog
2757 Maximum number of changes to list on the shortlog, graph or filelog
2755 pages. (default: 60)
2758 pages. (default: 60)
2756
2759
2757 ``name``
2760 ``name``
2758 Repository name to use in the web interface.
2761 Repository name to use in the web interface.
2759 (default: current working directory)
2762 (default: current working directory)
2760
2763
2761 ``port``
2764 ``port``
2762 Port to listen on. (default: 8000)
2765 Port to listen on. (default: 8000)
2763
2766
2764 ``prefix``
2767 ``prefix``
2765 Prefix path to serve from. (default: '' (server root))
2768 Prefix path to serve from. (default: '' (server root))
2766
2769
2767 ``push_ssl``
2770 ``push_ssl``
2768 Whether to require that inbound pushes be transported over SSL to
2771 Whether to require that inbound pushes be transported over SSL to
2769 prevent password sniffing. (default: True)
2772 prevent password sniffing. (default: True)
2770
2773
2771 ``refreshinterval``
2774 ``refreshinterval``
2772 How frequently directory listings re-scan the filesystem for new
2775 How frequently directory listings re-scan the filesystem for new
2773 repositories, in seconds. This is relevant when wildcards are used
2776 repositories, in seconds. This is relevant when wildcards are used
2774 to define paths. Depending on how much filesystem traversal is
2777 to define paths. Depending on how much filesystem traversal is
2775 required, refreshing may negatively impact performance.
2778 required, refreshing may negatively impact performance.
2776
2779
2777 Values less than or equal to 0 always refresh.
2780 Values less than or equal to 0 always refresh.
2778 (default: 20)
2781 (default: 20)
2779
2782
2780 ``server-header``
2783 ``server-header``
2781 Value for HTTP ``Server`` response header.
2784 Value for HTTP ``Server`` response header.
2782
2785
2783 ``static``
2786 ``static``
2784 Directory where static files are served from.
2787 Directory where static files are served from.
2785
2788
2786 ``staticurl``
2789 ``staticurl``
2787 Base URL to use for static files. If unset, static files (e.g. the
2790 Base URL to use for static files. If unset, static files (e.g. the
2788 hgicon.png favicon) will be served by the CGI script itself. Use
2791 hgicon.png favicon) will be served by the CGI script itself. Use
2789 this setting to serve them directly with the HTTP server.
2792 this setting to serve them directly with the HTTP server.
2790 Example: ``http://hgserver/static/``.
2793 Example: ``http://hgserver/static/``.
2791
2794
2792 ``stripes``
2795 ``stripes``
2793 How many lines a "zebra stripe" should span in multi-line output.
2796 How many lines a "zebra stripe" should span in multi-line output.
2794 Set to 0 to disable. (default: 1)
2797 Set to 0 to disable. (default: 1)
2795
2798
2796 ``style``
2799 ``style``
2797 Which template map style to use. The available options are the names of
2800 Which template map style to use. The available options are the names of
2798 subdirectories in the HTML templates path. (default: ``paper``)
2801 subdirectories in the HTML templates path. (default: ``paper``)
2799 Example: ``monoblue``.
2802 Example: ``monoblue``.
2800
2803
2801 ``templates``
2804 ``templates``
2802 Where to find the HTML templates. The default path to the HTML templates
2805 Where to find the HTML templates. The default path to the HTML templates
2803 can be obtained from ``hg debuginstall``.
2806 can be obtained from ``hg debuginstall``.
2804
2807
2805 ``websub``
2808 ``websub``
2806 ----------
2809 ----------
2807
2810
2808 Web substitution filter definition. You can use this section to
2811 Web substitution filter definition. You can use this section to
2809 define a set of regular expression substitution patterns which
2812 define a set of regular expression substitution patterns which
2810 let you automatically modify the hgweb server output.
2813 let you automatically modify the hgweb server output.
2811
2814
2812 The default hgweb templates only apply these substitution patterns
2815 The default hgweb templates only apply these substitution patterns
2813 on the revision description fields. You can apply them anywhere
2816 on the revision description fields. You can apply them anywhere
2814 you want when you create your own templates by adding calls to the
2817 you want when you create your own templates by adding calls to the
2815 "websub" filter (usually after calling the "escape" filter).
2818 "websub" filter (usually after calling the "escape" filter).
2816
2819
2817 This can be used, for example, to convert issue references to links
2820 This can be used, for example, to convert issue references to links
2818 to your issue tracker, or to convert "markdown-like" syntax into
2821 to your issue tracker, or to convert "markdown-like" syntax into
2819 HTML (see the examples below).
2822 HTML (see the examples below).
2820
2823
2821 Each entry in this section names a substitution filter.
2824 Each entry in this section names a substitution filter.
2822 The value of each entry defines the substitution expression itself.
2825 The value of each entry defines the substitution expression itself.
2823 The websub expressions follow the old interhg extension syntax,
2826 The websub expressions follow the old interhg extension syntax,
2824 which in turn imitates the Unix sed replacement syntax::
2827 which in turn imitates the Unix sed replacement syntax::
2825
2828
2826 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
2829 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
2827
2830
2828 You can use any separator other than "/". The final "i" is optional
2831 You can use any separator other than "/". The final "i" is optional
2829 and indicates that the search must be case insensitive.
2832 and indicates that the search must be case insensitive.
2830
2833
2831 Examples::
2834 Examples::
2832
2835
2833 [websub]
2836 [websub]
2834 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
2837 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
2835 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
2838 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
2836 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
2839 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
2837
2840
2838 ``worker``
2841 ``worker``
2839 ----------
2842 ----------
2840
2843
2841 Parallel master/worker configuration. We currently perform working
2844 Parallel master/worker configuration. We currently perform working
2842 directory updates in parallel on Unix-like systems, which greatly
2845 directory updates in parallel on Unix-like systems, which greatly
2843 helps performance.
2846 helps performance.
2844
2847
2845 ``enabled``
2848 ``enabled``
2846 Whether to enable workers code to be used.
2849 Whether to enable workers code to be used.
2847 (default: true)
2850 (default: true)
2848
2851
2849 ``numcpus``
2852 ``numcpus``
2850 Number of CPUs to use for parallel operations. A zero or
2853 Number of CPUs to use for parallel operations. A zero or
2851 negative value is treated as ``use the default``.
2854 negative value is treated as ``use the default``.
2852 (default: 4 or the number of CPUs on the system, whichever is larger)
2855 (default: 4 or the number of CPUs on the system, whichever is larger)
2853
2856
2854 ``backgroundclose``
2857 ``backgroundclose``
2855 Whether to enable closing file handles on background threads during certain
2858 Whether to enable closing file handles on background threads during certain
2856 operations. Some platforms aren't very efficient at closing file
2859 operations. Some platforms aren't very efficient at closing file
2857 handles that have been written or appended to. By performing file closing
2860 handles that have been written or appended to. By performing file closing
2858 on background threads, file write rate can increase substantially.
2861 on background threads, file write rate can increase substantially.
2859 (default: true on Windows, false elsewhere)
2862 (default: true on Windows, false elsewhere)
2860
2863
2861 ``backgroundcloseminfilecount``
2864 ``backgroundcloseminfilecount``
2862 Minimum number of files required to trigger background file closing.
2865 Minimum number of files required to trigger background file closing.
2863 Operations not writing this many files won't start background close
2866 Operations not writing this many files won't start background close
2864 threads.
2867 threads.
2865 (default: 2048)
2868 (default: 2048)
2866
2869
2867 ``backgroundclosemaxqueue``
2870 ``backgroundclosemaxqueue``
2868 The maximum number of opened file handles waiting to be closed in the
2871 The maximum number of opened file handles waiting to be closed in the
2869 background. This option only has an effect if ``backgroundclose`` is
2872 background. This option only has an effect if ``backgroundclose`` is
2870 enabled.
2873 enabled.
2871 (default: 384)
2874 (default: 384)
2872
2875
2873 ``backgroundclosethreadcount``
2876 ``backgroundclosethreadcount``
2874 Number of threads to process background file closes. Only relevant if
2877 Number of threads to process background file closes. Only relevant if
2875 ``backgroundclose`` is enabled.
2878 ``backgroundclose`` is enabled.
2876 (default: 4)
2879 (default: 4)
@@ -1,67 +1,81 b''
1 from __future__ import absolute_import
1 from __future__ import absolute_import
2
2
3 import os
3 import os
4
4
5 from . import (
5 from . import (
6 encoding,
6 encoding,
7 pycompat,
7 pycompat,
8 util,
8 util,
9 win32,
9 win32,
10 )
10 )
11
11
12 try:
12 try:
13 import _winreg as winreg # pytype: disable=import-error
13 import _winreg as winreg # pytype: disable=import-error
14
14
15 winreg.CloseKey
15 winreg.CloseKey
16 except ImportError:
16 except ImportError:
17 # py2 only
17 # py2 only
18 import winreg # pytype: disable=import-error
18 import winreg # pytype: disable=import-error
19
19
20 # MS-DOS 'more' is the only pager available by default on Windows.
20 # MS-DOS 'more' is the only pager available by default on Windows.
21 fallbackpager = b'more'
21 fallbackpager = b'more'
22
22
23
23
24 def systemrcpath():
24 def systemrcpath():
25 '''return default os-specific hgrc search path'''
25 '''return default os-specific hgrc search path'''
26 rcpath = []
26 rcpath = []
27 filename = win32.executablepath()
27 filename = win32.executablepath()
28 # Use mercurial.ini found in directory with hg.exe
28 # Use mercurial.ini found in directory with hg.exe
29 progrc = os.path.join(os.path.dirname(filename), b'mercurial.ini')
29 progrc = os.path.join(os.path.dirname(filename), b'mercurial.ini')
30 rcpath.append(progrc)
30 rcpath.append(progrc)
31
31
32 def _processdir(progrcd):
32 def _processdir(progrcd):
33 if os.path.isdir(progrcd):
33 if os.path.isdir(progrcd):
34 for f, kind in util.listdir(progrcd):
34 for f, kind in util.listdir(progrcd):
35 if f.endswith(b'.rc'):
35 if f.endswith(b'.rc'):
36 rcpath.append(os.path.join(progrcd, f))
36 rcpath.append(os.path.join(progrcd, f))
37
37
38 # Use hgrc.d found in directory with hg.exe
38 # Use hgrc.d found in directory with hg.exe
39 _processdir(os.path.join(os.path.dirname(filename), b'hgrc.d'))
39 _processdir(os.path.join(os.path.dirname(filename), b'hgrc.d'))
40
40
41 # treat a PROGRAMDATA directory as equivalent to /etc/mercurial
42 programdata = encoding.environ.get(b'PROGRAMDATA')
43 if programdata:
44 programdata = os.path.join(programdata, b'Mercurial')
45 _processdir(os.path.join(programdata, b'hgrc.d'))
46
47 ini = os.path.join(programdata, b'mercurial.ini')
48 if os.path.isfile(ini):
49 rcpath.append(ini)
50
51 ini = os.path.join(programdata, b'hgrc')
52 if os.path.isfile(ini):
53 rcpath.append(ini)
54
41 # next look for a system rcpath in the registry
55 # next look for a system rcpath in the registry
42 value = util.lookupreg(
56 value = util.lookupreg(
43 b'SOFTWARE\\Mercurial', None, winreg.HKEY_LOCAL_MACHINE
57 b'SOFTWARE\\Mercurial', None, winreg.HKEY_LOCAL_MACHINE
44 )
58 )
45 if value and isinstance(value, bytes):
59 if value and isinstance(value, bytes):
46 value = util.localpath(value)
60 value = util.localpath(value)
47 for p in value.split(pycompat.ospathsep):
61 for p in value.split(pycompat.ospathsep):
48 if p.lower().endswith(b'mercurial.ini'):
62 if p.lower().endswith(b'mercurial.ini'):
49 rcpath.append(p)
63 rcpath.append(p)
50 else:
64 else:
51 _processdir(p)
65 _processdir(p)
52 return rcpath
66 return rcpath
53
67
54
68
55 def userrcpath():
69 def userrcpath():
56 '''return os-specific hgrc search path to the user dir'''
70 '''return os-specific hgrc search path to the user dir'''
57 home = os.path.expanduser(b'~')
71 home = os.path.expanduser(b'~')
58 path = [os.path.join(home, b'mercurial.ini'), os.path.join(home, b'.hgrc')]
72 path = [os.path.join(home, b'mercurial.ini'), os.path.join(home, b'.hgrc')]
59 userprofile = encoding.environ.get(b'USERPROFILE')
73 userprofile = encoding.environ.get(b'USERPROFILE')
60 if userprofile and userprofile != home:
74 if userprofile and userprofile != home:
61 path.append(os.path.join(userprofile, b'mercurial.ini'))
75 path.append(os.path.join(userprofile, b'mercurial.ini'))
62 path.append(os.path.join(userprofile, b'.hgrc'))
76 path.append(os.path.join(userprofile, b'.hgrc'))
63 return path
77 return path
64
78
65
79
66 def termsize(ui):
80 def termsize(ui):
67 return win32.termsize()
81 return win32.termsize()
@@ -1,28 +1,30 b''
1 == New Features ==
1 == New Features ==
2
2
3 * Windows will process hgrc files in %PROGRAMDATA%\Mercurial\hgrc.d.
4
3
5
4 == New Experimental Features ==
6 == New Experimental Features ==
5
7
6
8
7 == Bug Fixes ==
9 == Bug Fixes ==
8
10
9 * The `indent()` template function was documented to not indent empty lines,
11 * The `indent()` template function was documented to not indent empty lines,
10 but it still indented the first line even if it was empty. It no longer does
12 but it still indented the first line even if it was empty. It no longer does
11 that.
13 that.
12
14
13 == Backwards Compatibility Changes ==
15 == Backwards Compatibility Changes ==
14
16
15
17
16 == Internal API Changes ==
18 == Internal API Changes ==
17
19
18 * Matcher instances no longer have a `explicitdir` property. Consider
20 * Matcher instances no longer have a `explicitdir` property. Consider
19 rewriting your code to use `repo.wvfs.isdir()` and/or
21 rewriting your code to use `repo.wvfs.isdir()` and/or
20 `ctx.hasdir()` instead. Also, the `traversedir` property is now
22 `ctx.hasdir()` instead. Also, the `traversedir` property is now
21 also called when only `explicitdir` used to be called. That may
23 also called when only `explicitdir` used to be called. That may
22 mean that you can simply remove the use of `explicitdir` if you
24 mean that you can simply remove the use of `explicitdir` if you
23 were already using `traversedir`.
25 were already using `traversedir`.
24
26
25 * The `revlog.nodemap` object have been merged into the `revlog.index` object.
27 * The `revlog.nodemap` object have been merged into the `revlog.index` object.
26 * `n in revlog.nodemap` becomes `revlog.index.has_node(n)`,
28 * `n in revlog.nodemap` becomes `revlog.index.has_node(n)`,
27 * `revlog.nodemap[n]` becomes `revlog.index.rev(n)`,
29 * `revlog.nodemap[n]` becomes `revlog.index.rev(n)`,
28 * `revlog.nodemap.get(n)` becomes `revlog.index.get_rev(n)`.
30 * `revlog.nodemap.get(n)` becomes `revlog.index.get_rev(n)`.
General Comments 0
You need to be logged in to leave comments. Login now