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