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