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