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