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