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