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