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