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