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