##// END OF EJS Templates
profiling: document the py-spy value for `profiling.type`...
marmoute -
r52770:8c990011 default
parent child Browse files
Show More
@@ -1,3486 +1,3489
1 1 The Mercurial system uses a set of configuration files to control
2 2 aspects of its behavior.
3 3
4 4 Troubleshooting
5 5 ===============
6 6
7 7 If you're having problems with your configuration,
8 8 :hg:`config --source` can help you understand what is introducing
9 9 a setting into your environment.
10 10
11 11 See :hg:`help config.syntax` and :hg:`help config.files`
12 12 for information about how and where to override things.
13 13
14 14 Structure
15 15 =========
16 16
17 17 The configuration files use a simple ini-file format. A configuration
18 18 file consists of sections, led by a ``[section]`` header and followed
19 19 by ``name = value`` entries::
20 20
21 21 [ui]
22 22 username = Firstname Lastname <firstname.lastname@example.net>
23 23 verbose = True
24 24
25 25 The above entries will be referred to as ``ui.username`` and
26 26 ``ui.verbose``, respectively. See :hg:`help config.syntax`.
27 27
28 28 Files
29 29 =====
30 30
31 31 Mercurial reads configuration data from several files, if they exist.
32 32 These files do not exist by default and you will have to create the
33 33 appropriate configuration files yourself:
34 34
35 35 Local configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
36 36
37 37 Global configuration like the username setting is typically put into:
38 38
39 39 .. container:: windows
40 40
41 41 - ``%USERPROFILE%\mercurial.ini`` (on Windows)
42 42
43 43 .. container:: unix.plan9
44 44
45 45 - ``$HOME/.hgrc`` (on Unix, Plan9)
46 46
47 47 The names of these files depend on the system on which Mercurial is
48 48 installed. ``*.rc`` files from a single directory are read in
49 49 alphabetical order, later ones overriding earlier ones. Where multiple
50 50 paths are given below, settings from earlier paths override later
51 51 ones.
52 52
53 53 .. container:: verbose.unix
54 54
55 55 On Unix, the following files are consulted:
56 56
57 57 - ``<repo>/.hg/hgrc-not-shared`` (per-repository)
58 58 - ``<repo>/.hg/hgrc`` (per-repository)
59 59 - ``$HOME/.hgrc`` (per-user)
60 60 - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user)
61 61 - ``<install-root>/etc/mercurial/hgrc`` (per-installation)
62 62 - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
63 63 - ``/etc/mercurial/hgrc`` (per-system)
64 64 - ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
65 65 - ``<internal>/*.rc`` (defaults)
66 66
67 67 .. container:: verbose.windows
68 68
69 69 On Windows, the following files are consulted:
70 70
71 71 - ``<repo>/.hg/hgrc-not-shared`` (per-repository)
72 72 - ``<repo>/.hg/hgrc`` (per-repository)
73 73 - ``%USERPROFILE%\.hgrc`` (per-user)
74 74 - ``%USERPROFILE%\Mercurial.ini`` (per-user)
75 75 - ``%HOME%\.hgrc`` (per-user)
76 76 - ``%HOME%\Mercurial.ini`` (per-user)
77 77 - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-system)
78 78 - ``<install-dir>\hgrc.d\*.rc`` (per-installation)
79 79 - ``<install-dir>\Mercurial.ini`` (per-installation)
80 80 - ``%PROGRAMDATA%\Mercurial\hgrc`` (per-system)
81 81 - ``%PROGRAMDATA%\Mercurial\Mercurial.ini`` (per-system)
82 82 - ``%PROGRAMDATA%\Mercurial\hgrc.d\*.rc`` (per-system)
83 83 - ``<internal>/*.rc`` (defaults)
84 84
85 85 .. note::
86 86
87 87 The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
88 88 is used when running 32-bit Python on 64-bit Windows.
89 89
90 90 .. container:: verbose.plan9
91 91
92 92 On Plan9, the following files are consulted:
93 93
94 94 - ``<repo>/.hg/hgrc-not-shared`` (per-repository)
95 95 - ``<repo>/.hg/hgrc`` (per-repository)
96 96 - ``$home/lib/hgrc`` (per-user)
97 97 - ``<install-root>/lib/mercurial/hgrc`` (per-installation)
98 98 - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
99 99 - ``/lib/mercurial/hgrc`` (per-system)
100 100 - ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
101 101 - ``<internal>/*.rc`` (defaults)
102 102
103 103 Per-repository configuration options only apply in a
104 104 particular repository. This file is not version-controlled, and
105 105 will not get transferred during a "clone" operation. Options in
106 106 this file override options in all other configuration files.
107 107
108 108 .. container:: unix.plan9
109 109
110 110 On Plan 9 and Unix, most of this file will be ignored if it doesn't
111 111 belong to a trusted user or to a trusted group. See
112 112 :hg:`help config.trusted` for more details.
113 113
114 114 Per-user configuration file(s) are for the user running Mercurial. Options
115 115 in these files apply to all Mercurial commands executed by this user in any
116 116 directory. Options in these files override per-system and per-installation
117 117 options.
118 118
119 119 Per-installation configuration files are searched for in the
120 120 directory where Mercurial is installed. ``<install-root>`` is the
121 121 parent directory of the **hg** executable (or symlink) being run.
122 122
123 123 .. container:: unix.plan9
124 124
125 125 For example, if installed in ``/shared/tools/bin/hg``, Mercurial
126 126 will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these
127 127 files apply to all Mercurial commands executed by any user in any
128 128 directory.
129 129
130 130 Per-installation configuration files are for the system on
131 131 which Mercurial is running. Options in these files apply to all
132 132 Mercurial commands executed by any user in any directory. Registry
133 133 keys contain PATH-like strings, every part of which must reference
134 134 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
135 135 be read. Mercurial checks each of these locations in the specified
136 136 order until one or more configuration files are detected.
137 137
138 138 Per-system configuration files are for the system on which Mercurial
139 139 is running. Options in these files apply to all Mercurial commands
140 140 executed by any user in any directory. Options in these files
141 141 override per-installation options.
142 142
143 143 Mercurial comes with some default configuration. The default configuration
144 144 files are installed with Mercurial and will be overwritten on upgrades. Default
145 145 configuration files should never be edited by users or administrators but can
146 146 be overridden in other configuration files. So far the directory only contains
147 147 merge tool configuration but packagers can also put other default configuration
148 148 there.
149 149
150 150 On versions 5.7 and later, if share-safe functionality is enabled,
151 151 shares will read config file of share source too.
152 152 `<share-source/.hg/hgrc>` is read before reading `<repo/.hg/hgrc>`.
153 153
154 154 For configs which should not be shared, `<repo/.hg/hgrc-not-shared>`
155 155 should be used.
156 156
157 157 Syntax
158 158 ======
159 159
160 160 A configuration file consists of sections, led by a ``[section]`` header
161 161 and followed by ``name = value`` entries (sometimes called
162 162 ``configuration keys``)::
163 163
164 164 [spam]
165 165 eggs=ham
166 166 green=
167 167 eggs
168 168
169 169 Each line contains one entry. If the lines that follow are indented,
170 170 they are treated as continuations of that entry. Leading whitespace is
171 171 removed from values. Empty lines are skipped. Lines beginning with
172 172 ``#`` or ``;`` are ignored and may be used to provide comments.
173 173
174 174 Configuration keys can be set multiple times, in which case Mercurial
175 175 will use the value that was configured last. As an example::
176 176
177 177 [spam]
178 178 eggs=large
179 179 ham=serrano
180 180 eggs=small
181 181
182 182 This would set the configuration key named ``eggs`` to ``small``.
183 183
184 184 It is also possible to define a section multiple times. A section can
185 185 be redefined on the same and/or on different configuration files. For
186 186 example::
187 187
188 188 [foo]
189 189 eggs=large
190 190 ham=serrano
191 191 eggs=small
192 192
193 193 [bar]
194 194 eggs=ham
195 195 green=
196 196 eggs
197 197
198 198 [foo]
199 199 ham=prosciutto
200 200 eggs=medium
201 201 bread=toasted
202 202
203 203 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
204 204 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
205 205 respectively. As you can see there only thing that matters is the last
206 206 value that was set for each of the configuration keys.
207 207
208 208 If a configuration key is set multiple times in different
209 209 configuration files the final value will depend on the order in which
210 210 the different configuration files are read, with settings from earlier
211 211 paths overriding later ones as described on the ``Files`` section
212 212 above.
213 213
214 214 A line of the form ``%include file`` will include ``file`` into the
215 215 current configuration file. The inclusion is recursive, which means
216 216 that included files can include other files. Filenames are relative to
217 217 the configuration file in which the ``%include`` directive is found.
218 218 Environment variables and ``~user`` constructs are expanded in
219 219 ``file``. This lets you do something like::
220 220
221 221 %include ~/.hgrc.d/$HOST.rc
222 222
223 223 to include a different configuration file on each computer you use.
224 224
225 225 A line with ``%unset name`` will remove ``name`` from the current
226 226 section, if it has been set previously.
227 227
228 228 The values are either free-form text strings, lists of text strings,
229 229 or Boolean values. Boolean values can be set to true using any of "1",
230 230 "yes", "true", or "on" and to false using "0", "no", "false", or "off"
231 231 (all case insensitive).
232 232
233 233 List values are separated by whitespace or comma, except when values are
234 234 placed in double quotation marks::
235 235
236 236 allow_read = "John Doe, PhD", brian, betty
237 237
238 238 Quotation marks can be escaped by prefixing them with a backslash. Only
239 239 quotation marks at the beginning of a word is counted as a quotation
240 240 (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
241 241
242 242 Sections
243 243 ========
244 244
245 245 This section describes the different sections that may appear in a
246 246 Mercurial configuration file, the purpose of each section, its possible
247 247 keys, and their possible values.
248 248
249 249 ``alias``
250 250 ---------
251 251
252 252 Defines command aliases.
253 253
254 254 Aliases allow you to define your own commands in terms of other
255 255 commands (or aliases), optionally including arguments. Positional
256 256 arguments in the form of ``$1``, ``$2``, etc. in the alias definition
257 257 are expanded by Mercurial before execution. Positional arguments not
258 258 already used by ``$N`` in the definition are put at the end of the
259 259 command to be executed.
260 260
261 261 Alias definitions consist of lines of the form::
262 262
263 263 <alias> = <command> [<argument>]...
264 264
265 265 For example, this definition::
266 266
267 267 latest = log --limit 5
268 268
269 269 creates a new command ``latest`` that shows only the five most recent
270 270 changesets. You can define subsequent aliases using earlier ones::
271 271
272 272 stable5 = latest -b stable
273 273
274 274 .. note::
275 275
276 276 It is possible to create aliases with the same names as
277 277 existing commands, which will then override the original
278 278 definitions. This is almost always a bad idea!
279 279
280 280 An alias can start with an exclamation point (``!``) to make it a
281 281 shell alias. A shell alias is executed with the shell and will let you
282 282 run arbitrary commands. As an example, ::
283 283
284 284 echo = !echo $@
285 285
286 286 will let you do ``hg echo foo`` to have ``foo`` printed in your
287 287 terminal. A better example might be::
288 288
289 289 purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f
290 290
291 291 which will make ``hg purge`` delete all unknown files in the
292 292 repository in the same manner as the purge extension.
293 293
294 294 Positional arguments like ``$1``, ``$2``, etc. in the alias definition
295 295 expand to the command arguments. Unmatched arguments are
296 296 removed. ``$0`` expands to the alias name and ``$@`` expands to all
297 297 arguments separated by a space. ``"$@"`` (with quotes) expands to all
298 298 arguments quoted individually and separated by a space. These expansions
299 299 happen before the command is passed to the shell.
300 300
301 301 Shell aliases are executed in an environment where ``$HG`` expands to
302 302 the path of the Mercurial that was used to execute the alias. This is
303 303 useful when you want to call further Mercurial commands in a shell
304 304 alias, as was done above for the purge alias. In addition,
305 305 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
306 306 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
307 307
308 308 .. note::
309 309
310 310 Some global configuration options such as ``-R`` are
311 311 processed before shell aliases and will thus not be passed to
312 312 aliases.
313 313
314 314
315 315 ``annotate``
316 316 ------------
317 317
318 318 Settings used when displaying file annotations. All values are
319 319 Booleans and default to False. See :hg:`help config.diff` for
320 320 related options for the diff command.
321 321
322 322 ``ignorews``
323 323 Ignore white space when comparing lines.
324 324
325 325 ``ignorewseol``
326 326 Ignore white space at the end of a line when comparing lines.
327 327
328 328 ``ignorewsamount``
329 329 Ignore changes in the amount of white space.
330 330
331 331 ``ignoreblanklines``
332 332 Ignore changes whose lines are all blank.
333 333
334 334
335 335 ``auth``
336 336 --------
337 337
338 338 Authentication credentials and other authentication-like configuration
339 339 for HTTP connections. This section allows you to store usernames and
340 340 passwords for use when logging *into* HTTP servers. See
341 341 :hg:`help config.web` if you want to configure *who* can login to
342 342 your HTTP server.
343 343
344 344 The following options apply to all hosts.
345 345
346 346 ``cookiefile``
347 347 Path to a file containing HTTP cookie lines. Cookies matching a
348 348 host will be sent automatically.
349 349
350 350 The file format uses the Mozilla cookies.txt format, which defines cookies
351 351 on their own lines. Each line contains 7 fields delimited by the tab
352 352 character (domain, is_domain_cookie, path, is_secure, expires, name,
353 353 value). For more info, do an Internet search for "Netscape cookies.txt
354 354 format."
355 355
356 356 Note: the cookies parser does not handle port numbers on domains. You
357 357 will need to remove ports from the domain for the cookie to be recognized.
358 358 This could result in a cookie being disclosed to an unwanted server.
359 359
360 360 The cookies file is read-only.
361 361
362 362 Other options in this section are grouped by name and have the following
363 363 format::
364 364
365 365 <name>.<argument> = <value>
366 366
367 367 where ``<name>`` is used to group arguments into authentication
368 368 entries. Example::
369 369
370 370 foo.prefix = hg.intevation.de/mercurial
371 371 foo.username = foo
372 372 foo.password = bar
373 373 foo.schemes = http https
374 374
375 375 bar.prefix = secure.example.org
376 376 bar.key = path/to/file.key
377 377 bar.cert = path/to/file.cert
378 378 bar.schemes = https
379 379
380 380 Supported arguments:
381 381
382 382 ``prefix``
383 383 Either ``*`` or a URI prefix with or without the scheme part.
384 384 The authentication entry with the longest matching prefix is used
385 385 (where ``*`` matches everything and counts as a match of length
386 386 1). If the prefix doesn't include a scheme, the match is performed
387 387 against the URI with its scheme stripped as well, and the schemes
388 388 argument, q.v., is then subsequently consulted.
389 389
390 390 ``username``
391 391 Optional. Username to authenticate with. If not given, and the
392 392 remote site requires basic or digest authentication, the user will
393 393 be prompted for it. Environment variables are expanded in the
394 394 username letting you do ``foo.username = $USER``. If the URI
395 395 includes a username, only ``[auth]`` entries with a matching
396 396 username or without a username will be considered.
397 397
398 398 ``password``
399 399 Optional. Password to authenticate with. If not given, and the
400 400 remote site requires basic or digest authentication, the user
401 401 will be prompted for it.
402 402
403 403 ``key``
404 404 Optional. PEM encoded client certificate key file. Environment
405 405 variables are expanded in the filename.
406 406
407 407 ``cert``
408 408 Optional. PEM encoded client certificate chain file. Environment
409 409 variables are expanded in the filename.
410 410
411 411 ``schemes``
412 412 Optional. Space separated list of URI schemes to use this
413 413 authentication entry with. Only used if the prefix doesn't include
414 414 a scheme. Supported schemes are http and https. They will match
415 415 static-http and static-https respectively, as well.
416 416 (default: https)
417 417
418 418 If no suitable authentication entry is found, the user is prompted
419 419 for credentials as usual if required by the remote.
420 420
421 421 ``censor``
422 422 ----------
423 423
424 424 ``policy``
425 425 :config-doc:`censor.policy`
426 426
427 427 ``cmdserver``
428 428 -------------
429 429
430 430 Controls command server settings. (ADVANCED)
431 431
432 432 ``message-encodings``
433 433 List of encodings for the ``m`` (message) channel. The first encoding
434 434 supported by the server will be selected and advertised in the hello
435 435 message. This is useful only when ``ui.message-output`` is set to
436 436 ``channel``. Supported encodings are ``cbor``.
437 437
438 438 ``shutdown-on-interrupt``
439 439 If set to false, the server's main loop will continue running after
440 440 SIGINT received. ``runcommand`` requests can still be interrupted by
441 441 SIGINT. Close the write end of the pipe to shut down the server
442 442 process gracefully.
443 443 (default: True)
444 444
445 445 ``color``
446 446 ---------
447 447
448 448 Configure the Mercurial color mode. For details about how to define your custom
449 449 effect and style see :hg:`help color`.
450 450
451 451 ``mode``
452 452 String: control the method used to output color. One of ``auto``, ``ansi``,
453 453 ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
454 454 use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a
455 455 terminal. Any invalid value will disable color.
456 456
457 457 ``pagermode``
458 458 String: optional override of ``color.mode`` used with pager.
459 459
460 460 On some systems, terminfo mode may cause problems when using
461 461 color with ``less -R`` as a pager program. less with the -R option
462 462 will only display ECMA-48 color codes, and terminfo mode may sometimes
463 463 emit codes that less doesn't understand. You can work around this by
464 464 either using ansi mode (or auto mode), or by using less -r (which will
465 465 pass through all terminal control codes, not just color control
466 466 codes).
467 467
468 468 On some systems (such as MSYS in Windows), the terminal may support
469 469 a different color mode than the pager program.
470 470
471 471 ``commands``
472 472 ------------
473 473
474 474 ``commit.post-status``
475 475 Show status of files in the working directory after successful commit.
476 476 (default: False)
477 477
478 478 ``merge.require-rev``
479 479 Require that the revision to merge the current commit with be specified on
480 480 the command line. If this is enabled and a revision is not specified, the
481 481 command aborts.
482 482 (default: False)
483 483
484 484 ``push.require-revs``
485 485 Require revisions to push be specified using one or more mechanisms such as
486 486 specifying them positionally on the command line, using ``-r``, ``-b``,
487 487 and/or ``-B`` on the command line, or using ``paths.<path>:pushrev`` in the
488 488 configuration. If this is enabled and revisions are not specified, the
489 489 command aborts.
490 490 (default: False)
491 491
492 492 ``resolve.confirm``
493 493 Confirm before performing action if no filename is passed.
494 494 (default: False)
495 495
496 496 ``resolve.explicit-re-merge``
497 497 Require uses of ``hg resolve`` to specify which action it should perform,
498 498 instead of re-merging files by default.
499 499 (default: False)
500 500
501 501 ``resolve.mark-check``
502 502 Determines what level of checking :hg:`resolve --mark` will perform before
503 503 marking files as resolved. Valid values are ``none`, ``warn``, and
504 504 ``abort``. ``warn`` will output a warning listing the file(s) that still
505 505 have conflict markers in them, but will still mark everything resolved.
506 506 ``abort`` will output the same warning but will not mark things as resolved.
507 507 If --all is passed and this is set to ``abort``, only a warning will be
508 508 shown (an error will not be raised).
509 509 (default: ``none``)
510 510
511 511 ``status.relative``
512 512 Make paths in :hg:`status` output relative to the current directory.
513 513 (default: False)
514 514
515 515 ``status.terse``
516 516 Default value for the --terse flag, which condenses status output.
517 517 (default: empty)
518 518
519 519 ``update.check``
520 520 Determines what level of checking :hg:`update` will perform before moving
521 521 to a destination revision. Valid values are ``abort``, ``none``,
522 522 ``linear``, and ``noconflict``.
523 523
524 524 - ``abort`` always fails if the working directory has uncommitted changes.
525 525
526 526 - ``none`` performs no checking, and may result in a merge with uncommitted changes.
527 527
528 528 - ``linear`` allows any update as long as it follows a straight line in the
529 529 revision history, and may trigger a merge with uncommitted changes.
530 530
531 531 - ``noconflict`` will allow any update which would not trigger a merge with
532 532 uncommitted changes, if any are present.
533 533
534 534 (default: ``linear``)
535 535
536 536 ``update.requiredest``
537 537 Require that the user pass a destination when running :hg:`update`.
538 538 For example, :hg:`update .::` will be allowed, but a plain :hg:`update`
539 539 will be disallowed.
540 540 (default: False)
541 541
542 542 ``committemplate``
543 543 ------------------
544 544
545 545 ``changeset``
546 546 String: configuration in this section is used as the template to
547 547 customize the text shown in the editor when committing.
548 548
549 549 In addition to pre-defined template keywords, commit log specific one
550 550 below can be used for customization:
551 551
552 552 ``extramsg``
553 553 String: Extra message (typically 'Leave message empty to abort
554 554 commit.'). This may be changed by some commands or extensions.
555 555
556 556 For example, the template configuration below shows as same text as
557 557 one shown by default::
558 558
559 559 [committemplate]
560 560 changeset = {desc}\n\n
561 561 HG: Enter commit message. Lines beginning with 'HG:' are removed.
562 562 HG: {extramsg}
563 563 HG: --
564 564 HG: user: {author}\n{ifeq(p2rev, "-1", "",
565 565 "HG: branch merge\n")
566 566 }HG: branch '{branch}'\n{if(activebookmark,
567 567 "HG: bookmark '{activebookmark}'\n") }{subrepos %
568 568 "HG: subrepo {subrepo}\n" }{file_adds %
569 569 "HG: added {file}\n" }{file_mods %
570 570 "HG: changed {file}\n" }{file_dels %
571 571 "HG: removed {file}\n" }{if(files, "",
572 572 "HG: no files changed\n")}
573 573
574 574 ``diff()``
575 575 String: show the diff (see :hg:`help templates` for detail)
576 576
577 577 Sometimes it is helpful to show the diff of the changeset in the editor without
578 578 having to prefix 'HG: ' to each line so that highlighting works correctly. For
579 579 this, Mercurial provides a special string which will ignore everything below
580 580 it::
581 581
582 582 HG: ------------------------ >8 ------------------------
583 583
584 584 For example, the template configuration below will show the diff below the
585 585 extra message::
586 586
587 587 [committemplate]
588 588 changeset = {desc}\n\n
589 589 HG: Enter commit message. Lines beginning with 'HG:' are removed.
590 590 HG: {extramsg}
591 591 HG: ------------------------ >8 ------------------------
592 592 HG: Do not touch the line above.
593 593 HG: Everything below will be removed.
594 594 {diff()}
595 595
596 596 .. note::
597 597
598 598 For some problematic encodings (see :hg:`help win32mbcs` for
599 599 detail), this customization should be configured carefully, to
600 600 avoid showing broken characters.
601 601
602 602 For example, if a multibyte character ending with backslash (0x5c) is
603 603 followed by the ASCII character 'n' in the customized template,
604 604 the sequence of backslash and 'n' is treated as line-feed unexpectedly
605 605 (and the multibyte character is broken, too).
606 606
607 607 Customized template is used for commands below (``--edit`` may be
608 608 required):
609 609
610 610 - :hg:`backout`
611 611 - :hg:`commit`
612 612 - :hg:`fetch` (for merge commit only)
613 613 - :hg:`graft`
614 614 - :hg:`histedit`
615 615 - :hg:`import`
616 616 - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
617 617 - :hg:`rebase`
618 618 - :hg:`shelve`
619 619 - :hg:`sign`
620 620 - :hg:`tag`
621 621 - :hg:`transplant`
622 622
623 623 Configuring items below instead of ``changeset`` allows showing
624 624 customized message only for specific actions, or showing different
625 625 messages for each action.
626 626
627 627 - ``changeset.backout`` for :hg:`backout`
628 628 - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
629 629 - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
630 630 - ``changeset.commit.normal.merge`` for :hg:`commit` on merges
631 631 - ``changeset.commit.normal.normal`` for :hg:`commit` on other
632 632 - ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
633 633 - ``changeset.gpg.sign`` for :hg:`sign`
634 634 - ``changeset.graft`` for :hg:`graft`
635 635 - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
636 636 - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
637 637 - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
638 638 - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
639 639 - ``changeset.import.bypass`` for :hg:`import --bypass`
640 640 - ``changeset.import.normal.merge`` for :hg:`import` on merges
641 641 - ``changeset.import.normal.normal`` for :hg:`import` on other
642 642 - ``changeset.mq.qnew`` for :hg:`qnew`
643 643 - ``changeset.mq.qfold`` for :hg:`qfold`
644 644 - ``changeset.mq.qrefresh`` for :hg:`qrefresh`
645 645 - ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
646 646 - ``changeset.rebase.merge`` for :hg:`rebase` on merges
647 647 - ``changeset.rebase.normal`` for :hg:`rebase` on other
648 648 - ``changeset.shelve.shelve`` for :hg:`shelve`
649 649 - ``changeset.tag.add`` for :hg:`tag` without ``--remove``
650 650 - ``changeset.tag.remove`` for :hg:`tag --remove`
651 651 - ``changeset.transplant.merge`` for :hg:`transplant` on merges
652 652 - ``changeset.transplant.normal`` for :hg:`transplant` on other
653 653
654 654 These dot-separated lists of names are treated as hierarchical ones.
655 655 For example, ``changeset.tag.remove`` customizes the commit message
656 656 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
657 657 commit message for :hg:`tag` regardless of ``--remove`` option.
658 658
659 659 When the external editor is invoked for a commit, the corresponding
660 660 dot-separated list of names without the ``changeset.`` prefix
661 661 (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment
662 662 variable.
663 663
664 664 In this section, items other than ``changeset`` can be referred from
665 665 others. For example, the configuration to list committed files up
666 666 below can be referred as ``{listupfiles}``::
667 667
668 668 [committemplate]
669 669 listupfiles = {file_adds %
670 670 "HG: added {file}\n" }{file_mods %
671 671 "HG: changed {file}\n" }{file_dels %
672 672 "HG: removed {file}\n" }{if(files, "",
673 673 "HG: no files changed\n")}
674 674
675 675 ``decode/encode``
676 676 -----------------
677 677
678 678 Filters for transforming files on checkout/checkin. This would
679 679 typically be used for newline processing or other
680 680 localization/canonicalization of files.
681 681
682 682 Filters consist of a filter pattern followed by a filter command.
683 683 Filter patterns are globs by default, rooted at the repository root.
684 684 For example, to match any file ending in ``.txt`` in the root
685 685 directory only, use the pattern ``*.txt``. To match any file ending
686 686 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
687 687 For each file only the first matching filter applies.
688 688
689 689 The filter command can start with a specifier, either ``pipe:`` or
690 690 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
691 691
692 692 A ``pipe:`` command must accept data on stdin and return the transformed
693 693 data on stdout.
694 694
695 695 Pipe example::
696 696
697 697 [encode]
698 698 # uncompress gzip files on checkin to improve delta compression
699 699 # note: not necessarily a good idea, just an example
700 700 *.gz = pipe: gunzip
701 701
702 702 [decode]
703 703 # recompress gzip files when writing them to the working dir (we
704 704 # can safely omit "pipe:", because it's the default)
705 705 *.gz = gzip
706 706
707 707 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
708 708 with the name of a temporary file that contains the data to be
709 709 filtered by the command. The string ``OUTFILE`` is replaced with the name
710 710 of an empty temporary file, where the filtered data must be written by
711 711 the command.
712 712
713 713 .. container:: windows
714 714
715 715 .. note::
716 716
717 717 The tempfile mechanism is recommended for Windows systems,
718 718 where the standard shell I/O redirection operators often have
719 719 strange effects and may corrupt the contents of your files.
720 720
721 721 This filter mechanism is used internally by the ``eol`` extension to
722 722 translate line ending characters between Windows (CRLF) and Unix (LF)
723 723 format. We suggest you use the ``eol`` extension for convenience.
724 724
725 725
726 726 ``defaults``
727 727 ------------
728 728
729 729 (defaults are deprecated. Don't use them. Use aliases instead.)
730 730
731 731 Use the ``[defaults]`` section to define command defaults, i.e. the
732 732 default options/arguments to pass to the specified commands.
733 733
734 734 The following example makes :hg:`log` run in verbose mode, and
735 735 :hg:`status` show only the modified files, by default::
736 736
737 737 [defaults]
738 738 log = -v
739 739 status = -m
740 740
741 741 The actual commands, instead of their aliases, must be used when
742 742 defining command defaults. The command defaults will also be applied
743 743 to the aliases of the commands defined.
744 744
745 745
746 746 ``diff``
747 747 --------
748 748
749 749 Settings used when displaying diffs. Everything except for ``unified``
750 750 is a Boolean and defaults to False. See :hg:`help config.annotate`
751 751 for related options for the annotate command.
752 752
753 753 ``git``
754 754 Use git extended diff format.
755 755
756 756 ``nobinary``
757 757 Omit git binary patches.
758 758
759 759 ``nodates``
760 760 Don't include dates in diff headers.
761 761
762 762 ``noprefix``
763 763 Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
764 764
765 765 ``showfunc``
766 766 Show which function each change is in.
767 767
768 768 ``ignorews``
769 769 Ignore white space when comparing lines.
770 770
771 771 ``ignorewsamount``
772 772 Ignore changes in the amount of white space.
773 773
774 774 ``ignoreblanklines``
775 775 Ignore changes whose lines are all blank.
776 776
777 777 ``unified``
778 778 Number of lines of context to show.
779 779
780 780 ``word-diff``
781 781 Highlight changed words.
782 782
783 783 ``email``
784 784 ---------
785 785
786 786 Settings for extensions that send email messages.
787 787
788 788 ``from``
789 789 Optional. Email address to use in "From" header and SMTP envelope
790 790 of outgoing messages.
791 791
792 792 ``to``
793 793 Optional. Comma-separated list of recipients' email addresses.
794 794
795 795 ``cc``
796 796 Optional. Comma-separated list of carbon copy recipients'
797 797 email addresses.
798 798
799 799 ``bcc``
800 800 Optional. Comma-separated list of blind carbon copy recipients'
801 801 email addresses.
802 802
803 803 ``method``
804 804 Optional. Method to use to send email messages. If value is ``smtp``
805 805 (default), use SMTP (see the ``[smtp]`` section for configuration).
806 806 Otherwise, use as name of program to run that acts like sendmail
807 807 (takes ``-f`` option for sender, list of recipients on command line,
808 808 message on stdin). Normally, setting this to ``sendmail`` or
809 809 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
810 810
811 811 ``charsets``
812 812 Optional. Comma-separated list of character sets considered
813 813 convenient for recipients. Addresses, headers, and parts not
814 814 containing patches of outgoing messages will be encoded in the
815 815 first character set to which conversion from local encoding
816 816 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
817 817 conversion fails, the text in question is sent as is.
818 818 (default: '')
819 819
820 820 Order of outgoing email character sets:
821 821
822 822 1. ``us-ascii``: always first, regardless of settings
823 823 2. ``email.charsets``: in order given by user
824 824 3. ``ui.fallbackencoding``: if not in email.charsets
825 825 4. ``$HGENCODING``: if not in email.charsets
826 826 5. ``utf-8``: always last, regardless of settings
827 827
828 828 Email example::
829 829
830 830 [email]
831 831 from = Joseph User <joe.user@example.com>
832 832 method = /usr/sbin/sendmail
833 833 # charsets for western Europeans
834 834 # us-ascii, utf-8 omitted, as they are tried first and last
835 835 charsets = iso-8859-1, iso-8859-15, windows-1252
836 836
837 837
838 838 ``extensions``
839 839 --------------
840 840
841 841 Mercurial has an extension mechanism for adding new features. To
842 842 enable an extension, create an entry for it in this section.
843 843
844 844 If you know that the extension is already in Python's search path,
845 845 you can give the name of the module, followed by ``=``, with nothing
846 846 after the ``=``.
847 847
848 848 Otherwise, give a name that you choose, followed by ``=``, followed by
849 849 the path to the ``.py`` file (including the file name extension) that
850 850 defines the extension.
851 851
852 852 To explicitly disable an extension that is enabled in an hgrc of
853 853 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
854 854 or ``foo = !`` when path is not supplied.
855 855
856 856 Example for ``~/.hgrc``::
857 857
858 858 [extensions]
859 859 # (the churn extension will get loaded from Mercurial's path)
860 860 churn =
861 861 # (this extension will get loaded from the file specified)
862 862 myfeature = ~/.hgext/myfeature.py
863 863
864 864 If an extension fails to load, a warning will be issued, and Mercurial will
865 865 proceed. To enforce that an extension must be loaded, one can set the `required`
866 866 suboption in the config::
867 867
868 868 [extensions]
869 869 myfeature = ~/.hgext/myfeature.py
870 870 myfeature:required = yes
871 871
872 872 To debug extension loading issue, one can add `--traceback` to their mercurial
873 873 invocation.
874 874
875 875 A default setting can we set using the special `*` extension key::
876 876
877 877 [extensions]
878 878 *:required = yes
879 879 myfeature = ~/.hgext/myfeature.py
880 880 rebase=
881 881
882 882
883 883 ``format``
884 884 ----------
885 885
886 886 Configuration that controls the repository format. Newer format options are more
887 887 powerful, but incompatible with some older versions of Mercurial. Format options
888 888 are considered at repository initialization only. You need to make a new clone
889 889 for config changes to be taken into account.
890 890
891 891 For more details about repository format and version compatibility, see
892 892 https://www.mercurial-scm.org/wiki/MissingRequirement
893 893
894 894 ``usegeneraldelta``
895 895 Enable or disable the "generaldelta" repository format which improves
896 896 repository compression by allowing "revlog" to store deltas against
897 897 arbitrary revisions instead of the previously stored one. This provides
898 898 significant improvement for repositories with branches.
899 899
900 900 Repositories with this on-disk format require Mercurial version 1.9.
901 901
902 902 Enabled by default.
903 903
904 904 ``dotencode``
905 905 Enable or disable the "dotencode" repository format which enhances
906 906 the "fncache" repository format (which has to be enabled to use
907 907 dotencode) to avoid issues with filenames starting with "._" on
908 908 Mac OS X and spaces on Windows.
909 909
910 910 Repositories with this on-disk format require Mercurial version 1.7.
911 911
912 912 Enabled by default.
913 913
914 914 ``usefncache``
915 915 Enable or disable the "fncache" repository format which enhances
916 916 the "store" repository format (which has to be enabled to use
917 917 fncache) to allow longer filenames and avoids using Windows
918 918 reserved names, e.g. "nul".
919 919
920 920 Repositories with this on-disk format require Mercurial version 1.1.
921 921
922 922 Enabled by default.
923 923
924 924 ``use-dirstate-v2``
925 925 Enable or disable the experimental "dirstate-v2" feature. The dirstate
926 926 functionality is shared by all commands interacting with the working copy.
927 927 The new version is more robust, faster and stores more information.
928 928
929 929 The performance-improving version of this feature is currently only
930 930 implemented in Rust (see :hg:`help rust`), so people not using a version of
931 931 Mercurial compiled with the Rust parts might actually suffer some slowdown.
932 932 For this reason, such versions will by default refuse to access repositories
933 933 with "dirstate-v2" enabled.
934 934
935 935 This behavior can be adjusted via configuration: check
936 936 :hg:`help config.storage.dirstate-v2.slow-path` for details.
937 937
938 938 Repositories with this on-disk format require Mercurial 6.0 or above.
939 939
940 940 By default this format variant is disabled if the fast implementation is not
941 941 available, and enabled by default if the fast implementation is available.
942 942
943 943 To accomodate installations of Mercurial without the fast implementation,
944 944 you can downgrade your repository. To do so run the following command:
945 945
946 946 $ hg debugupgraderepo \
947 947 --run \
948 948 --config format.use-dirstate-v2=False \
949 949 --config storage.dirstate-v2.slow-path=allow
950 950
951 951 For a more comprehensive guide, see :hg:`help internals.dirstate-v2`.
952 952
953 953 ``use-dirstate-v2.automatic-upgrade-of-mismatching-repositories``
954 954 When enabled, an automatic upgrade will be triggered when a repository format
955 955 does not match its `use-dirstate-v2` config.
956 956
957 957 This is an advanced behavior that most users will not need. We recommend you
958 958 don't use this unless you are a seasoned administrator of a Mercurial install
959 959 base.
960 960
961 961 Automatic upgrade means that any process accessing the repository will
962 962 upgrade the repository format to use `dirstate-v2`. This only triggers if a
963 963 change is needed. This also applies to operations that would have been
964 964 read-only (like hg status).
965 965
966 966 If the repository cannot be locked, the automatic-upgrade operation will be
967 967 skipped. The next operation will attempt it again.
968 968
969 969 This configuration will apply for moves in any direction, either adding the
970 970 `dirstate-v2` format if `format.use-dirstate-v2=yes` or removing the
971 971 `dirstate-v2` requirement if `format.use-dirstate-v2=no`. So we recommend
972 972 setting both this value and `format.use-dirstate-v2` at the same time.
973 973
974 974 ``use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet``
975 975 Hide message when performing such automatic upgrade.
976 976
977 977 ``use-dirstate-tracked-hint``
978 978 Enable or disable the writing of "tracked key" file alongside the dirstate.
979 979 (default to disabled)
980 980
981 981 That "tracked-hint" can help external automations to detect changes to the
982 982 set of tracked files. (i.e the result of `hg files` or `hg status -macd`)
983 983
984 984 The tracked-hint is written in a new `.hg/dirstate-tracked-hint`. That file
985 985 contains two lines:
986 986 - the first line is the file version (currently: 1),
987 987 - the second line contains the "tracked-hint".
988 988 That file is written right after the dirstate is written.
989 989
990 990 The tracked-hint changes whenever the set of file tracked in the dirstate
991 991 changes. The general idea is:
992 992 - if the hint is identical, the set of tracked file SHOULD be identical,
993 993 - if the hint is different, the set of tracked file MIGHT be different.
994 994
995 995 The "hint is identical" case uses `SHOULD` as the dirstate and the hint file
996 996 are two distinct files and therefore that cannot be read or written to in an
997 997 atomic way. If the key is identical, nothing garantees that the dirstate is
998 998 not updated right after the hint file. This is considered a negligible
999 999 limitation for the intended usecase. It is actually possible to prevent this
1000 1000 race by taking the repository lock during read operations.
1001 1001
1002 1002 They are two "ways" to use this feature:
1003 1003
1004 1004 1) monitoring changes to the `.hg/dirstate-tracked-hint`, if the file
1005 1005 changes, the tracked set might have changed.
1006 1006
1007 1007 2) storing the value and comparing it to a later value.
1008 1008
1009 1009
1010 1010 ``use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories``
1011 1011 When enabled, an automatic upgrade will be triggered when a repository format
1012 1012 does not match its `use-dirstate-tracked-hint` config.
1013 1013
1014 1014 This is an advanced behavior that most users will not need. We recommend you
1015 1015 don't use this unless you are a seasoned administrator of a Mercurial install
1016 1016 base.
1017 1017
1018 1018 Automatic upgrade means that any process accessing the repository will
1019 1019 upgrade the repository format to use `dirstate-tracked-hint`. This only
1020 1020 triggers if a change is needed. This also applies to operations that would
1021 1021 have been read-only (like hg status).
1022 1022
1023 1023 If the repository cannot be locked, the automatic-upgrade operation will be
1024 1024 skipped. The next operation will attempt it again.
1025 1025
1026 1026 This configuration will apply for moves in any direction, either adding the
1027 1027 `dirstate-tracked-hint` format if `format.use-dirstate-tracked-hint=yes` or
1028 1028 removing the `dirstate-tracked-hint` requirement if
1029 1029 `format.use-dirstate-tracked-hint=no`. So we recommend setting both this
1030 1030 value and `format.use-dirstate-tracked-hint` at the same time.
1031 1031
1032 1032
1033 1033 ``use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet``
1034 1034 Hide message when performing such automatic upgrade.
1035 1035
1036 1036
1037 1037 ``use-persistent-nodemap``
1038 1038 Enable or disable the "persistent-nodemap" feature which improves
1039 1039 performance if the Rust extensions are available.
1040 1040
1041 1041 The "persistent-nodemap" persist the "node -> rev" on disk removing the
1042 1042 need to dynamically build that mapping for each Mercurial invocation. This
1043 1043 significantly reduces the startup cost of various local and server-side
1044 1044 operation for larger repositories.
1045 1045
1046 1046 The performance-improving version of this feature is currently only
1047 1047 implemented in Rust (see :hg:`help rust`), so people not using a version of
1048 1048 Mercurial compiled with the Rust parts might actually suffer some slowdown.
1049 1049 For this reason, such versions will by default refuse to access repositories
1050 1050 with "persistent-nodemap".
1051 1051
1052 1052 This behavior can be adjusted via configuration: check
1053 1053 :hg:`help config.storage.revlog.persistent-nodemap.slow-path` for details.
1054 1054
1055 1055 Repositories with this on-disk format require Mercurial 5.4 or above.
1056 1056
1057 1057 By default this format variant is disabled if the fast implementation is not
1058 1058 available, and enabled by default if the fast implementation is available.
1059 1059
1060 1060 To accomodate installations of Mercurial without the fast implementation,
1061 1061 you can downgrade your repository. To do so run the following command:
1062 1062
1063 1063 $ hg debugupgraderepo \
1064 1064 --run \
1065 1065 --config format.use-persistent-nodemap=False \
1066 1066 --config storage.revlog.persistent-nodemap.slow-path=allow
1067 1067
1068 1068 ``use-share-safe``
1069 1069 Enforce "safe" behaviors for all "shares" that access this repository.
1070 1070
1071 1071 With this feature, "shares" using this repository as a source will:
1072 1072
1073 1073 * read the source repository's configuration (`<source>/.hg/hgrc`).
1074 1074 * read and use the source repository's "requirements"
1075 1075 (except the working copy specific one).
1076 1076
1077 1077 Without this feature, "shares" using this repository as a source will:
1078 1078
1079 1079 * keep tracking the repository "requirements" in the share only, ignoring
1080 1080 the source "requirements", possibly diverging from them.
1081 1081 * ignore source repository config. This can create problems, like silently
1082 1082 ignoring important hooks.
1083 1083
1084 1084 Beware that existing shares will not be upgraded/downgraded, and by
1085 1085 default, Mercurial will refuse to interact with them until the mismatch
1086 1086 is resolved. See :hg:`help config.share.safe-mismatch.source-safe` and
1087 1087 :hg:`help config.share.safe-mismatch.source-not-safe` for details.
1088 1088
1089 1089 Introduced in Mercurial 5.7.
1090 1090
1091 1091 Enabled by default in Mercurial 6.1.
1092 1092
1093 1093 ``use-share-safe.automatic-upgrade-of-mismatching-repositories``
1094 1094 When enabled, an automatic upgrade will be triggered when a repository format
1095 1095 does not match its `use-share-safe` config.
1096 1096
1097 1097 This is an advanced behavior that most users will not need. We recommend you
1098 1098 don't use this unless you are a seasoned administrator of a Mercurial install
1099 1099 base.
1100 1100
1101 1101 Automatic upgrade means that any process accessing the repository will
1102 1102 upgrade the repository format to use `share-safe`. This only triggers if a
1103 1103 change is needed. This also applies to operation that would have been
1104 1104 read-only (like hg status).
1105 1105
1106 1106 If the repository cannot be locked, the automatic-upgrade operation will be
1107 1107 skipped. The next operation will attempt it again.
1108 1108
1109 1109 This configuration will apply for moves in any direction, either adding the
1110 1110 `share-safe` format if `format.use-share-safe=yes` or removing the
1111 1111 `share-safe` requirement if `format.use-share-safe=no`. So we recommend
1112 1112 setting both this value and `format.use-share-safe` at the same time.
1113 1113
1114 1114 ``use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet``
1115 1115 Hide message when performing such automatic upgrade.
1116 1116
1117 1117 ``usestore``
1118 1118 Enable or disable the "store" repository format which improves
1119 1119 compatibility with systems that fold case or otherwise mangle
1120 1120 filenames. Disabling this option will allow you to store longer filenames
1121 1121 in some situations at the expense of compatibility.
1122 1122
1123 1123 Repositories with this on-disk format require Mercurial version 0.9.4.
1124 1124
1125 1125 Enabled by default.
1126 1126
1127 1127 ``sparse-revlog``
1128 1128 Enable or disable the ``sparse-revlog`` delta strategy. This format improves
1129 1129 delta re-use inside revlog. For very branchy repositories, it results in a
1130 1130 smaller store. For repositories with many revisions, it also helps
1131 1131 performance (by using shortened delta chains.)
1132 1132
1133 1133 Repositories with this on-disk format require Mercurial version 4.7
1134 1134
1135 1135 Enabled by default.
1136 1136
1137 1137 ``revlog-compression``
1138 1138 Compression algorithm used by revlog. Supported values are `zlib` and
1139 1139 `zstd`. The `zlib` engine is the historical default of Mercurial. `zstd` is
1140 1140 a newer format that is usually a net win over `zlib`, operating faster at
1141 1141 better compression rates. Use `zstd` to reduce CPU usage. Multiple values
1142 1142 can be specified, the first available one will be used.
1143 1143
1144 1144 On some systems, the Mercurial installation may lack `zstd` support.
1145 1145
1146 1146 Default is `zstd` if available, `zlib` otherwise.
1147 1147
1148 1148 ``bookmarks-in-store``
1149 1149 Store bookmarks in .hg/store/. This means that bookmarks are shared when
1150 1150 using `hg share` regardless of the `-B` option.
1151 1151
1152 1152 Repositories with this on-disk format require Mercurial version 5.1.
1153 1153
1154 1154 Disabled by default.
1155 1155
1156 1156
1157 1157 ``graph``
1158 1158 ---------
1159 1159
1160 1160 Web graph view configuration. This section let you change graph
1161 1161 elements display properties by branches, for instance to make the
1162 1162 ``default`` branch stand out.
1163 1163
1164 1164 Each line has the following format::
1165 1165
1166 1166 <branch>.<argument> = <value>
1167 1167
1168 1168 where ``<branch>`` is the name of the branch being
1169 1169 customized. Example::
1170 1170
1171 1171 [graph]
1172 1172 # 2px width
1173 1173 default.width = 2
1174 1174 # red color
1175 1175 default.color = FF0000
1176 1176
1177 1177 Supported arguments:
1178 1178
1179 1179 ``width``
1180 1180 Set branch edges width in pixels.
1181 1181
1182 1182 ``color``
1183 1183 Set branch edges color in hexadecimal RGB notation.
1184 1184
1185 1185 ``hooks``
1186 1186 ---------
1187 1187
1188 1188 Commands or Python functions that get automatically executed by
1189 1189 various actions such as starting or finishing a commit. Multiple
1190 1190 hooks can be run for the same action by appending a suffix to the
1191 1191 action. Overriding a site-wide hook can be done by changing its
1192 1192 value or setting it to an empty string. Hooks can be prioritized
1193 1193 by adding a prefix of ``priority.`` to the hook name on a new line
1194 1194 and setting the priority. The default priority is 0.
1195 1195
1196 1196 Example ``.hg/hgrc``::
1197 1197
1198 1198 [hooks]
1199 1199 # update working directory after adding changesets
1200 1200 changegroup.update = hg update
1201 1201 # do not use the site-wide hook
1202 1202 incoming =
1203 1203 incoming.email = /my/email/hook
1204 1204 incoming.autobuild = /my/build/hook
1205 1205 # force autobuild hook to run before other incoming hooks
1206 1206 priority.incoming.autobuild = 1
1207 1207 ### control HGPLAIN setting when running autobuild hook
1208 1208 # HGPLAIN always set (default from Mercurial 5.7)
1209 1209 incoming.autobuild:run-with-plain = yes
1210 1210 # HGPLAIN never set
1211 1211 incoming.autobuild:run-with-plain = no
1212 1212 # HGPLAIN inherited from environment (default before Mercurial 5.7)
1213 1213 incoming.autobuild:run-with-plain = auto
1214 1214
1215 1215 Most hooks are run with environment variables set that give useful
1216 1216 additional information. For each hook below, the environment variables
1217 1217 it is passed are listed with names in the form ``$HG_foo``. The
1218 1218 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
1219 1219 They contain the type of hook which triggered the run and the full name
1220 1220 of the hook in the config, respectively. In the example above, this will
1221 1221 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
1222 1222
1223 1223 .. container:: windows
1224 1224
1225 1225 Some basic Unix syntax can be enabled for portability, including ``$VAR``
1226 1226 and ``${VAR}`` style variables. A ``~`` followed by ``\`` or ``/`` will
1227 1227 be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion
1228 1228 on Unix. To use a literal ``$`` or ``~``, it must be escaped with a back
1229 1229 slash or inside of a strong quote. Strong quotes will be replaced by
1230 1230 double quotes after processing.
1231 1231
1232 1232 This feature is enabled by adding a prefix of ``tonative.`` to the hook
1233 1233 name on a new line, and setting it to ``True``. For example::
1234 1234
1235 1235 [hooks]
1236 1236 incoming.autobuild = /my/build/hook
1237 1237 # enable translation to cmd.exe syntax for autobuild hook
1238 1238 tonative.incoming.autobuild = True
1239 1239
1240 1240 ``changegroup``
1241 1241 Run after a changegroup has been added via push, pull or unbundle. The ID of
1242 1242 the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
1243 1243 The URL from which changes came is in ``$HG_URL``.
1244 1244
1245 1245 ``commit``
1246 1246 Run after a changeset has been created in the local repository. The ID
1247 1247 of the newly created changeset is in ``$HG_NODE``. Parent changeset
1248 1248 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1249 1249
1250 1250 ``incoming``
1251 1251 Run after a changeset has been pulled, pushed, or unbundled into
1252 1252 the local repository. The ID of the newly arrived changeset is in
1253 1253 ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
1254 1254
1255 1255 ``outgoing``
1256 1256 Run after sending changes from the local repository to another. The ID of
1257 1257 first changeset sent is in ``$HG_NODE``. The source of operation is in
1258 1258 ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
1259 1259
1260 1260 ``post-<command>``
1261 1261 Run after successful invocations of the associated command. The
1262 1262 contents of the command line are passed as ``$HG_ARGS`` and the result
1263 1263 code in ``$HG_RESULT``. Parsed command line arguments are passed as
1264 1264 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
1265 1265 the python data internally passed to <command>. ``$HG_OPTS`` is a
1266 1266 dictionary of options (with unspecified options set to their defaults).
1267 1267 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
1268 1268
1269 1269 ``fail-<command>``
1270 1270 Run after a failed invocation of an associated command. The contents
1271 1271 of the command line are passed as ``$HG_ARGS``. Parsed command line
1272 1272 arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
1273 1273 string representations of the python data internally passed to
1274 1274 <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
1275 1275 options set to their defaults). ``$HG_PATS`` is a list of arguments.
1276 1276 Hook failure is ignored.
1277 1277
1278 1278 ``pre-<command>``
1279 1279 Run before executing the associated command. The contents of the
1280 1280 command line are passed as ``$HG_ARGS``. Parsed command line arguments
1281 1281 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
1282 1282 representations of the data internally passed to <command>. ``$HG_OPTS``
1283 1283 is a dictionary of options (with unspecified options set to their
1284 1284 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
1285 1285 failure, the command doesn't execute and Mercurial returns the failure
1286 1286 code.
1287 1287
1288 1288 ``prechangegroup``
1289 1289 Run before a changegroup is added via push, pull or unbundle. Exit
1290 1290 status 0 allows the changegroup to proceed. A non-zero status will
1291 1291 cause the push, pull or unbundle to fail. The URL from which changes
1292 1292 will come is in ``$HG_URL``.
1293 1293
1294 1294 ``precommit``
1295 1295 Run before starting a local commit. Exit status 0 allows the
1296 1296 commit to proceed. A non-zero status will cause the commit to fail.
1297 1297 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1298 1298
1299 1299 ``prelistkeys``
1300 1300 Run before listing pushkeys (like bookmarks) in the
1301 1301 repository. A non-zero status will cause failure. The key namespace is
1302 1302 in ``$HG_NAMESPACE``.
1303 1303
1304 1304 ``preoutgoing``
1305 1305 Run before collecting changes to send from the local repository to
1306 1306 another. A non-zero status will cause failure. This lets you prevent
1307 1307 pull over HTTP or SSH. It can also prevent propagating commits (via
1308 1308 local pull, push (outbound) or bundle commands), but not completely,
1309 1309 since you can just copy files instead. The source of operation is in
1310 1310 ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
1311 1311 SSH or HTTP repository. If "push", "pull" or "bundle", the operation
1312 1312 is happening on behalf of a repository on same system.
1313 1313
1314 1314 ``prepushkey``
1315 1315 Run before a pushkey (like a bookmark) is added to the
1316 1316 repository. A non-zero status will cause the key to be rejected. The
1317 1317 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
1318 1318 the old value (if any) is in ``$HG_OLD``, and the new value is in
1319 1319 ``$HG_NEW``.
1320 1320
1321 1321 ``pretag``
1322 1322 Run before creating a tag. Exit status 0 allows the tag to be
1323 1323 created. A non-zero status will cause the tag to fail. The ID of the
1324 1324 changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
1325 1325 tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
1326 1326
1327 1327 ``pretransmit-inline-clone-bundle``
1328 1328 Run before transferring an inline clonebundle to the peer.
1329 1329 If the exit status is 0, the inline clonebundle will be allowed to be
1330 1330 transferred. A non-zero status will cause the transfer to fail.
1331 1331 The path of the inline clonebundle is in ``$HG_CLONEBUNDLEPATH``.
1332 1332
1333 1333 ``pretxnopen``
1334 1334 Run before any new repository transaction is open. The reason for the
1335 1335 transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
1336 1336 transaction will be in ``$HG_TXNID``. A non-zero status will prevent the
1337 1337 transaction from being opened.
1338 1338
1339 1339 ``pretxnclose``
1340 1340 Run right before the transaction is actually finalized. Any repository change
1341 1341 will be visible to the hook program. This lets you validate the transaction
1342 1342 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1343 1343 status will cause the transaction to be rolled back. The reason for the
1344 1344 transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
1345 1345 the transaction will be in ``$HG_TXNID``. The rest of the available data will
1346 1346 vary according the transaction type. Changes unbundled to the repository will
1347 1347 add ``$HG_URL`` and ``$HG_SOURCE``. New changesets will add ``$HG_NODE`` (the
1348 1348 ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last added
1349 1349 changeset). Bookmark and phase changes will set ``$HG_BOOKMARK_MOVED`` and
1350 1350 ``$HG_PHASES_MOVED`` to ``1`` respectively. The number of new obsmarkers, if
1351 1351 any, will be in ``$HG_NEW_OBSMARKERS``, etc.
1352 1352
1353 1353 ``pretxnclose-bookmark``
1354 1354 Run right before a bookmark change is actually finalized. Any repository
1355 1355 change will be visible to the hook program. This lets you validate the
1356 1356 transaction content or change it. Exit status 0 allows the commit to
1357 1357 proceed. A non-zero status will cause the transaction to be rolled back.
1358 1358 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
1359 1359 bookmark location will be available in ``$HG_NODE`` while the previous
1360 1360 location will be available in ``$HG_OLDNODE``. In case of a bookmark
1361 1361 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1362 1362 will be empty.
1363 1363 In addition, the reason for the transaction opening will be in
1364 1364 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1365 1365 ``$HG_TXNID``.
1366 1366
1367 1367 ``pretxnclose-phase``
1368 1368 Run right before a phase change is actually finalized. Any repository change
1369 1369 will be visible to the hook program. This lets you validate the transaction
1370 1370 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1371 1371 status will cause the transaction to be rolled back. The hook is called
1372 1372 multiple times, once for each revision affected by a phase change.
1373 1373 The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
1374 1374 while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
1375 1375 will be empty. In addition, the reason for the transaction opening will be in
1376 1376 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1377 1377 ``$HG_TXNID``. The hook is also run for newly added revisions. In this case
1378 1378 the ``$HG_OLDPHASE`` entry will be empty.
1379 1379
1380 1380 ``txnclose``
1381 1381 Run after any repository transaction has been committed. At this
1382 1382 point, the transaction can no longer be rolled back. The hook will run
1383 1383 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
1384 1384 details about available variables.
1385 1385
1386 1386 ``txnclose-bookmark``
1387 1387 Run after any bookmark change has been committed. At this point, the
1388 1388 transaction can no longer be rolled back. The hook will run after the lock
1389 1389 is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
1390 1390 about available variables.
1391 1391
1392 1392 ``txnclose-phase``
1393 1393 Run after any phase change has been committed. At this point, the
1394 1394 transaction can no longer be rolled back. The hook will run after the lock
1395 1395 is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
1396 1396 available variables.
1397 1397
1398 1398 ``txnabort``
1399 1399 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
1400 1400 for details about available variables.
1401 1401
1402 1402 ``pretxnchangegroup``
1403 1403 Run after a changegroup has been added via push, pull or unbundle, but before
1404 1404 the transaction has been committed. The changegroup is visible to the hook
1405 1405 program. This allows validation of incoming changes before accepting them.
1406 1406 The ID of the first new changeset is in ``$HG_NODE`` and last is in
1407 1407 ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
1408 1408 status will cause the transaction to be rolled back, and the push, pull or
1409 1409 unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
1410 1410
1411 1411 ``pretxncommit``
1412 1412 Run after a changeset has been created, but before the transaction is
1413 1413 committed. The changeset is visible to the hook program. This allows
1414 1414 validation of the commit message and changes. Exit status 0 allows the
1415 1415 commit to proceed. A non-zero status will cause the transaction to
1416 1416 be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
1417 1417 changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1418 1418
1419 1419 ``preupdate``
1420 1420 Run before updating the working directory. Exit status 0 allows
1421 1421 the update to proceed. A non-zero status will prevent the update.
1422 1422 The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
1423 1423 merge, the ID of second new parent is in ``$HG_PARENT2``.
1424 1424
1425 1425 ``listkeys``
1426 1426 Run after listing pushkeys (like bookmarks) in the repository. The
1427 1427 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
1428 1428 dictionary containing the keys and values.
1429 1429
1430 1430 ``pushkey``
1431 1431 Run after a pushkey (like a bookmark) is added to the
1432 1432 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
1433 1433 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
1434 1434 value is in ``$HG_NEW``.
1435 1435
1436 1436 ``tag``
1437 1437 Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
1438 1438 The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
1439 1439 the repository if ``$HG_LOCAL=0``.
1440 1440
1441 1441 ``update``
1442 1442 Run after updating the working directory. The changeset ID of first
1443 1443 new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
1444 1444 parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1445 1445 update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
1446 1446
1447 1447 ``prelock``
1448 1448 run before the store lock is taken, mostly used for test and debug.
1449 1449
1450 1450 ``prewlock``
1451 1451 run before the working copy lock is taken, mostly used for test and debug.
1452 1452
1453 1453 .. note::
1454 1454
1455 1455 It is generally better to use standard hooks rather than the
1456 1456 generic pre- and post- command hooks, as they are guaranteed to be
1457 1457 called in the appropriate contexts for influencing transactions.
1458 1458 Also, hooks like "commit" will be called in all contexts that
1459 1459 generate a commit (e.g. tag) and not just the commit command.
1460 1460
1461 1461 .. note::
1462 1462
1463 1463 Environment variables with empty values may not be passed to
1464 1464 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
1465 1465 will have an empty value under Unix-like platforms for non-merge
1466 1466 changesets, while it will not be available at all under Windows.
1467 1467
1468 1468 The syntax for Python hooks is as follows::
1469 1469
1470 1470 hookname = python:modulename.submodule.callable
1471 1471 hookname = python:/path/to/python/module.py:callable
1472 1472
1473 1473 Python hooks are run within the Mercurial process. Each hook is
1474 1474 called with at least three keyword arguments: a ui object (keyword
1475 1475 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
1476 1476 keyword that tells what kind of hook is used. Arguments listed as
1477 1477 environment variables above are passed as keyword arguments, with no
1478 1478 ``HG_`` prefix, and names in lower case.
1479 1479
1480 1480 If a Python hook returns a "true" value or raises an exception, this
1481 1481 is treated as a failure.
1482 1482
1483 1483
1484 1484 ``hostfingerprints``
1485 1485 --------------------
1486 1486
1487 1487 (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
1488 1488
1489 1489 Fingerprints of the certificates of known HTTPS servers.
1490 1490
1491 1491 A HTTPS connection to a server with a fingerprint configured here will
1492 1492 only succeed if the servers certificate matches the fingerprint.
1493 1493 This is very similar to how ssh known hosts works.
1494 1494
1495 1495 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
1496 1496 Multiple values can be specified (separated by spaces or commas). This can
1497 1497 be used to define both old and new fingerprints while a host transitions
1498 1498 to a new certificate.
1499 1499
1500 1500 The CA chain and web.cacerts is not used for servers with a fingerprint.
1501 1501
1502 1502 For example::
1503 1503
1504 1504 [hostfingerprints]
1505 1505 hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1506 1506 hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1507 1507
1508 1508 ``hostsecurity``
1509 1509 ----------------
1510 1510
1511 1511 Used to specify global and per-host security settings for connecting to
1512 1512 other machines.
1513 1513
1514 1514 The following options control default behavior for all hosts.
1515 1515
1516 1516 ``ciphers``
1517 1517 Defines the cryptographic ciphers to use for connections.
1518 1518
1519 1519 Value must be a valid OpenSSL Cipher List Format as documented at
1520 1520 https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
1521 1521
1522 1522 This setting is for advanced users only. Setting to incorrect values
1523 1523 can significantly lower connection security or decrease performance.
1524 1524 You have been warned.
1525 1525
1526 1526 This option requires Python 2.7.
1527 1527
1528 1528 ``minimumprotocol``
1529 1529 Defines the minimum channel encryption protocol to use.
1530 1530
1531 1531 By default, the highest version of TLS supported by both client and server
1532 1532 is used.
1533 1533
1534 1534 Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
1535 1535
1536 1536 When running on an old Python version, only ``tls1.0`` is allowed since
1537 1537 old versions of Python only support up to TLS 1.0.
1538 1538
1539 1539 When running a Python that supports modern TLS versions, the default is
1540 1540 ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
1541 1541 weakens security and should only be used as a feature of last resort if
1542 1542 a server does not support TLS 1.1+.
1543 1543
1544 1544 Options in the ``[hostsecurity]`` section can have the form
1545 1545 ``hostname``:``setting``. This allows multiple settings to be defined on a
1546 1546 per-host basis.
1547 1547
1548 1548 The following per-host settings can be defined.
1549 1549
1550 1550 ``ciphers``
1551 1551 This behaves like ``ciphers`` as described above except it only applies
1552 1552 to the host on which it is defined.
1553 1553
1554 1554 ``fingerprints``
1555 1555 A list of hashes of the DER encoded peer/remote certificate. Values have
1556 1556 the form ``algorithm``:``fingerprint``. e.g.
1557 1557 ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
1558 1558 In addition, colons (``:``) can appear in the fingerprint part.
1559 1559
1560 1560 The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
1561 1561 ``sha512``.
1562 1562
1563 1563 Use of ``sha256`` or ``sha512`` is preferred.
1564 1564
1565 1565 If a fingerprint is specified, the CA chain is not validated for this
1566 1566 host and Mercurial will require the remote certificate to match one
1567 1567 of the fingerprints specified. This means if the server updates its
1568 1568 certificate, Mercurial will abort until a new fingerprint is defined.
1569 1569 This can provide stronger security than traditional CA-based validation
1570 1570 at the expense of convenience.
1571 1571
1572 1572 This option takes precedence over ``verifycertsfile``.
1573 1573
1574 1574 ``minimumprotocol``
1575 1575 This behaves like ``minimumprotocol`` as described above except it
1576 1576 only applies to the host on which it is defined.
1577 1577
1578 1578 ``verifycertsfile``
1579 1579 Path to file a containing a list of PEM encoded certificates used to
1580 1580 verify the server certificate. Environment variables and ``~user``
1581 1581 constructs are expanded in the filename.
1582 1582
1583 1583 The server certificate or the certificate's certificate authority (CA)
1584 1584 must match a certificate from this file or certificate verification
1585 1585 will fail and connections to the server will be refused.
1586 1586
1587 1587 If defined, only certificates provided by this file will be used:
1588 1588 ``web.cacerts`` and any system/default certificates will not be
1589 1589 used.
1590 1590
1591 1591 This option has no effect if the per-host ``fingerprints`` option
1592 1592 is set.
1593 1593
1594 1594 The format of the file is as follows::
1595 1595
1596 1596 -----BEGIN CERTIFICATE-----
1597 1597 ... (certificate in base64 PEM encoding) ...
1598 1598 -----END CERTIFICATE-----
1599 1599 -----BEGIN CERTIFICATE-----
1600 1600 ... (certificate in base64 PEM encoding) ...
1601 1601 -----END CERTIFICATE-----
1602 1602
1603 1603 For example::
1604 1604
1605 1605 [hostsecurity]
1606 1606 hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
1607 1607 hg2.example.com:fingerprints = sha1:914f1aff87249c09b6859b88b1906d30756491ca, sha1:fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1608 1608 hg3.example.com:fingerprints = sha256:9a:b0:dc:e2:75:ad:8a:b7:84:58:e5:1f:07:32:f1:87:e6:bd:24:22:af:b7:ce:8e:9c:b4:10:cf:b9:f4:0e:d2
1609 1609 foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
1610 1610
1611 1611 To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
1612 1612 when connecting to ``hg.example.com``::
1613 1613
1614 1614 [hostsecurity]
1615 1615 minimumprotocol = tls1.2
1616 1616 hg.example.com:minimumprotocol = tls1.1
1617 1617
1618 1618 ``http_proxy``
1619 1619 --------------
1620 1620
1621 1621 Used to access web-based Mercurial repositories through a HTTP
1622 1622 proxy.
1623 1623
1624 1624 ``host``
1625 1625 Host name and (optional) port of the proxy server, for example
1626 1626 "myproxy:8000".
1627 1627
1628 1628 ``no``
1629 1629 Optional. Comma-separated list of host names that should bypass
1630 1630 the proxy.
1631 1631
1632 1632 ``passwd``
1633 1633 Optional. Password to authenticate with at the proxy server.
1634 1634
1635 1635 ``user``
1636 1636 Optional. User name to authenticate with at the proxy server.
1637 1637
1638 1638 ``always``
1639 1639 Optional. Always use the proxy, even for localhost and any entries
1640 1640 in ``http_proxy.no``. (default: False)
1641 1641
1642 1642 ``http``
1643 1643 --------
1644 1644
1645 1645 Used to configure access to Mercurial repositories via HTTP.
1646 1646
1647 1647 ``timeout``
1648 1648 If set, blocking operations will timeout after that many seconds.
1649 1649 (default: None)
1650 1650
1651 1651 ``merge``
1652 1652 ---------
1653 1653
1654 1654 This section specifies behavior during merges and updates.
1655 1655
1656 1656 ``checkignored``
1657 1657 Controls behavior when an ignored file on disk has the same name as a tracked
1658 1658 file in the changeset being merged or updated to, and has different
1659 1659 contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
1660 1660 abort on such files. With ``warn``, warn on such files and back them up as
1661 1661 ``.orig``. With ``ignore``, don't print a warning and back them up as
1662 1662 ``.orig``. (default: ``abort``)
1663 1663
1664 1664 ``checkunknown``
1665 1665 Controls behavior when an unknown file that isn't ignored has the same name
1666 1666 as a tracked file in the changeset being merged or updated to, and has
1667 1667 different contents. Similar to ``merge.checkignored``, except for files that
1668 1668 are not ignored. (default: ``abort``)
1669 1669
1670 1670 ``on-failure``
1671 1671 When set to ``continue`` (the default), the merge process attempts to
1672 1672 merge all unresolved files using the merge chosen tool, regardless of
1673 1673 whether previous file merge attempts during the process succeeded or not.
1674 1674 Setting this to ``prompt`` will prompt after any merge failure continue
1675 1675 or halt the merge process. Setting this to ``halt`` will automatically
1676 1676 halt the merge process on any merge tool failure. The merge process
1677 1677 can be restarted by using the ``resolve`` command. When a merge is
1678 1678 halted, the repository is left in a normal ``unresolved`` merge state.
1679 1679 (default: ``continue``)
1680 1680
1681 1681 ``strict-capability-check``
1682 1682 Whether capabilities of internal merge tools are checked strictly
1683 1683 or not, while examining rules to decide merge tool to be used.
1684 1684 (default: False)
1685 1685
1686 1686 ``merge-patterns``
1687 1687 ------------------
1688 1688
1689 1689 This section specifies merge tools to associate with particular file
1690 1690 patterns. Tools matched here will take precedence over the default
1691 1691 merge tool. Patterns are globs by default, rooted at the repository
1692 1692 root.
1693 1693
1694 1694 Example::
1695 1695
1696 1696 [merge-patterns]
1697 1697 **.c = kdiff3
1698 1698 **.jpg = myimgmerge
1699 1699
1700 1700 ``merge-tools``
1701 1701 ---------------
1702 1702
1703 1703 This section configures external merge tools to use for file-level
1704 1704 merges. This section has likely been preconfigured at install time.
1705 1705 Use :hg:`config merge-tools` to check the existing configuration.
1706 1706 Also see :hg:`help merge-tools` for more details.
1707 1707
1708 1708 Example ``~/.hgrc``::
1709 1709
1710 1710 [merge-tools]
1711 1711 # Override stock tool location
1712 1712 kdiff3.executable = ~/bin/kdiff3
1713 1713 # Specify command line
1714 1714 kdiff3.args = $base $local $other -o $output
1715 1715 # Give higher priority
1716 1716 kdiff3.priority = 1
1717 1717
1718 1718 # Changing the priority of preconfigured tool
1719 1719 meld.priority = 0
1720 1720
1721 1721 # Disable a preconfigured tool
1722 1722 vimdiff.disabled = yes
1723 1723
1724 1724 # Define new tool
1725 1725 myHtmlTool.args = -m $local $other $base $output
1726 1726 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
1727 1727 myHtmlTool.priority = 1
1728 1728
1729 1729 Supported arguments:
1730 1730
1731 1731 ``priority``
1732 1732 The priority in which to evaluate this tool.
1733 1733 (default: 0)
1734 1734
1735 1735 ``executable``
1736 1736 Either just the name of the executable or its pathname.
1737 1737
1738 1738 .. container:: windows
1739 1739
1740 1740 On Windows, the path can use environment variables with ${ProgramFiles}
1741 1741 syntax.
1742 1742
1743 1743 (default: the tool name)
1744 1744
1745 1745 ``args``
1746 1746 The arguments to pass to the tool executable. You can refer to the
1747 1747 files being merged as well as the output file through these
1748 1748 variables: ``$base``, ``$local``, ``$other``, ``$output``.
1749 1749
1750 1750 The meaning of ``$local`` and ``$other`` can vary depending on which action is
1751 1751 being performed. During an update or merge, ``$local`` represents the original
1752 1752 state of the file, while ``$other`` represents the commit you are updating to or
1753 1753 the commit you are merging with. During a rebase, ``$local`` represents the
1754 1754 destination of the rebase, and ``$other`` represents the commit being rebased.
1755 1755
1756 1756 Some operations define custom labels to assist with identifying the revisions,
1757 1757 accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
1758 1758 labels are not available, these will be ``local``, ``other``, and ``base``,
1759 1759 respectively.
1760 1760 (default: ``$local $base $other``)
1761 1761
1762 1762 ``premerge``
1763 1763 Attempt to run internal non-interactive 3-way merge tool before
1764 1764 launching external tool. Options are ``true``, ``false``, ``keep``,
1765 1765 ``keep-merge3``, or ``keep-mergediff`` (experimental). The ``keep`` option
1766 1766 will leave markers in the file if the premerge fails. The ``keep-merge3``
1767 1767 will do the same but include information about the base of the merge in the
1768 1768 marker (see internal :merge3 in :hg:`help merge-tools`). The
1769 1769 ``keep-mergediff`` option is similar but uses a different marker style
1770 1770 (see internal :merge3 in :hg:`help merge-tools`). (default: True)
1771 1771
1772 1772 ``binary``
1773 1773 This tool can merge binary files. (default: False, unless tool
1774 1774 was selected by file pattern match)
1775 1775
1776 1776 ``symlink``
1777 1777 This tool can merge symlinks. (default: False)
1778 1778
1779 1779 ``check``
1780 1780 A list of merge success-checking options:
1781 1781
1782 1782 ``changed``
1783 1783 Ask whether merge was successful when the merged file shows no changes.
1784 1784 ``conflicts``
1785 1785 Check whether there are conflicts even though the tool reported success.
1786 1786 ``prompt``
1787 1787 Always prompt for merge success, regardless of success reported by tool.
1788 1788
1789 1789 ``fixeol``
1790 1790 Attempt to fix up EOL changes caused by the merge tool.
1791 1791 (default: False)
1792 1792
1793 1793 ``gui``
1794 1794 This tool requires a graphical interface to run. (default: False)
1795 1795
1796 1796 ``mergemarkers``
1797 1797 Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
1798 1798 ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
1799 1799 ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
1800 1800 markers generated during premerge will be ``detailed`` if either this option or
1801 1801 the corresponding option in the ``[ui]`` section is ``detailed``.
1802 1802 (default: ``basic``)
1803 1803
1804 1804 ``mergemarkertemplate``
1805 1805 This setting can be used to override ``mergemarker`` from the
1806 1806 ``[command-templates]`` section on a per-tool basis; this applies to the
1807 1807 ``$label``-prefixed variables and to the conflict markers that are generated
1808 1808 if ``premerge`` is ``keep` or ``keep-merge3``. See the corresponding variable
1809 1809 in ``[ui]`` for more information.
1810 1810
1811 1811 .. container:: windows
1812 1812
1813 1813 ``regkey``
1814 1814 Windows registry key which describes install location of this
1815 1815 tool. Mercurial will search for this key first under
1816 1816 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1817 1817 (default: None)
1818 1818
1819 1819 ``regkeyalt``
1820 1820 An alternate Windows registry key to try if the first key is not
1821 1821 found. The alternate key uses the same ``regname`` and ``regappend``
1822 1822 semantics of the primary key. The most common use for this key
1823 1823 is to search for 32bit applications on 64bit operating systems.
1824 1824 (default: None)
1825 1825
1826 1826 ``regname``
1827 1827 Name of value to read from specified registry key.
1828 1828 (default: the unnamed (default) value)
1829 1829
1830 1830 ``regappend``
1831 1831 String to append to the value read from the registry, typically
1832 1832 the executable name of the tool.
1833 1833 (default: None)
1834 1834
1835 1835 ``pager``
1836 1836 ---------
1837 1837
1838 1838 Setting used to control when to paginate and with what external tool. See
1839 1839 :hg:`help pager` for details.
1840 1840
1841 1841 ``pager``
1842 1842 Define the external tool used as pager.
1843 1843
1844 1844 If no pager is set, Mercurial uses the environment variable $PAGER.
1845 1845 If neither pager.pager, nor $PAGER is set, a default pager will be
1846 1846 used, typically `less` on Unix and `more` on Windows. Example::
1847 1847
1848 1848 [pager]
1849 1849 pager = less -FRX
1850 1850
1851 1851 ``ignore``
1852 1852 List of commands to disable the pager for. Example::
1853 1853
1854 1854 [pager]
1855 1855 ignore = version, help, update
1856 1856
1857 1857 ``patch``
1858 1858 ---------
1859 1859
1860 1860 Settings used when applying patches, for instance through the 'import'
1861 1861 command or with Mercurial Queues extension.
1862 1862
1863 1863 ``eol``
1864 1864 When set to 'strict' patch content and patched files end of lines
1865 1865 are preserved. When set to ``lf`` or ``crlf``, both files end of
1866 1866 lines are ignored when patching and the result line endings are
1867 1867 normalized to either LF (Unix) or CRLF (Windows). When set to
1868 1868 ``auto``, end of lines are again ignored while patching but line
1869 1869 endings in patched files are normalized to their original setting
1870 1870 on a per-file basis. If target file does not exist or has no end
1871 1871 of line, patch line endings are preserved.
1872 1872 (default: strict)
1873 1873
1874 1874 ``fuzz``
1875 1875 The number of lines of 'fuzz' to allow when applying patches. This
1876 1876 controls how much context the patcher is allowed to ignore when
1877 1877 trying to apply a patch.
1878 1878 (default: 2)
1879 1879
1880 1880 ``paths``
1881 1881 ---------
1882 1882
1883 1883 Assigns symbolic names and behavior to repositories.
1884 1884
1885 1885 Options are symbolic names defining the URL or directory that is the
1886 1886 location of the repository. Example::
1887 1887
1888 1888 [paths]
1889 1889 my_server = https://example.com/my_repo
1890 1890 local_path = /home/me/repo
1891 1891
1892 1892 These symbolic names can be used from the command line. To pull
1893 1893 from ``my_server``: :hg:`pull my_server`. To push to ``local_path``:
1894 1894 :hg:`push local_path`. You can check :hg:`help urls` for details about
1895 1895 valid URLs.
1896 1896
1897 1897 Options containing colons (``:``) denote sub-options that can influence
1898 1898 behavior for that specific path. Example::
1899 1899
1900 1900 [paths]
1901 1901 my_server = https://example.com/my_path
1902 1902 my_server:pushurl = ssh://example.com/my_path
1903 1903
1904 1904 Paths using the `path://otherpath` scheme will inherit the sub-options value from
1905 1905 the path they point to.
1906 1906
1907 1907 The following sub-options can be defined:
1908 1908
1909 1909 ``multi-urls``
1910 1910 A boolean option. When enabled the value of the `[paths]` entry will be
1911 1911 parsed as a list and the alias will resolve to multiple destination. If some
1912 1912 of the list entry use the `path://` syntax, the suboption will be inherited
1913 1913 individually.
1914 1914
1915 1915 ``pushurl``
1916 1916 The URL to use for push operations. If not defined, the location
1917 1917 defined by the path's main entry is used.
1918 1918
1919 1919 ``pushrev``
1920 1920 A revset defining which revisions to push by default.
1921 1921
1922 1922 When :hg:`push` is executed without a ``-r`` argument, the revset
1923 1923 defined by this sub-option is evaluated to determine what to push.
1924 1924
1925 1925 For example, a value of ``.`` will push the working directory's
1926 1926 revision by default.
1927 1927
1928 1928 Revsets specifying bookmarks will not result in the bookmark being
1929 1929 pushed.
1930 1930
1931 1931 ``bookmarks.mode``
1932 1932 How bookmark will be dealt during the exchange. It support the following value
1933 1933
1934 1934 - ``default``: the default behavior, local and remote bookmarks are "merged"
1935 1935 on push/pull.
1936 1936
1937 1937 - ``mirror``: when pulling, replace local bookmarks by remote bookmarks. This
1938 1938 is useful to replicate a repository, or as an optimization.
1939 1939
1940 1940 - ``ignore``: ignore bookmarks during exchange.
1941 1941 (This currently only affect pulling)
1942 1942
1943 1943 .. container:: verbose
1944 1944
1945 1945 ``pulled-delta-reuse-policy``
1946 1946 Control the policy regarding deltas sent by the remote during pulls.
1947 1947
1948 1948 This is an advanced option that non-admin users should not need to understand
1949 1949 or set. This option can be used to speed up pulls from trusted central
1950 1950 servers, or to fix-up deltas from older servers.
1951 1951
1952 1952 It supports the following values:
1953 1953
1954 1954 - ``default``: use the policy defined by
1955 1955 `storage.revlog.reuse-external-delta-parent`,
1956 1956
1957 1957 - ``no-reuse``: start a new optimal delta search for each new revision we add
1958 1958 to the repository. The deltas from the server will be reused when the base
1959 1959 it applies to is tested (this can be frequent if that base is the one and
1960 1960 unique parent of that revision). This can significantly slowdown pulls but
1961 1961 will result in an optimized storage space if the remote peer is sending poor
1962 1962 quality deltas.
1963 1963
1964 1964 - ``try-base``: try to reuse the deltas from the remote peer as long as they
1965 1965 create a valid delta-chain in the local repository. This speeds up the
1966 1966 unbundling process, but can result in sub-optimal storage space if the
1967 1967 remote peer is sending poor quality deltas.
1968 1968
1969 1969 - ``forced``: the deltas from the peer will be reused in all cases, even if
1970 1970 the resulting delta-chain is "invalid". This setting will ensure the bundle
1971 1971 is applied at minimal CPU cost, but it can result in longer delta chains
1972 1972 being created on the client, making revisions potentially slower to access
1973 1973 in the future. If you think you need this option, you should make sure you
1974 1974 are also talking to the Mercurial developer community to get confirmation.
1975 1975
1976 1976 See `hg help config.storage.revlog.reuse-external-delta-parent` for a similar
1977 1977 global option. That option defines the behavior of `default`.
1978 1978
1979 1979 The following special named paths exist:
1980 1980
1981 1981 ``default``
1982 1982 The URL or directory to use when no source or remote is specified.
1983 1983
1984 1984 :hg:`clone` will automatically define this path to the location the
1985 1985 repository was cloned from.
1986 1986
1987 1987 ``default-push``
1988 1988 (deprecated) The URL or directory for the default :hg:`push` location.
1989 1989 ``default:pushurl`` should be used instead.
1990 1990
1991 1991 ``phases``
1992 1992 ----------
1993 1993
1994 1994 Specifies default handling of phases. See :hg:`help phases` for more
1995 1995 information about working with phases.
1996 1996
1997 1997 ``publish``
1998 1998 Controls draft phase behavior when working as a server. When true,
1999 1999 pushed changesets are set to public in both client and server and
2000 2000 pulled or cloned changesets are set to public in the client.
2001 2001 (default: True)
2002 2002
2003 2003 ``new-commit``
2004 2004 Phase of newly-created commits.
2005 2005 (default: draft)
2006 2006
2007 2007 ``checksubrepos``
2008 2008 Check the phase of the current revision of each subrepository. Allowed
2009 2009 values are "ignore", "follow" and "abort". For settings other than
2010 2010 "ignore", the phase of the current revision of each subrepository is
2011 2011 checked before committing the parent repository. If any of those phases is
2012 2012 greater than the phase of the parent repository (e.g. if a subrepo is in a
2013 2013 "secret" phase while the parent repo is in "draft" phase), the commit is
2014 2014 either aborted (if checksubrepos is set to "abort") or the higher phase is
2015 2015 used for the parent repository commit (if set to "follow").
2016 2016 (default: follow)
2017 2017
2018 2018
2019 2019 ``profiling``
2020 2020 -------------
2021 2021
2022 2022 Specifies profiling type, format, and file output. Two profilers are
2023 2023 supported: an instrumenting profiler (named ``ls``), and a sampling
2024 2024 profiler (named ``stat``).
2025 2025
2026 2026 In this section description, 'profiling data' stands for the raw data
2027 2027 collected during profiling, while 'profiling report' stands for a
2028 2028 statistical text report generated from the profiling data.
2029 2029
2030 2030 ``enabled``
2031 2031 Enable the profiler.
2032 2032 (default: false)
2033 2033
2034 2034 This is equivalent to passing ``--profile`` on the command line.
2035 2035
2036 2036 ``type``
2037 2037 The type of profiler to use.
2038 2038 (default: stat)
2039 2039
2040 2040 ``ls``
2041 2041 Use Python's built-in instrumenting profiler. This profiler
2042 2042 works on all platforms, but each line number it reports is the
2043 2043 first line of a function. This restriction makes it difficult to
2044 2044 identify the expensive parts of a non-trivial function.
2045 2045 ``stat``
2046 2046 Use a statistical profiler, statprof. This profiler is most
2047 2047 useful for profiling commands that run for longer than about 0.1
2048 2048 seconds.
2049 ``py-spy``
2050 use the py-spy profiler. A external py-spy executable must be available.
2051 (Make sure to check `profiling.output` config to write the result.)
2049 2052
2050 2053 ``format``
2051 2054 Profiling format. Specific to the ``ls`` instrumenting profiler.
2052 2055 (default: text)
2053 2056
2054 2057 ``text``
2055 2058 Generate a profiling report. When saving to a file, it should be
2056 2059 noted that only the report is saved, and the profiling data is
2057 2060 not kept.
2058 2061 ``kcachegrind``
2059 2062 Format profiling data for kcachegrind use: when saving to a
2060 2063 file, the generated file can directly be loaded into
2061 2064 kcachegrind.
2062 2065
2063 2066 ``statformat``
2064 2067 Profiling format for the ``stat`` profiler.
2065 2068 (default: hotpath)
2066 2069
2067 2070 ``hotpath``
2068 2071 Show a tree-based display containing the hot path of execution (where
2069 2072 most time was spent).
2070 2073 ``bymethod``
2071 2074 Show a table of methods ordered by how frequently they are active.
2072 2075 ``byline``
2073 2076 Show a table of lines in files ordered by how frequently they are active.
2074 2077 ``json``
2075 2078 Render profiling data as JSON.
2076 2079
2077 2080 ``freq``
2078 2081 Sampling frequency. Specific to the ``stat`` sampling profiler.
2079 2082 (default: 1000)
2080 2083
2081 2084 ``output``
2082 2085 File path where profiling data or report should be saved. If the
2083 2086 file exists, it is replaced. (default: None, data is printed on
2084 2087 stderr)
2085 2088
2086 2089 ``sort``
2087 2090 Sort field. Specific to the ``ls`` instrumenting profiler.
2088 2091 One of ``callcount``, ``reccallcount``, ``totaltime`` and
2089 2092 ``inlinetime``.
2090 2093 (default: inlinetime)
2091 2094
2092 2095 ``time-track``
2093 2096 Control if the stat profiler track ``cpu`` or ``real`` time.
2094 2097 (default: ``cpu`` on Windows, otherwise ``real``)
2095 2098
2096 2099 ``limit``
2097 2100 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
2098 2101 (default: 30)
2099 2102
2100 2103 ``nested``
2101 2104 Show at most this number of lines of drill-down info after each main entry.
2102 2105 This can help explain the difference between Total and Inline.
2103 2106 Specific to the ``ls`` instrumenting profiler.
2104 2107 (default: 0)
2105 2108
2106 2109 ``showmin``
2107 2110 Minimum fraction of samples an entry must have for it to be displayed.
2108 2111 Can be specified as a float between ``0.0`` and ``1.0`` or can have a
2109 2112 ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
2110 2113
2111 2114 Only used by the ``stat`` profiler.
2112 2115
2113 2116 For the ``hotpath`` format, default is ``0.05``.
2114 2117 For the ``chrome`` format, default is ``0.005``.
2115 2118
2116 2119 The option is unused on other formats.
2117 2120
2118 2121 ``showmax``
2119 2122 Maximum fraction of samples an entry can have before it is ignored in
2120 2123 display. Values format is the same as ``showmin``.
2121 2124
2122 2125 Only used by the ``stat`` profiler.
2123 2126
2124 2127 For the ``chrome`` format, default is ``0.999``.
2125 2128
2126 2129 The option is unused on other formats.
2127 2130
2128 2131 ``showtime``
2129 2132 Show time taken as absolute durations, in addition to percentages.
2130 2133 Only used by the ``hotpath`` format.
2131 2134 (default: true)
2132 2135
2133 2136 ``progress``
2134 2137 ------------
2135 2138
2136 2139 Mercurial commands can draw progress bars that are as informative as
2137 2140 possible. Some progress bars only offer indeterminate information, while others
2138 2141 have a definite end point.
2139 2142
2140 2143 ``debug``
2141 2144 Whether to print debug info when updating the progress bar. (default: False)
2142 2145
2143 2146 ``delay``
2144 2147 Number of seconds (float) before showing the progress bar. (default: 3)
2145 2148
2146 2149 ``changedelay``
2147 2150 Minimum delay before showing a new topic. When set to less than 3 * refresh,
2148 2151 that value will be used instead. (default: 1)
2149 2152
2150 2153 ``estimateinterval``
2151 2154 Maximum sampling interval in seconds for speed and estimated time
2152 2155 calculation. (default: 60)
2153 2156
2154 2157 ``refresh``
2155 2158 Time in seconds between refreshes of the progress bar. (default: 0.1)
2156 2159
2157 2160 ``format``
2158 2161 Format of the progress bar.
2159 2162
2160 2163 Valid entries for the format field are ``topic``, ``bar``, ``number``,
2161 2164 ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
2162 2165 last 20 characters of the item, but this can be changed by adding either
2163 2166 ``-<num>`` which would take the last num characters, or ``+<num>`` for the
2164 2167 first num characters.
2165 2168
2166 2169 (default: topic bar number estimate)
2167 2170
2168 2171 ``width``
2169 2172 If set, the maximum width of the progress information (that is, min(width,
2170 2173 term width) will be used).
2171 2174
2172 2175 ``clear-complete``
2173 2176 Clear the progress bar after it's done. (default: True)
2174 2177
2175 2178 ``disable``
2176 2179 If true, don't show a progress bar.
2177 2180
2178 2181 ``assume-tty``
2179 2182 If true, ALWAYS show a progress bar, unless disable is given.
2180 2183
2181 2184 ``rebase``
2182 2185 ----------
2183 2186
2184 2187 ``evolution.allowdivergence``
2185 2188 Default to False, when True allow creating divergence when performing
2186 2189 rebase of obsolete changesets.
2187 2190
2188 2191 ``revsetalias``
2189 2192 ---------------
2190 2193
2191 2194 Alias definitions for revsets. See :hg:`help revsets` for details.
2192 2195
2193 2196 ``rewrite``
2194 2197 -----------
2195 2198
2196 2199 ``backup-bundle``
2197 2200 Whether to save stripped changesets to a bundle file. (default: True)
2198 2201
2199 2202 ``update-timestamp``
2200 2203 If true, updates the date and time of the changeset to current. It is only
2201 2204 applicable for `hg amend`, `hg commit --amend` and `hg uncommit` in the
2202 2205 current version.
2203 2206
2204 2207 ``empty-successor``
2205 2208
2206 2209 Control what happens with empty successors that are the result of rewrite
2207 2210 operations. If set to ``skip``, the successor is not created. If set to
2208 2211 ``keep``, the empty successor is created and kept.
2209 2212
2210 2213 Currently, only the rebase and absorb commands consider this configuration.
2211 2214 (EXPERIMENTAL)
2212 2215
2213 2216 ``rhg``
2214 2217 -------
2215 2218
2216 2219 The pure Rust fast-path for Mercurial. See `rust/README.rst` in the Mercurial repository.
2217 2220
2218 2221 ``fallback-executable``
2219 2222 Path to the executable to run in a sub-process when falling back to
2220 2223 another implementation of Mercurial.
2221 2224
2222 2225 ``fallback-immediately``
2223 2226 Fall back to ``fallback-executable`` as soon as possible, regardless of
2224 2227 the `rhg.on-unsupported` configuration. Useful for debugging, for example to
2225 2228 bypass `rhg` if the deault `hg` points to `rhg`.
2226 2229
2227 2230 Note that because this requires loading the configuration, it is possible
2228 2231 that `rhg` error out before being able to fall back.
2229 2232
2230 2233 ``ignored-extensions``
2231 2234 Controls which extensions should be ignored by `rhg`. By default, `rhg`
2232 2235 triggers the `rhg.on-unsupported` behavior any unsupported extensions.
2233 2236 Users can disable that behavior when they know that a given extension
2234 2237 does not need support from `rhg`.
2235 2238
2236 2239 Expects a list of extension names, or ``*`` to ignore all extensions.
2237 2240
2238 2241 Note: ``*:<suboption>`` is also a valid extension name for this
2239 2242 configuration option.
2240 2243 As of this writing, the only valid "global" suboption is ``required``.
2241 2244
2242 2245 ``on-unsupported``
2243 2246 Controls the behavior of `rhg` when detecting unsupported features.
2244 2247
2245 2248 Possible values are `abort` (default), `abort-silent` and `fallback`.
2246 2249
2247 2250 ``abort``
2248 2251 Print an error message describing what feature is not supported,
2249 2252 and exit with code 252
2250 2253
2251 2254 ``abort-silent``
2252 2255 Silently exit with code 252
2253 2256
2254 2257 ``fallback``
2255 2258 Try running the fallback executable with the same parameters
2256 2259 (and trace the fallback reason, use `RUST_LOG=trace` to see).
2257 2260
2258 2261 ``share``
2259 2262 ---------
2260 2263
2261 2264 ``safe-mismatch.source-safe``
2262 2265 Controls what happens when the shared repository does not use the
2263 2266 share-safe mechanism but its source repository does.
2264 2267
2265 2268 Possible values are `abort` (default), `allow`, `upgrade-abort` and
2266 2269 `upgrade-allow`.
2267 2270
2268 2271 ``abort``
2269 2272 Disallows running any command and aborts
2270 2273 ``allow``
2271 2274 Respects the feature presence in the share source
2272 2275 ``upgrade-abort``
2273 2276 Tries to upgrade the share to use share-safe; if it fails, aborts
2274 2277 ``upgrade-allow``
2275 2278 Tries to upgrade the share; if it fails, continue by
2276 2279 respecting the share source setting
2277 2280
2278 2281 Check :hg:`help config.format.use-share-safe` for details about the
2279 2282 share-safe feature.
2280 2283
2281 2284 ``safe-mismatch.source-safe:verbose-upgrade``
2282 2285 Display a message when upgrading, (default: True)
2283 2286
2284 2287 ``safe-mismatch.source-safe.warn``
2285 2288 Shows a warning on operations if the shared repository does not use
2286 2289 share-safe, but the source repository does.
2287 2290 (default: True)
2288 2291
2289 2292 ``safe-mismatch.source-not-safe``
2290 2293 Controls what happens when the shared repository uses the share-safe
2291 2294 mechanism but its source does not.
2292 2295
2293 2296 Possible values are `abort` (default), `allow`, `downgrade-abort` and
2294 2297 `downgrade-allow`.
2295 2298
2296 2299 ``abort``
2297 2300 Disallows running any command and aborts
2298 2301 ``allow``
2299 2302 Respects the feature presence in the share source
2300 2303 ``downgrade-abort``
2301 2304 Tries to downgrade the share to not use share-safe; if it fails, aborts
2302 2305 ``downgrade-allow``
2303 2306 Tries to downgrade the share to not use share-safe;
2304 2307 if it fails, continue by respecting the shared source setting
2305 2308
2306 2309 Check :hg:`help config.format.use-share-safe` for details about the
2307 2310 share-safe feature.
2308 2311
2309 2312 ``safe-mismatch.source-not-safe:verbose-upgrade``
2310 2313 Display a message when upgrading, (default: True)
2311 2314
2312 2315 ``safe-mismatch.source-not-safe.warn``
2313 2316 Shows a warning on operations if the shared repository uses share-safe,
2314 2317 but the source repository does not.
2315 2318 (default: True)
2316 2319
2317 2320 ``storage``
2318 2321 -----------
2319 2322
2320 2323 Control the strategy Mercurial uses internally to store history. Options in this
2321 2324 category impact performance and repository size.
2322 2325
2323 2326 ``revlog.issue6528.fix-incoming``
2324 2327 Version 5.8 of Mercurial had a bug leading to altering the parent of file
2325 2328 revision with copy information (or any other metadata) on exchange. This
2326 2329 leads to the copy metadata to be overlooked by various internal logic. The
2327 2330 issue was fixed in Mercurial 5.8.1.
2328 2331 (See https://bz.mercurial-scm.org/show_bug.cgi?id=6528 for details)
2329 2332
2330 2333 As a result Mercurial is now checking and fixing incoming file revisions to
2331 2334 make sure there parents are in the right order. This behavior can be
2332 2335 disabled by setting this option to `no`. This apply to revisions added
2333 2336 through push, pull, clone and unbundle.
2334 2337
2335 2338 To fix affected revisions that already exist within the repository, one can
2336 2339 use :hg:`debug-repair-issue-6528`.
2337 2340
2338 2341 .. container:: verbose
2339 2342
2340 2343 ``revlog.delta-parent-search.candidate-group-chunk-size``
2341 2344 Tune the number of delta bases the storage will consider in the
2342 2345 same "round" of search. In some very rare cases, using a smaller value
2343 2346 might result in faster processing at the possible expense of storage
2344 2347 space, while using larger values might result in slower processing at the
2345 2348 possible benefit of storage space. A value of "0" means no limitation.
2346 2349
2347 2350 default: no limitation
2348 2351
2349 2352 This is unlikely that you'll have to tune this configuration. If you think
2350 2353 you do, consider talking with the mercurial developer community about your
2351 2354 repositories.
2352 2355
2353 2356 ``revlog.mmap.index``
2354 2357 Whether to use the Operating System "memory mapping" feature (when
2355 2358 possible) to access the revlog index. This improves performance
2356 2359 and reduces memory pressure.
2357 2360
2358 2361 .. container:: verbose
2359 2362
2360 2363 ``revlog.mmap.index:size-threshold``
2361 2364
2362 2365 The size of index above which to use the "memory mapping" feature.
2363 2366
2364 2367 ``revlog.optimize-delta-parent-choice``
2365 2368 When storing a merge revision, both parents will be equally considered as
2366 2369 a possible delta base. This results in better delta selection and improved
2367 2370 revlog compression. This option is enabled by default.
2368 2371
2369 2372 Turning this option off can result in large increase of repository size for
2370 2373 repository with many merges.
2371 2374
2372 2375 ``revlog.persistent-nodemap.mmap``
2373 2376 Whether to use the Operating System "memory mapping" feature (when
2374 2377 possible) to access the persistent nodemap data. This improve performance
2375 2378 and reduce memory pressure.
2376 2379
2377 2380 Default to True.
2378 2381
2379 2382 For details on the "persistent-nodemap" feature, see:
2380 2383 :hg:`help config.format.use-persistent-nodemap`.
2381 2384
2382 2385 ``revlog.persistent-nodemap.slow-path``
2383 2386 Control the behavior of Merucrial when using a repository with "persistent"
2384 2387 nodemap with an installation of Mercurial without a fast implementation for
2385 2388 the feature:
2386 2389
2387 2390 ``allow``: Silently use the slower implementation to access the repository.
2388 2391 ``warn``: Warn, but use the slower implementation to access the repository.
2389 2392 ``abort``: Prevent access to such repositories. (This is the default)
2390 2393
2391 2394 For details on the "persistent-nodemap" feature, see:
2392 2395 :hg:`help config.format.use-persistent-nodemap`.
2393 2396
2394 2397 ``revlog.reuse-external-delta-parent``
2395 2398 Control the order in which delta parents are considered when adding new
2396 2399 revisions from an external source.
2397 2400 (typically: apply bundle from `hg pull` or `hg push`).
2398 2401
2399 2402 New revisions are usually provided as a delta against other revisions. By
2400 2403 default, Mercurial will try to reuse this delta first, therefore using the
2401 2404 same "delta parent" as the source. Directly using delta's from the source
2402 2405 reduces CPU usage and usually speeds up operation. However, in some case,
2403 2406 the source might have sub-optimal delta bases and forcing their reevaluation
2404 2407 is useful. For example, pushes from an old client could have sub-optimal
2405 2408 delta's parent that the server want to optimize. (lack of general delta, bad
2406 2409 parents, choice, lack of sparse-revlog, etc).
2407 2410
2408 2411 This option is enabled by default. Turning it off will ensure bad delta
2409 2412 parent choices from older client do not propagate to this repository, at
2410 2413 the cost of a small increase in CPU consumption.
2411 2414
2412 2415 Note: this option only control the order in which delta parents are
2413 2416 considered. Even when disabled, the existing delta from the source will be
2414 2417 reused if the same delta parent is selected.
2415 2418
2416 2419 ``revlog.reuse-external-delta``
2417 2420 Control the reuse of delta from external source.
2418 2421 (typically: apply bundle from `hg pull` or `hg push`).
2419 2422
2420 2423 New revisions are usually provided as a delta against another revision. By
2421 2424 default, Mercurial will not recompute the same delta again, trusting
2422 2425 externally provided deltas. There have been rare cases of small adjustment
2423 2426 to the diffing algorithm in the past. So in some rare case, recomputing
2424 2427 delta provided by ancient clients can provides better results. Disabling
2425 2428 this option means going through a full delta recomputation for all incoming
2426 2429 revisions. It means a large increase in CPU usage and will slow operations
2427 2430 down.
2428 2431
2429 2432 This option is enabled by default. When disabled, it also disables the
2430 2433 related ``storage.revlog.reuse-external-delta-parent`` option.
2431 2434
2432 2435 ``revlog.zlib.level``
2433 2436 Zlib compression level used when storing data into the repository. Accepted
2434 2437 Value range from 1 (lowest compression) to 9 (highest compression). Zlib
2435 2438 default value is 6.
2436 2439
2437 2440
2438 2441 ``revlog.zstd.level``
2439 2442 zstd compression level used when storing data into the repository. Accepted
2440 2443 Value range from 1 (lowest compression) to 22 (highest compression).
2441 2444 (default 3)
2442 2445
2443 2446 ``server``
2444 2447 ----------
2445 2448
2446 2449 Controls generic server settings.
2447 2450
2448 2451 ``bookmarks-pushkey-compat``
2449 2452 Trigger pushkey hook when being pushed bookmark updates. This config exist
2450 2453 for compatibility purpose (default to True)
2451 2454
2452 2455 If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
2453 2456 movement we recommend you migrate them to ``txnclose-bookmark`` and
2454 2457 ``pretxnclose-bookmark``.
2455 2458
2456 2459 ``compressionengines``
2457 2460 List of compression engines and their relative priority to advertise
2458 2461 to clients.
2459 2462
2460 2463 The order of compression engines determines their priority, the first
2461 2464 having the highest priority. If a compression engine is not listed
2462 2465 here, it won't be advertised to clients.
2463 2466
2464 2467 If not set (the default), built-in defaults are used. Run
2465 2468 :hg:`debuginstall` to list available compression engines and their
2466 2469 default wire protocol priority.
2467 2470
2468 2471 Older Mercurial clients only support zlib compression and this setting
2469 2472 has no effect for legacy clients.
2470 2473
2471 2474 ``uncompressed``
2472 2475 Whether to allow clients to clone a repository using the
2473 2476 uncompressed streaming protocol. This transfers about 40% more
2474 2477 data than a regular clone, but uses less memory and CPU on both
2475 2478 server and client. Over a LAN (100 Mbps or better) or a very fast
2476 2479 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
2477 2480 regular clone. Over most WAN connections (anything slower than
2478 2481 about 6 Mbps), uncompressed streaming is slower, because of the
2479 2482 extra data transfer overhead. This mode will also temporarily hold
2480 2483 the write lock while determining what data to transfer.
2481 2484 (default: True)
2482 2485
2483 2486 ``uncompressedallowsecret``
2484 2487 Whether to allow stream clones when the repository contains secret
2485 2488 changesets. (default: False)
2486 2489
2487 2490 ``preferuncompressed``
2488 2491 When set, clients will try to use the uncompressed streaming
2489 2492 protocol. (default: False)
2490 2493
2491 2494 ``disablefullbundle``
2492 2495 When set, servers will refuse attempts to do pull-based clones.
2493 2496 If this option is set, ``preferuncompressed`` and/or clone bundles
2494 2497 are highly recommended. Partial clones will still be allowed.
2495 2498 (default: False)
2496 2499
2497 2500 ``streamunbundle``
2498 2501 When set, servers will apply data sent from the client directly,
2499 2502 otherwise it will be written to a temporary file first. This option
2500 2503 effectively prevents concurrent pushes.
2501 2504
2502 2505 ``pullbundle``
2503 2506 When set, the server will check pullbundles.manifest for bundles
2504 2507 covering the requested heads and common nodes. The first matching
2505 2508 entry will be streamed to the client.
2506 2509
2507 2510 For HTTP transport, the stream will still use zlib compression
2508 2511 for older clients.
2509 2512
2510 2513 ``concurrent-push-mode``
2511 2514 Level of allowed race condition between two pushing clients.
2512 2515
2513 2516 - 'strict': push is abort if another client touched the repository
2514 2517 while the push was preparing.
2515 2518 - 'check-related': push is only aborted if it affects head that got also
2516 2519 affected while the push was preparing. (default since 5.4)
2517 2520
2518 2521 'check-related' only takes effect for compatible clients (version
2519 2522 4.3 and later). Older clients will use 'strict'.
2520 2523
2521 2524 ``validate``
2522 2525 Whether to validate the completeness of pushed changesets by
2523 2526 checking that all new file revisions specified in manifests are
2524 2527 present. (default: False)
2525 2528
2526 2529 ``maxhttpheaderlen``
2527 2530 Instruct HTTP clients not to send request headers longer than this
2528 2531 many bytes. (default: 1024)
2529 2532
2530 2533 ``bundle1``
2531 2534 Whether to allow clients to push and pull using the legacy bundle1
2532 2535 exchange format. (default: True)
2533 2536
2534 2537 ``bundle1gd``
2535 2538 Like ``bundle1`` but only used if the repository is using the
2536 2539 *generaldelta* storage format. (default: True)
2537 2540
2538 2541 ``bundle1.push``
2539 2542 Whether to allow clients to push using the legacy bundle1 exchange
2540 2543 format. (default: True)
2541 2544
2542 2545 ``bundle1gd.push``
2543 2546 Like ``bundle1.push`` but only used if the repository is using the
2544 2547 *generaldelta* storage format. (default: True)
2545 2548
2546 2549 ``bundle1.pull``
2547 2550 Whether to allow clients to pull using the legacy bundle1 exchange
2548 2551 format. (default: True)
2549 2552
2550 2553 ``bundle1gd.pull``
2551 2554 Like ``bundle1.pull`` but only used if the repository is using the
2552 2555 *generaldelta* storage format. (default: True)
2553 2556
2554 2557 Large repositories using the *generaldelta* storage format should
2555 2558 consider setting this option because converting *generaldelta*
2556 2559 repositories to the exchange format required by the bundle1 data
2557 2560 format can consume a lot of CPU.
2558 2561
2559 2562 ``bundle2.stream``
2560 2563 Whether to allow clients to pull using the bundle2 streaming protocol.
2561 2564 (default: True)
2562 2565
2563 2566 ``zliblevel``
2564 2567 Integer between ``-1`` and ``9`` that controls the zlib compression level
2565 2568 for wire protocol commands that send zlib compressed output (notably the
2566 2569 commands that send repository history data).
2567 2570
2568 2571 The default (``-1``) uses the default zlib compression level, which is
2569 2572 likely equivalent to ``6``. ``0`` means no compression. ``9`` means
2570 2573 maximum compression.
2571 2574
2572 2575 Setting this option allows server operators to make trade-offs between
2573 2576 bandwidth and CPU used. Lowering the compression lowers CPU utilization
2574 2577 but sends more bytes to clients.
2575 2578
2576 2579 This option only impacts the HTTP server.
2577 2580
2578 2581 ``zstdlevel``
2579 2582 Integer between ``1`` and ``22`` that controls the zstd compression level
2580 2583 for wire protocol commands. ``1`` is the minimal amount of compression and
2581 2584 ``22`` is the highest amount of compression.
2582 2585
2583 2586 The default (``3``) should be significantly faster than zlib while likely
2584 2587 delivering better compression ratios.
2585 2588
2586 2589 This option only impacts the HTTP server.
2587 2590
2588 2591 See also ``server.zliblevel``.
2589 2592
2590 2593 ``view``
2591 2594 Repository filter used when exchanging revisions with the peer.
2592 2595
2593 2596 The default view (``served``) excludes secret and hidden changesets.
2594 2597 Another useful value is ``immutable`` (no draft, secret or hidden
2595 2598 changesets). (EXPERIMENTAL)
2596 2599
2597 2600 ``smtp``
2598 2601 --------
2599 2602
2600 2603 Configuration for extensions that need to send email messages.
2601 2604
2602 2605 ``host``
2603 2606 Host name of mail server, e.g. "mail.example.com".
2604 2607
2605 2608 ``port``
2606 2609 Optional. Port to connect to on mail server. (default: 465 if
2607 2610 ``tls`` is smtps; 25 otherwise)
2608 2611
2609 2612 ``tls``
2610 2613 Optional. Method to enable TLS when connecting to mail server: starttls,
2611 2614 smtps or none. (default: none)
2612 2615
2613 2616 ``username``
2614 2617 Optional. User name for authenticating with the SMTP server.
2615 2618 (default: None)
2616 2619
2617 2620 ``password``
2618 2621 Optional. Password for authenticating with the SMTP server. If not
2619 2622 specified, interactive sessions will prompt the user for a
2620 2623 password; non-interactive sessions will fail. (default: None)
2621 2624
2622 2625 ``local_hostname``
2623 2626 Optional. The hostname that the sender can use to identify
2624 2627 itself to the MTA.
2625 2628
2626 2629
2627 2630 ``subpaths``
2628 2631 ------------
2629 2632
2630 2633 Subrepository source URLs can go stale if a remote server changes name
2631 2634 or becomes temporarily unavailable. This section lets you define
2632 2635 rewrite rules of the form::
2633 2636
2634 2637 <pattern> = <replacement>
2635 2638
2636 2639 where ``pattern`` is a regular expression matching a subrepository
2637 2640 source URL and ``replacement`` is the replacement string used to
2638 2641 rewrite it. Groups can be matched in ``pattern`` and referenced in
2639 2642 ``replacements``. For instance::
2640 2643
2641 2644 http://server/(.*)-hg/ = http://hg.server/\1/
2642 2645
2643 2646 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
2644 2647
2645 2648 Relative subrepository paths are first made absolute, and the
2646 2649 rewrite rules are then applied on the full (absolute) path. If ``pattern``
2647 2650 doesn't match the full path, an attempt is made to apply it on the
2648 2651 relative path alone. The rules are applied in definition order.
2649 2652
2650 2653 ``subrepos``
2651 2654 ------------
2652 2655
2653 2656 This section contains options that control the behavior of the
2654 2657 subrepositories feature. See also :hg:`help subrepos`.
2655 2658
2656 2659 Security note: auditing in Mercurial is known to be insufficient to
2657 2660 prevent clone-time code execution with carefully constructed Git
2658 2661 subrepos. It is unknown if a similar detect is present in Subversion
2659 2662 subrepos. Both Git and Subversion subrepos are disabled by default
2660 2663 out of security concerns. These subrepo types can be enabled using
2661 2664 the respective options below.
2662 2665
2663 2666 ``allowed``
2664 2667 Whether subrepositories are allowed in the working directory.
2665 2668
2666 2669 When false, commands involving subrepositories (like :hg:`update`)
2667 2670 will fail for all subrepository types.
2668 2671 (default: true)
2669 2672
2670 2673 ``hg:allowed``
2671 2674 Whether Mercurial subrepositories are allowed in the working
2672 2675 directory. This option only has an effect if ``subrepos.allowed``
2673 2676 is true.
2674 2677 (default: true)
2675 2678
2676 2679 ``git:allowed``
2677 2680 Whether Git subrepositories are allowed in the working directory.
2678 2681 This option only has an effect if ``subrepos.allowed`` is true.
2679 2682
2680 2683 See the security note above before enabling Git subrepos.
2681 2684 (default: false)
2682 2685
2683 2686 ``svn:allowed``
2684 2687 Whether Subversion subrepositories are allowed in the working
2685 2688 directory. This option only has an effect if ``subrepos.allowed``
2686 2689 is true.
2687 2690
2688 2691 See the security note above before enabling Subversion subrepos.
2689 2692 (default: false)
2690 2693
2691 2694 ``templatealias``
2692 2695 -----------------
2693 2696
2694 2697 Alias definitions for templates. See :hg:`help templates` for details.
2695 2698
2696 2699 ``templates``
2697 2700 -------------
2698 2701
2699 2702 Use the ``[templates]`` section to define template strings.
2700 2703 See :hg:`help templates` for details.
2701 2704
2702 2705 ``trusted``
2703 2706 -----------
2704 2707
2705 2708 Mercurial will not use the settings in the
2706 2709 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
2707 2710 user or to a trusted group, as various hgrc features allow arbitrary
2708 2711 commands to be run. This issue is often encountered when configuring
2709 2712 hooks or extensions for shared repositories or servers. However,
2710 2713 the web interface will use some safe settings from the ``[web]``
2711 2714 section.
2712 2715
2713 2716 This section specifies what users and groups are trusted. The
2714 2717 current user is always trusted. To trust everybody, list a user or a
2715 2718 group with name ``*``. These settings must be placed in an
2716 2719 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
2717 2720 user or service running Mercurial.
2718 2721
2719 2722 ``users``
2720 2723 Comma-separated list of trusted users.
2721 2724
2722 2725 ``groups``
2723 2726 Comma-separated list of trusted groups.
2724 2727
2725 2728
2726 2729 ``ui``
2727 2730 ------
2728 2731
2729 2732 User interface controls.
2730 2733
2731 2734 ``archivemeta``
2732 2735 Whether to include the .hg_archival.txt file containing meta data
2733 2736 (hashes for the repository base and for tip) in archives created
2734 2737 by the :hg:`archive` command or downloaded via hgweb.
2735 2738 (default: True)
2736 2739
2737 2740 ``askusername``
2738 2741 Whether to prompt for a username when committing. If True, and
2739 2742 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
2740 2743 be prompted to enter a username. If no username is entered, the
2741 2744 default ``USER@HOST`` is used instead.
2742 2745 (default: False)
2743 2746
2744 2747 ``clonebundles``
2745 2748 Whether the "clone bundles" feature is enabled.
2746 2749
2747 2750 When enabled, :hg:`clone` may download and apply a server-advertised
2748 2751 bundle file from a URL instead of using the normal exchange mechanism.
2749 2752
2750 2753 This can likely result in faster and more reliable clones.
2751 2754
2752 2755 (default: True)
2753 2756
2754 2757 ``clonebundlefallback``
2755 2758 Whether failure to apply an advertised "clone bundle" from a server
2756 2759 should result in fallback to a regular clone.
2757 2760
2758 2761 This is disabled by default because servers advertising "clone
2759 2762 bundles" often do so to reduce server load. If advertised bundles
2760 2763 start mass failing and clients automatically fall back to a regular
2761 2764 clone, this would add significant and unexpected load to the server
2762 2765 since the server is expecting clone operations to be offloaded to
2763 2766 pre-generated bundles. Failing fast (the default behavior) ensures
2764 2767 clients don't overwhelm the server when "clone bundle" application
2765 2768 fails.
2766 2769
2767 2770 (default: False)
2768 2771
2769 2772 ``clonebundleprefers``
2770 2773 Defines preferences for which "clone bundles" to use.
2771 2774
2772 2775 Servers advertising "clone bundles" may advertise multiple available
2773 2776 bundles. Each bundle may have different attributes, such as the bundle
2774 2777 type and compression format. This option is used to prefer a particular
2775 2778 bundle over another.
2776 2779
2777 2780 The following keys are defined by Mercurial:
2778 2781
2779 2782 BUNDLESPEC
2780 2783 A bundle type specifier. These are strings passed to :hg:`bundle -t`.
2781 2784 e.g. ``gzip-v2`` or ``bzip2-v1``.
2782 2785
2783 2786 COMPRESSION
2784 2787 The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
2785 2788
2786 2789 Server operators may define custom keys.
2787 2790
2788 2791 Example values: ``COMPRESSION=bzip2``,
2789 2792 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
2790 2793
2791 2794 By default, the first bundle advertised by the server is used.
2792 2795
2793 2796 ``color``
2794 2797 When to colorize output. Possible value are Boolean ("yes" or "no"), or
2795 2798 "debug", or "always". (default: "yes"). "yes" will use color whenever it
2796 2799 seems possible. See :hg:`help color` for details.
2797 2800
2798 2801 ``commitsubrepos``
2799 2802 Whether to commit modified subrepositories when committing the
2800 2803 parent repository. If False and one subrepository has uncommitted
2801 2804 changes, abort the commit.
2802 2805 (default: False)
2803 2806
2804 2807 ``debug``
2805 2808 Print debugging information. (default: False)
2806 2809
2807 2810 ``editor``
2808 2811 The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
2809 2812
2810 2813 ``fallbackencoding``
2811 2814 Encoding to try if it's not possible to decode the changelog using
2812 2815 UTF-8. (default: ISO-8859-1)
2813 2816
2814 2817 ``graphnodetemplate``
2815 2818 (DEPRECATED) Use ``command-templates.graphnode`` instead.
2816 2819
2817 2820 ``ignore``
2818 2821 A file to read per-user ignore patterns from. This file should be
2819 2822 in the same format as a repository-wide .hgignore file. Filenames
2820 2823 are relative to the repository root. This option supports hook syntax,
2821 2824 so if you want to specify multiple ignore files, you can do so by
2822 2825 setting something like ``ignore.other = ~/.hgignore2``. For details
2823 2826 of the ignore file format, see the ``hgignore(5)`` man page.
2824 2827
2825 2828 ``interactive``
2826 2829 Allow to prompt the user. (default: True)
2827 2830
2828 2831 ``interface``
2829 2832 Select the default interface for interactive features (default: text).
2830 2833 Possible values are 'text' and 'curses'.
2831 2834
2832 2835 ``interface.chunkselector``
2833 2836 Select the interface for change recording (e.g. :hg:`commit -i`).
2834 2837 Possible values are 'text' and 'curses'.
2835 2838 This config overrides the interface specified by ui.interface.
2836 2839
2837 2840 ``large-file-limit``
2838 2841 Largest file size that gives no memory use warning.
2839 2842 Possible values are integers or 0 to disable the check.
2840 2843 Value is expressed in bytes by default, one can use standard units for
2841 2844 convenience (e.g. 10MB, 0.1GB, etc) (default: 10MB)
2842 2845
2843 2846 ``logtemplate``
2844 2847 (DEPRECATED) Use ``command-templates.log`` instead.
2845 2848
2846 2849 ``merge``
2847 2850 The conflict resolution program to use during a manual merge.
2848 2851 For more information on merge tools see :hg:`help merge-tools`.
2849 2852 For configuring merge tools see the ``[merge-tools]`` section.
2850 2853
2851 2854 ``mergemarkers``
2852 2855 Sets the merge conflict marker label styling. The ``detailed`` style
2853 2856 uses the ``command-templates.mergemarker`` setting to style the labels.
2854 2857 The ``basic`` style just uses 'local' and 'other' as the marker label.
2855 2858 One of ``basic`` or ``detailed``.
2856 2859 (default: ``basic``)
2857 2860
2858 2861 ``mergemarkertemplate``
2859 2862 (DEPRECATED) Use ``command-templates.mergemarker`` instead.
2860 2863
2861 2864 ``message-output``
2862 2865 Where to write status and error messages. (default: ``stdio``)
2863 2866
2864 2867 ``channel``
2865 2868 Use separate channel for structured output. (Command-server only)
2866 2869 ``stderr``
2867 2870 Everything to stderr.
2868 2871 ``stdio``
2869 2872 Status to stdout, and error to stderr.
2870 2873
2871 2874 ``origbackuppath``
2872 2875 The path to a directory used to store generated .orig files. If the path is
2873 2876 not a directory, one will be created. If set, files stored in this
2874 2877 directory have the same name as the original file and do not have a .orig
2875 2878 suffix.
2876 2879
2877 2880 ``paginate``
2878 2881 Control the pagination of command output (default: True). See :hg:`help pager`
2879 2882 for details.
2880 2883
2881 2884 ``patch``
2882 2885 An optional external tool that ``hg import`` and some extensions
2883 2886 will use for applying patches. By default Mercurial uses an
2884 2887 internal patch utility. The external tool must work as the common
2885 2888 Unix ``patch`` program. In particular, it must accept a ``-p``
2886 2889 argument to strip patch headers, a ``-d`` argument to specify the
2887 2890 current directory, a file name to patch, and a patch file to take
2888 2891 from stdin.
2889 2892
2890 2893 It is possible to specify a patch tool together with extra
2891 2894 arguments. For example, setting this option to ``patch --merge``
2892 2895 will use the ``patch`` program with its 2-way merge option.
2893 2896
2894 2897 ``portablefilenames``
2895 2898 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
2896 2899 (default: ``warn``)
2897 2900
2898 2901 ``warn``
2899 2902 Print a warning message on POSIX platforms, if a file with a non-portable
2900 2903 filename is added (e.g. a file with a name that can't be created on
2901 2904 Windows because it contains reserved parts like ``AUX``, reserved
2902 2905 characters like ``:``, or would cause a case collision with an existing
2903 2906 file).
2904 2907
2905 2908 ``ignore``
2906 2909 Don't print a warning.
2907 2910
2908 2911 ``abort``
2909 2912 The command is aborted.
2910 2913
2911 2914 ``true``
2912 2915 Alias for ``warn``.
2913 2916
2914 2917 ``false``
2915 2918 Alias for ``ignore``.
2916 2919
2917 2920 .. container:: windows
2918 2921
2919 2922 On Windows, this configuration option is ignored and the command aborted.
2920 2923
2921 2924 ``pre-merge-tool-output-template``
2922 2925 (DEPRECATED) Use ``command-template.pre-merge-tool-output`` instead.
2923 2926
2924 2927 ``quiet``
2925 2928 Reduce the amount of output printed.
2926 2929 (default: False)
2927 2930
2928 2931 ``relative-paths``
2929 2932 Prefer relative paths in the UI.
2930 2933
2931 2934 ``remotecmd``
2932 2935 Remote command to use for clone/push/pull operations.
2933 2936 (default: ``hg``)
2934 2937
2935 2938 ``report_untrusted``
2936 2939 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
2937 2940 trusted user or group.
2938 2941 (default: True)
2939 2942
2940 2943 ``slash``
2941 2944 (Deprecated. Use ``slashpath`` template filter instead.)
2942 2945
2943 2946 Display paths using a slash (``/``) as the path separator. This
2944 2947 only makes a difference on systems where the default path
2945 2948 separator is not the slash character (e.g. Windows uses the
2946 2949 backslash character (``\``)).
2947 2950 (default: False)
2948 2951
2949 2952 ``statuscopies``
2950 2953 Display copies in the status command.
2951 2954
2952 2955 ``ssh``
2953 2956 Command to use for SSH connections. (default: ``ssh``)
2954 2957
2955 2958 ``ssherrorhint``
2956 2959 A hint shown to the user in the case of SSH error (e.g.
2957 2960 ``Please see http://company/internalwiki/ssh.html``)
2958 2961
2959 2962 ``strict``
2960 2963 Require exact command names, instead of allowing unambiguous
2961 2964 abbreviations. (default: False)
2962 2965
2963 2966 ``style``
2964 2967 Name of style to use for command output.
2965 2968
2966 2969 ``supportcontact``
2967 2970 A URL where users should report a Mercurial traceback. Use this if you are a
2968 2971 large organisation with its own Mercurial deployment process and crash
2969 2972 reports should be addressed to your internal support.
2970 2973
2971 2974 ``textwidth``
2972 2975 Maximum width of help text. A longer line generated by ``hg help`` or
2973 2976 ``hg subcommand --help`` will be broken after white space to get this
2974 2977 width or the terminal width, whichever comes first.
2975 2978 A non-positive value will disable this and the terminal width will be
2976 2979 used. (default: 78)
2977 2980
2978 2981 ``timeout``
2979 2982 The timeout used when a lock is held (in seconds), a negative value
2980 2983 means no timeout. (default: 600)
2981 2984
2982 2985 ``timeout.warn``
2983 2986 Time (in seconds) before a warning is printed about held lock. A negative
2984 2987 value means no warning. (default: 0)
2985 2988
2986 2989 ``traceback``
2987 2990 Mercurial always prints a traceback when an unknown exception
2988 2991 occurs. Setting this to True will make Mercurial print a traceback
2989 2992 on all exceptions, even those recognized by Mercurial (such as
2990 2993 IOError or MemoryError). (default: False)
2991 2994
2992 2995 ``tweakdefaults``
2993 2996
2994 2997 By default Mercurial's behavior changes very little from release
2995 2998 to release, but over time the recommended config settings
2996 2999 shift. Enable this config to opt in to get automatic tweaks to
2997 3000 Mercurial's behavior over time. This config setting will have no
2998 3001 effect if ``HGPLAIN`` is set or ``HGPLAINEXCEPT`` is set and does
2999 3002 not include ``tweakdefaults``. (default: False)
3000 3003
3001 3004 It currently means::
3002 3005
3003 3006 .. tweakdefaultsmarker
3004 3007
3005 3008 ``username``
3006 3009 The committer of a changeset created when running "commit".
3007 3010 Typically a person's name and email address, e.g. ``Fred Widget
3008 3011 <fred@example.com>``. Environment variables in the
3009 3012 username are expanded.
3010 3013
3011 3014 (default: ``$EMAIL`` or ``username@hostname``. If the username in
3012 3015 hgrc is empty, e.g. if the system admin set ``username =`` in the
3013 3016 system hgrc, it has to be specified manually or in a different
3014 3017 hgrc file)
3015 3018
3016 3019 ``verbose``
3017 3020 Increase the amount of output printed. (default: False)
3018 3021
3019 3022
3020 3023 ``usage``
3021 3024 ---------
3022 3025
3023 3026 ``repository-role``
3024 3027 What this repository is used for.
3025 3028
3026 3029 This is used to adjust behavior and performance to best fit the repository purpose.
3027 3030
3028 3031 Currently recognised values are:
3029 3032
3030 3033 - ``default``: an all purpose repository
3031 3034
3032 3035 ``resources``
3033 3036 How aggressive Mercurial can be with resource usage:
3034 3037
3035 3038 Currently recognised values are:
3036 3039
3037 3040 - ``default``: the default value currently is equivalent to medium,
3038 3041
3039 3042 - ``high``: allows for higher cpu, memory and disk-space usage to improve
3040 3043 performance of some operations.
3041 3044
3042 3045 - ``medium``: aims at a moderate resource usage,
3043 3046
3044 3047 - ``low``: reduces resources usage when possible, decreasing overall
3045 3048 performance.
3046 3049
3047 3050 For finer configuration, see also `usage.resources.cpu`,
3048 3051 `usage.resources.disk` and `usage.resources.memory`.
3049 3052
3050 3053 ``resources.cpu``
3051 3054 How aggressive Mercurial can be in terms of cpu usage:
3052 3055
3053 3056 Currently recognised values are:
3054 3057
3055 3058 - ``default``: the default value, inherits the value from `usage.resources`,
3056 3059
3057 3060 - ``high``: allows for more aggressive cpu usage, improving storage quality
3058 3061 and the performance of some operations at the expense of machine load
3059 3062
3060 3063 - `medium`: aims at a moderate cpu usage,
3061 3064
3062 3065 - `low`: reduces cpu usage when possible, potentially at the expense of
3063 3066 slower operations, increased storage and exchange payload.
3064 3067
3065 3068 ``resources.disk``
3066 3069 How aggressive Mercurial can be in terms of disk usage:
3067 3070
3068 3071 Currently recognised values are::
3069 3072 - ``default``: the default value, inherits the value from `usage.resources`,
3070 3073
3071 3074 - ``high``: allows for more disk space usage where it can improve performance,
3072 3075
3073 3076 - ``medium``: aims at a moderate disk usage,
3074 3077
3075 3078 - ``low``: reduces disk usage when possible, decreasing performance in some
3076 3079 occasion.
3077 3080
3078 3081 ``resources.memory``
3079 3082 How aggressive Mercurial can be in terms of memory usage:
3080 3083
3081 3084 Currently recognised values are::
3082 3085
3083 3086 - ``default``: the default value, inherits the value from `usage.resources`,
3084 3087
3085 3088 - ``high``: allows for more aggressive memory usage to improve overall
3086 3089 performance,
3087 3090
3088 3091 - ``medium``: aims at a moderate memory usage,
3089 3092
3090 3093 - ``low``: reduces memory usage when possible at the cost of overall
3091 3094 performance.
3092 3095
3093 3096
3094 3097 ``command-templates``
3095 3098 ---------------------
3096 3099
3097 3100 Templates used for customizing the output of commands.
3098 3101
3099 3102 ``graphnode``
3100 3103 The template used to print changeset nodes in an ASCII revision graph.
3101 3104 (default: ``{graphnode}``)
3102 3105
3103 3106 ``log``
3104 3107 Template string for commands that print changesets.
3105 3108
3106 3109 ``mergemarker``
3107 3110 The template used to print the commit description next to each conflict
3108 3111 marker during merge conflicts. See :hg:`help templates` for the template
3109 3112 format.
3110 3113
3111 3114 Defaults to showing the hash, tags, branches, bookmarks, author, and
3112 3115 the first line of the commit description.
3113 3116
3114 3117 If you use non-ASCII characters in names for tags, branches, bookmarks,
3115 3118 authors, and/or commit descriptions, you must pay attention to encodings of
3116 3119 managed files. At template expansion, non-ASCII characters use the encoding
3117 3120 specified by the ``--encoding`` global option, ``HGENCODING`` or other
3118 3121 environment variables that govern your locale. If the encoding of the merge
3119 3122 markers is different from the encoding of the merged files,
3120 3123 serious problems may occur.
3121 3124
3122 3125 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
3123 3126
3124 3127 ``oneline-summary``
3125 3128 A template used by `hg rebase` and other commands for showing a one-line
3126 3129 summary of a commit. If the template configured here is longer than one
3127 3130 line, then only the first line is used.
3128 3131
3129 3132 The template can be overridden per command by defining a template in
3130 3133 `oneline-summary.<command>`, where `<command>` can be e.g. "rebase".
3131 3134
3132 3135 ``pre-merge-tool-output``
3133 3136 A template that is printed before executing an external merge tool. This can
3134 3137 be used to print out additional context that might be useful to have during
3135 3138 the conflict resolution, such as the description of the various commits
3136 3139 involved or bookmarks/tags.
3137 3140
3138 3141 Additional information is available in the ``local`, ``base``, and ``other``
3139 3142 dicts. For example: ``{local.label}``, ``{base.name}``, or
3140 3143 ``{other.islink}``.
3141 3144
3142 3145
3143 3146 ``web``
3144 3147 -------
3145 3148
3146 3149 Web interface configuration. The settings in this section apply to
3147 3150 both the builtin webserver (started by :hg:`serve`) and the script you
3148 3151 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
3149 3152 and WSGI).
3150 3153
3151 3154 The Mercurial webserver does no authentication (it does not prompt for
3152 3155 usernames and passwords to validate *who* users are), but it does do
3153 3156 authorization (it grants or denies access for *authenticated users*
3154 3157 based on settings in this section). You must either configure your
3155 3158 webserver to do authentication for you, or disable the authorization
3156 3159 checks.
3157 3160
3158 3161 For a quick setup in a trusted environment, e.g., a private LAN, where
3159 3162 you want it to accept pushes from anybody, you can use the following
3160 3163 command line::
3161 3164
3162 3165 $ hg --config web.allow-push=* --config web.push_ssl=False serve
3163 3166
3164 3167 Note that this will allow anybody to push anything to the server and
3165 3168 that this should not be used for public servers.
3166 3169
3167 3170 The full set of options is:
3168 3171
3169 3172 ``accesslog``
3170 3173 Where to output the access log. (default: stdout)
3171 3174
3172 3175 ``address``
3173 3176 Interface address to bind to. (default: all)
3174 3177
3175 3178 ``allow-archive``
3176 3179 List of archive format (bz2, gz, zip) allowed for downloading.
3177 3180 (default: empty)
3178 3181
3179 3182 ``allowbz2``
3180 3183 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
3181 3184 revisions.
3182 3185 (default: False)
3183 3186
3184 3187 ``allowgz``
3185 3188 (DEPRECATED) Whether to allow .tar.gz downloading of repository
3186 3189 revisions.
3187 3190 (default: False)
3188 3191
3189 3192 ``allow-pull``
3190 3193 Whether to allow pulling from the repository. (default: True)
3191 3194
3192 3195 ``allow-push``
3193 3196 Whether to allow pushing to the repository. If empty or not set,
3194 3197 pushing is not allowed. If the special value ``*``, any remote
3195 3198 user can push, including unauthenticated users. Otherwise, the
3196 3199 remote user must have been authenticated, and the authenticated
3197 3200 user name must be present in this list. The contents of the
3198 3201 allow-push list are examined after the deny_push list.
3199 3202
3200 3203 ``allow_read``
3201 3204 If the user has not already been denied repository access due to
3202 3205 the contents of deny_read, this list determines whether to grant
3203 3206 repository access to the user. If this list is not empty, and the
3204 3207 user is unauthenticated or not present in the list, then access is
3205 3208 denied for the user. If the list is empty or not set, then access
3206 3209 is permitted to all users by default. Setting allow_read to the
3207 3210 special value ``*`` is equivalent to it not being set (i.e. access
3208 3211 is permitted to all users). The contents of the allow_read list are
3209 3212 examined after the deny_read list.
3210 3213
3211 3214 ``allowzip``
3212 3215 (DEPRECATED) Whether to allow .zip downloading of repository
3213 3216 revisions. This feature creates temporary files.
3214 3217 (default: False)
3215 3218
3216 3219 ``archivesubrepos``
3217 3220 Whether to recurse into subrepositories when archiving.
3218 3221 (default: False)
3219 3222
3220 3223 ``baseurl``
3221 3224 Base URL to use when publishing URLs in other locations, so
3222 3225 third-party tools like email notification hooks can construct
3223 3226 URLs. Example: ``http://hgserver/repos/``.
3224 3227
3225 3228 ``cacerts``
3226 3229 Path to file containing a list of PEM encoded certificate
3227 3230 authority certificates. Environment variables and ``~user``
3228 3231 constructs are expanded in the filename. If specified on the
3229 3232 client, then it will verify the identity of remote HTTPS servers
3230 3233 with these certificates.
3231 3234
3232 3235 To disable SSL verification temporarily, specify ``--insecure`` from
3233 3236 command line.
3234 3237
3235 3238 You can use OpenSSL's CA certificate file if your platform has
3236 3239 one. On most Linux systems this will be
3237 3240 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
3238 3241 generate this file manually. The form must be as follows::
3239 3242
3240 3243 -----BEGIN CERTIFICATE-----
3241 3244 ... (certificate in base64 PEM encoding) ...
3242 3245 -----END CERTIFICATE-----
3243 3246 -----BEGIN CERTIFICATE-----
3244 3247 ... (certificate in base64 PEM encoding) ...
3245 3248 -----END CERTIFICATE-----
3246 3249
3247 3250 ``cache``
3248 3251 Whether to support caching in hgweb. (default: True)
3249 3252
3250 3253 ``certificate``
3251 3254 Certificate to use when running :hg:`serve`.
3252 3255
3253 3256 ``collapse``
3254 3257 With ``descend`` enabled, repositories in subdirectories are shown at
3255 3258 a single level alongside repositories in the current path. With
3256 3259 ``collapse`` also enabled, repositories residing at a deeper level than
3257 3260 the current path are grouped behind navigable directory entries that
3258 3261 lead to the locations of these repositories. In effect, this setting
3259 3262 collapses each collection of repositories found within a subdirectory
3260 3263 into a single entry for that subdirectory. (default: False)
3261 3264
3262 3265 ``comparisoncontext``
3263 3266 Number of lines of context to show in side-by-side file comparison. If
3264 3267 negative or the value ``full``, whole files are shown. (default: 5)
3265 3268
3266 3269 This setting can be overridden by a ``context`` request parameter to the
3267 3270 ``comparison`` command, taking the same values.
3268 3271
3269 3272 ``contact``
3270 3273 Name or email address of the person in charge of the repository.
3271 3274 (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
3272 3275
3273 3276 ``csp``
3274 3277 Send a ``Content-Security-Policy`` HTTP header with this value.
3275 3278
3276 3279 The value may contain a special string ``%nonce%``, which will be replaced
3277 3280 by a randomly-generated one-time use value. If the value contains
3278 3281 ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
3279 3282 one-time property of the nonce. This nonce will also be inserted into
3280 3283 ``<script>`` elements containing inline JavaScript.
3281 3284
3282 3285 Note: lots of HTML content sent by the server is derived from repository
3283 3286 data. Please consider the potential for malicious repository data to
3284 3287 "inject" itself into generated HTML content as part of your security
3285 3288 threat model.
3286 3289
3287 3290 ``deny_push``
3288 3291 Whether to deny pushing to the repository. If empty or not set,
3289 3292 push is not denied. If the special value ``*``, all remote users are
3290 3293 denied push. Otherwise, unauthenticated users are all denied, and
3291 3294 any authenticated user name present in this list is also denied. The
3292 3295 contents of the deny_push list are examined before the allow-push list.
3293 3296
3294 3297 ``deny_read``
3295 3298 Whether to deny reading/viewing of the repository. If this list is
3296 3299 not empty, unauthenticated users are all denied, and any
3297 3300 authenticated user name present in this list is also denied access to
3298 3301 the repository. If set to the special value ``*``, all remote users
3299 3302 are denied access (rarely needed ;). If deny_read is empty or not set,
3300 3303 the determination of repository access depends on the presence and
3301 3304 content of the allow_read list (see description). If both
3302 3305 deny_read and allow_read are empty or not set, then access is
3303 3306 permitted to all users by default. If the repository is being
3304 3307 served via hgwebdir, denied users will not be able to see it in
3305 3308 the list of repositories. The contents of the deny_read list have
3306 3309 priority over (are examined before) the contents of the allow_read
3307 3310 list.
3308 3311
3309 3312 ``descend``
3310 3313 hgwebdir indexes will not descend into subdirectories. Only repositories
3311 3314 directly in the current path will be shown (other repositories are still
3312 3315 available from the index corresponding to their containing path).
3313 3316
3314 3317 ``description``
3315 3318 Textual description of the repository's purpose or contents.
3316 3319 (default: "unknown")
3317 3320
3318 3321 ``encoding``
3319 3322 Character encoding name. (default: the current locale charset)
3320 3323 Example: "UTF-8".
3321 3324
3322 3325 ``errorlog``
3323 3326 Where to output the error log. (default: stderr)
3324 3327
3325 3328 ``guessmime``
3326 3329 Control MIME types for raw download of file content.
3327 3330 Set to True to let hgweb guess the content type from the file
3328 3331 extension. This will serve HTML files as ``text/html`` and might
3329 3332 allow cross-site scripting attacks when serving untrusted
3330 3333 repositories. (default: False)
3331 3334
3332 3335 ``hidden``
3333 3336 Whether to hide the repository in the hgwebdir index.
3334 3337 (default: False)
3335 3338
3336 3339 ``ipv6``
3337 3340 Whether to use IPv6. (default: False)
3338 3341
3339 3342 ``labels``
3340 3343 List of string *labels* associated with the repository.
3341 3344
3342 3345 Labels are exposed as a template keyword and can be used to customize
3343 3346 output. e.g. the ``index`` template can group or filter repositories
3344 3347 by labels and the ``summary`` template can display additional content
3345 3348 if a specific label is present.
3346 3349
3347 3350 ``logoimg``
3348 3351 File name of the logo image that some templates display on each page.
3349 3352 The file name is relative to ``staticurl``. That is, the full path to
3350 3353 the logo image is "staticurl/logoimg".
3351 3354 If unset, ``hglogo.png`` will be used.
3352 3355
3353 3356 ``logourl``
3354 3357 Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
3355 3358 will be used.
3356 3359
3357 3360 ``maxchanges``
3358 3361 Maximum number of changes to list on the changelog. (default: 10)
3359 3362
3360 3363 ``maxfiles``
3361 3364 Maximum number of files to list per changeset. (default: 10)
3362 3365
3363 3366 ``maxshortchanges``
3364 3367 Maximum number of changes to list on the shortlog, graph or filelog
3365 3368 pages. (default: 60)
3366 3369
3367 3370 ``name``
3368 3371 Repository name to use in the web interface.
3369 3372 (default: current working directory)
3370 3373
3371 3374 ``port``
3372 3375 Port to listen on. (default: 8000)
3373 3376
3374 3377 ``prefix``
3375 3378 Prefix path to serve from. (default: '' (server root))
3376 3379
3377 3380 ``push_ssl``
3378 3381 Whether to require that inbound pushes be transported over SSL to
3379 3382 prevent password sniffing. (default: True)
3380 3383
3381 3384 ``refreshinterval``
3382 3385 How frequently directory listings re-scan the filesystem for new
3383 3386 repositories, in seconds. This is relevant when wildcards are used
3384 3387 to define paths. Depending on how much filesystem traversal is
3385 3388 required, refreshing may negatively impact performance.
3386 3389
3387 3390 Values less than or equal to 0 always refresh.
3388 3391 (default: 20)
3389 3392
3390 3393 ``server-header``
3391 3394 Value for HTTP ``Server`` response header.
3392 3395
3393 3396 ``static``
3394 3397 Directory where static files are served from.
3395 3398
3396 3399 ``staticurl``
3397 3400 Base URL to use for static files. If unset, static files (e.g. the
3398 3401 hgicon.png favicon) will be served by the CGI script itself. Use
3399 3402 this setting to serve them directly with the HTTP server.
3400 3403 Example: ``http://hgserver/static/``.
3401 3404
3402 3405 ``stripes``
3403 3406 How many lines a "zebra stripe" should span in multi-line output.
3404 3407 Set to 0 to disable. (default: 1)
3405 3408
3406 3409 ``style``
3407 3410 Which template map style to use. The available options are the names of
3408 3411 subdirectories in the HTML templates path. (default: ``paper``)
3409 3412 Example: ``monoblue``.
3410 3413
3411 3414 ``templates``
3412 3415 Where to find the HTML templates. The default path to the HTML templates
3413 3416 can be obtained from ``hg debuginstall``.
3414 3417
3415 3418 ``websub``
3416 3419 ----------
3417 3420
3418 3421 Web substitution filter definition. You can use this section to
3419 3422 define a set of regular expression substitution patterns which
3420 3423 let you automatically modify the hgweb server output.
3421 3424
3422 3425 The default hgweb templates only apply these substitution patterns
3423 3426 on the revision description fields. You can apply them anywhere
3424 3427 you want when you create your own templates by adding calls to the
3425 3428 "websub" filter (usually after calling the "escape" filter).
3426 3429
3427 3430 This can be used, for example, to convert issue references to links
3428 3431 to your issue tracker, or to convert "markdown-like" syntax into
3429 3432 HTML (see the examples below).
3430 3433
3431 3434 Each entry in this section names a substitution filter.
3432 3435 The value of each entry defines the substitution expression itself.
3433 3436 The websub expressions follow the old interhg extension syntax,
3434 3437 which in turn imitates the Unix sed replacement syntax::
3435 3438
3436 3439 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
3437 3440
3438 3441 You can use any separator other than "/". The final "i" is optional
3439 3442 and indicates that the search must be case insensitive.
3440 3443
3441 3444 Examples::
3442 3445
3443 3446 [websub]
3444 3447 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
3445 3448 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
3446 3449 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
3447 3450
3448 3451 ``worker``
3449 3452 ----------
3450 3453
3451 3454 Parallel master/worker configuration. We currently perform working
3452 3455 directory updates in parallel on Unix-like systems, which greatly
3453 3456 helps performance.
3454 3457
3455 3458 ``enabled``
3456 3459 Whether to enable workers code to be used.
3457 3460 (default: true)
3458 3461
3459 3462 ``numcpus``
3460 3463 Number of CPUs to use for parallel operations. A zero or
3461 3464 negative value is treated as ``use the default``.
3462 3465 (default: 4 or the number of CPUs on the system, whichever is larger)
3463 3466
3464 3467 ``backgroundclose``
3465 3468 Whether to enable closing file handles on background threads during certain
3466 3469 operations. Some platforms aren't very efficient at closing file
3467 3470 handles that have been written or appended to. By performing file closing
3468 3471 on background threads, file write rate can increase substantially.
3469 3472 (default: true on Windows, false elsewhere)
3470 3473
3471 3474 ``backgroundcloseminfilecount``
3472 3475 Minimum number of files required to trigger background file closing.
3473 3476 Operations not writing this many files won't start background close
3474 3477 threads.
3475 3478 (default: 2048)
3476 3479
3477 3480 ``backgroundclosemaxqueue``
3478 3481 The maximum number of opened file handles waiting to be closed in the
3479 3482 background. This option only has an effect if ``backgroundclose`` is
3480 3483 enabled.
3481 3484 (default: 384)
3482 3485
3483 3486 ``backgroundclosethreadcount``
3484 3487 Number of threads to process background file closes. Only relevant if
3485 3488 ``backgroundclose`` is enabled.
3486 3489 (default: 4)
@@ -1,4118 +1,4118
1 1 Short help:
2 2
3 3 $ hg
4 4 Mercurial Distributed SCM
5 5
6 6 basic commands:
7 7
8 8 add add the specified files on the next commit
9 9 annotate show changeset information by line for each file
10 10 clone make a copy of an existing repository
11 11 commit commit the specified files or all outstanding changes
12 12 diff diff repository (or selected files)
13 13 export dump the header and diffs for one or more changesets
14 14 forget forget the specified files on the next commit
15 15 init create a new repository in the given directory
16 16 log show revision history of entire repository or files
17 17 merge merge another revision into working directory
18 18 pull pull changes from the specified source
19 19 push push changes to the specified destination
20 20 remove remove the specified files on the next commit
21 21 serve start stand-alone webserver
22 22 status show changed files in the working directory
23 23 summary summarize working directory state
24 24 update update working directory (or switch revisions)
25 25
26 26 (use 'hg help' for the full list of commands or 'hg -v' for details)
27 27
28 28 $ hg -q
29 29 add add the specified files on the next commit
30 30 annotate show changeset information by line for each file
31 31 clone make a copy of an existing repository
32 32 commit commit the specified files or all outstanding changes
33 33 diff diff repository (or selected files)
34 34 export dump the header and diffs for one or more changesets
35 35 forget forget the specified files on the next commit
36 36 init create a new repository in the given directory
37 37 log show revision history of entire repository or files
38 38 merge merge another revision into working directory
39 39 pull pull changes from the specified source
40 40 push push changes to the specified destination
41 41 remove remove the specified files on the next commit
42 42 serve start stand-alone webserver
43 43 status show changed files in the working directory
44 44 summary summarize working directory state
45 45 update update working directory (or switch revisions)
46 46
47 47 Extra extensions will be printed in help output in a non-reliable order since
48 48 the extension is unknown.
49 49 #if no-extraextensions
50 50
51 51 $ hg help
52 52 Mercurial Distributed SCM
53 53
54 54 list of commands:
55 55
56 56 Repository creation:
57 57
58 58 clone make a copy of an existing repository
59 59 init create a new repository in the given directory
60 60
61 61 Remote repository management:
62 62
63 63 incoming show new changesets found in source
64 64 outgoing show changesets not found in the destination
65 65 paths show aliases for remote repositories
66 66 pull pull changes from the specified source
67 67 push push changes to the specified destination
68 68 serve start stand-alone webserver
69 69
70 70 Change creation:
71 71
72 72 commit commit the specified files or all outstanding changes
73 73
74 74 Change manipulation:
75 75
76 76 backout reverse effect of earlier changeset
77 77 graft copy changes from other branches onto the current branch
78 78 merge merge another revision into working directory
79 79
80 80 Change organization:
81 81
82 82 bookmarks create a new bookmark or list existing bookmarks
83 83 branch set or show the current branch name
84 84 branches list repository named branches
85 85 phase set or show the current phase name
86 86 tag add one or more tags for the current or given revision
87 87 tags list repository tags
88 88
89 89 File content management:
90 90
91 91 annotate show changeset information by line for each file
92 92 cat output the current or given revision of files
93 93 copy mark files as copied for the next commit
94 94 diff diff repository (or selected files)
95 95 grep search for a pattern in specified files
96 96
97 97 Change navigation:
98 98
99 99 bisect subdivision search of changesets
100 100 heads show branch heads
101 101 identify identify the working directory or specified revision
102 102 log show revision history of entire repository or files
103 103
104 104 Working directory management:
105 105
106 106 add add the specified files on the next commit
107 107 addremove add all new files, delete all missing files
108 108 files list tracked files
109 109 forget forget the specified files on the next commit
110 110 purge removes files not tracked by Mercurial
111 111 remove remove the specified files on the next commit
112 112 rename rename files; equivalent of copy + remove
113 113 resolve redo merges or set/view the merge status of files
114 114 revert restore files to their checkout state
115 115 root print the root (top) of the current working directory
116 116 shelve save and set aside changes from the working directory
117 117 status show changed files in the working directory
118 118 summary summarize working directory state
119 119 unshelve restore a shelved change to the working directory
120 120 update update working directory (or switch revisions)
121 121
122 122 Change import/export:
123 123
124 124 archive create an unversioned archive of a repository revision
125 125 bundle create a bundle file
126 126 export dump the header and diffs for one or more changesets
127 127 import import an ordered set of patches
128 128 unbundle apply one or more bundle files
129 129
130 130 Repository maintenance:
131 131
132 132 admin::verify
133 133 verify the integrity of the repository
134 134 manifest output the current or given revision of the project manifest
135 135 recover roll back an interrupted transaction
136 136 verify verify the integrity of the repository
137 137
138 138 Help:
139 139
140 140 config show combined config settings from all hgrc files
141 141 help show help for a given topic or a help overview
142 142 version output version and copyright information
143 143
144 144 additional help topics:
145 145
146 146 Mercurial identifiers:
147 147
148 148 filesets Specifying File Sets
149 149 hgignore Syntax for Mercurial Ignore Files
150 150 patterns File Name Patterns
151 151 revisions Specifying Revisions
152 152 urls URL Paths
153 153
154 154 Mercurial output:
155 155
156 156 color Colorizing Outputs
157 157 dates Date Formats
158 158 diffs Diff Formats
159 159 templating Template Usage
160 160
161 161 Mercurial configuration:
162 162
163 163 config Configuration Files
164 164 environment Environment Variables
165 165 extensions Using Additional Features
166 166 flags Command-line flags
167 167 hgweb Configuring hgweb
168 168 merge-tools Merge Tools
169 169 pager Pager Support
170 170 rust Rust in Mercurial
171 171
172 172 Concepts:
173 173
174 174 bundlespec Bundle File Formats
175 175 evolution Safely rewriting history (EXPERIMENTAL)
176 176 glossary Glossary
177 177 phases Working with Phases
178 178 subrepos Subrepositories
179 179
180 180 Miscellaneous:
181 181
182 182 deprecated Deprecated Features
183 183 internals Technical implementation topics
184 184 scripting Using Mercurial from scripts and automation
185 185
186 186 (use 'hg help -v' to show built-in aliases and global options)
187 187
188 188 $ hg -q help
189 189 Repository creation:
190 190
191 191 clone make a copy of an existing repository
192 192 init create a new repository in the given directory
193 193
194 194 Remote repository management:
195 195
196 196 incoming show new changesets found in source
197 197 outgoing show changesets not found in the destination
198 198 paths show aliases for remote repositories
199 199 pull pull changes from the specified source
200 200 push push changes to the specified destination
201 201 serve start stand-alone webserver
202 202
203 203 Change creation:
204 204
205 205 commit commit the specified files or all outstanding changes
206 206
207 207 Change manipulation:
208 208
209 209 backout reverse effect of earlier changeset
210 210 graft copy changes from other branches onto the current branch
211 211 merge merge another revision into working directory
212 212
213 213 Change organization:
214 214
215 215 bookmarks create a new bookmark or list existing bookmarks
216 216 branch set or show the current branch name
217 217 branches list repository named branches
218 218 phase set or show the current phase name
219 219 tag add one or more tags for the current or given revision
220 220 tags list repository tags
221 221
222 222 File content management:
223 223
224 224 annotate show changeset information by line for each file
225 225 cat output the current or given revision of files
226 226 copy mark files as copied for the next commit
227 227 diff diff repository (or selected files)
228 228 grep search for a pattern in specified files
229 229
230 230 Change navigation:
231 231
232 232 bisect subdivision search of changesets
233 233 heads show branch heads
234 234 identify identify the working directory or specified revision
235 235 log show revision history of entire repository or files
236 236
237 237 Working directory management:
238 238
239 239 add add the specified files on the next commit
240 240 addremove add all new files, delete all missing files
241 241 files list tracked files
242 242 forget forget the specified files on the next commit
243 243 purge removes files not tracked by Mercurial
244 244 remove remove the specified files on the next commit
245 245 rename rename files; equivalent of copy + remove
246 246 resolve redo merges or set/view the merge status of files
247 247 revert restore files to their checkout state
248 248 root print the root (top) of the current working directory
249 249 shelve save and set aside changes from the working directory
250 250 status show changed files in the working directory
251 251 summary summarize working directory state
252 252 unshelve restore a shelved change to the working directory
253 253 update update working directory (or switch revisions)
254 254
255 255 Change import/export:
256 256
257 257 archive create an unversioned archive of a repository revision
258 258 bundle create a bundle file
259 259 export dump the header and diffs for one or more changesets
260 260 import import an ordered set of patches
261 261 unbundle apply one or more bundle files
262 262
263 263 Repository maintenance:
264 264
265 265 admin::verify
266 266 verify the integrity of the repository
267 267 manifest output the current or given revision of the project manifest
268 268 recover roll back an interrupted transaction
269 269 verify verify the integrity of the repository
270 270
271 271 Help:
272 272
273 273 config show combined config settings from all hgrc files
274 274 help show help for a given topic or a help overview
275 275 version output version and copyright information
276 276
277 277 additional help topics:
278 278
279 279 Mercurial identifiers:
280 280
281 281 filesets Specifying File Sets
282 282 hgignore Syntax for Mercurial Ignore Files
283 283 patterns File Name Patterns
284 284 revisions Specifying Revisions
285 285 urls URL Paths
286 286
287 287 Mercurial output:
288 288
289 289 color Colorizing Outputs
290 290 dates Date Formats
291 291 diffs Diff Formats
292 292 templating Template Usage
293 293
294 294 Mercurial configuration:
295 295
296 296 config Configuration Files
297 297 environment Environment Variables
298 298 extensions Using Additional Features
299 299 flags Command-line flags
300 300 hgweb Configuring hgweb
301 301 merge-tools Merge Tools
302 302 pager Pager Support
303 303 rust Rust in Mercurial
304 304
305 305 Concepts:
306 306
307 307 bundlespec Bundle File Formats
308 308 evolution Safely rewriting history (EXPERIMENTAL)
309 309 glossary Glossary
310 310 phases Working with Phases
311 311 subrepos Subrepositories
312 312
313 313 Miscellaneous:
314 314
315 315 deprecated Deprecated Features
316 316 internals Technical implementation topics
317 317 scripting Using Mercurial from scripts and automation
318 318
319 319 Test extension help:
320 320 $ hg help extensions --config extensions.rebase= --config extensions.children=
321 321 Using Additional Features
322 322 """""""""""""""""""""""""
323 323
324 324 Mercurial has the ability to add new features through the use of
325 325 extensions. Extensions may add new commands, add options to existing
326 326 commands, change the default behavior of commands, or implement hooks.
327 327
328 328 To enable the "foo" extension, either shipped with Mercurial or in the
329 329 Python search path, create an entry for it in your configuration file,
330 330 like this:
331 331
332 332 [extensions]
333 333 foo =
334 334
335 335 You may also specify the full path to an extension:
336 336
337 337 [extensions]
338 338 myfeature = ~/.hgext/myfeature.py
339 339
340 340 See 'hg help config' for more information on configuration files.
341 341
342 342 Extensions are not loaded by default for a variety of reasons: they can
343 343 increase startup overhead; they may be meant for advanced usage only; they
344 344 may provide potentially dangerous abilities (such as letting you destroy
345 345 or modify history); they might not be ready for prime time; or they may
346 346 alter some usual behaviors of stock Mercurial. It is thus up to the user
347 347 to activate extensions as needed.
348 348
349 349 To explicitly disable an extension enabled in a configuration file of
350 350 broader scope, prepend its path with !:
351 351
352 352 [extensions]
353 353 # disabling extension bar residing in /path/to/extension/bar.py
354 354 bar = !/path/to/extension/bar.py
355 355 # ditto, but no path was supplied for extension baz
356 356 baz = !
357 357
358 358 enabled extensions:
359 359
360 360 children command to display child changesets (DEPRECATED)
361 361 rebase command to move sets of revisions to a different ancestor
362 362
363 363 disabled extensions:
364 364
365 365 acl hooks for controlling repository access
366 366 blackbox log repository events to a blackbox for debugging
367 367 bugzilla hooks for integrating with the Bugzilla bug tracker
368 368 censor erase file content at a given revision
369 369 churn command to display statistics about repository history
370 370 clonebundles advertise pre-generated bundles to seed clones
371 371 closehead close arbitrary heads without checking them out first
372 372 convert import revisions from foreign VCS repositories into
373 373 Mercurial
374 374 eol automatically manage newlines in repository files
375 375 extdiff command to allow external programs to compare revisions
376 376 factotum http authentication with factotum
377 377 fastexport export repositories as git fast-import stream
378 378 githelp try mapping git commands to Mercurial commands
379 379 gpg commands to sign and verify changesets
380 380 hgk browse the repository in a graphical way
381 381 highlight syntax highlighting for hgweb (requires Pygments)
382 382 histedit interactive history editing
383 383 keyword expand keywords in tracked files
384 384 largefiles track large binary files
385 385 mq manage a stack of patches
386 386 notify hooks for sending email push notifications
387 387 patchbomb command to send changesets as (a series of) patch emails
388 388 relink recreates hardlinks between repository clones
389 389 schemes extend schemes with shortcuts to repository swarms
390 390 share share a common history between several working directories
391 391 transplant command to transplant changesets from another branch
392 392 win32mbcs allow the use of MBCS paths with problematic encodings
393 393 zeroconf discover and advertise repositories on the local network
394 394
395 395 #endif
396 396
397 397 Verify that deprecated extensions are included if --verbose:
398 398
399 399 $ hg -v help extensions | grep children
400 400 children command to display child changesets (DEPRECATED)
401 401
402 402 Verify that extension keywords appear in help templates
403 403
404 404 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
405 405
406 406 Test short command list with verbose option
407 407
408 408 $ hg -v help shortlist
409 409 Mercurial Distributed SCM
410 410
411 411 basic commands:
412 412
413 413 abort abort an unfinished operation (EXPERIMENTAL)
414 414 add add the specified files on the next commit
415 415 admin::chainsaw-update, admin::chainsawupdate
416 416 pull and update to a given revision, no matter what,
417 417 (EXPERIMENTAL)
418 418 annotate, blame
419 419 show changeset information by line for each file
420 420 clone make a copy of an existing repository
421 421 commit, ci commit the specified files or all outstanding changes
422 422 continue resumes an interrupted operation (EXPERIMENTAL)
423 423 diff diff repository (or selected files)
424 424 export dump the header and diffs for one or more changesets
425 425 forget forget the specified files on the next commit
426 426 init create a new repository in the given directory
427 427 log, history show revision history of entire repository or files
428 428 merge merge another revision into working directory
429 429 pull pull changes from the specified source
430 430 push push changes to the specified destination
431 431 remove, rm remove the specified files on the next commit
432 432 serve start stand-alone webserver
433 433 status, st show changed files in the working directory
434 434 summary, sum summarize working directory state
435 435 update, up, checkout, co
436 436 update working directory (or switch revisions)
437 437
438 438 global options ([+] can be repeated):
439 439
440 440 -R --repository REPO repository root directory or name of overlay bundle
441 441 file
442 442 --cwd DIR change working directory
443 443 -y --noninteractive do not prompt, automatically pick the first choice for
444 444 all prompts
445 445 -q --quiet suppress output
446 446 -v --verbose enable additional output
447 447 --color TYPE when to colorize (boolean, always, auto, never, or
448 448 debug)
449 449 --config CONFIG [+] set/override config option (use 'section.name=value')
450 450 --debug enable debugging output
451 451 --debugger start debugger
452 452 --encoding ENCODE set the charset encoding (default: ascii)
453 453 --encodingmode MODE set the charset encoding mode (default: strict)
454 454 --traceback always print a traceback on exception
455 455 --time time how long the command takes
456 456 --profile print command execution profile
457 457 --version output version information and exit
458 458 -h --help display help and exit
459 459 --hidden consider hidden changesets
460 460 --pager TYPE when to paginate (boolean, always, auto, or never)
461 461 (default: auto)
462 462
463 463 (use 'hg help' for the full list of commands)
464 464
465 465 $ hg add -h
466 466 hg add [OPTION]... [FILE]...
467 467
468 468 add the specified files on the next commit
469 469
470 470 Schedule files to be version controlled and added to the repository.
471 471
472 472 The files will be added to the repository at the next commit. To undo an
473 473 add before that, see 'hg forget'.
474 474
475 475 If no names are given, add all files to the repository (except files
476 476 matching ".hgignore").
477 477
478 478 Returns 0 if all files are successfully added.
479 479
480 480 options ([+] can be repeated):
481 481
482 482 -I --include PATTERN [+] include names matching the given patterns
483 483 -X --exclude PATTERN [+] exclude names matching the given patterns
484 484 -S --subrepos recurse into subrepositories
485 485 -n --dry-run do not perform actions, just print output
486 486
487 487 (some details hidden, use --verbose to show complete help)
488 488
489 489 Verbose help for add
490 490
491 491 $ hg add -hv
492 492 hg add [OPTION]... [FILE]...
493 493
494 494 add the specified files on the next commit
495 495
496 496 Schedule files to be version controlled and added to the repository.
497 497
498 498 The files will be added to the repository at the next commit. To undo an
499 499 add before that, see 'hg forget'.
500 500
501 501 If no names are given, add all files to the repository (except files
502 502 matching ".hgignore").
503 503
504 504 Examples:
505 505
506 506 - New (unknown) files are added automatically by 'hg add':
507 507
508 508 $ ls
509 509 foo.c
510 510 $ hg status
511 511 ? foo.c
512 512 $ hg add
513 513 adding foo.c
514 514 $ hg status
515 515 A foo.c
516 516
517 517 - Specific files to be added can be specified:
518 518
519 519 $ ls
520 520 bar.c foo.c
521 521 $ hg status
522 522 ? bar.c
523 523 ? foo.c
524 524 $ hg add bar.c
525 525 $ hg status
526 526 A bar.c
527 527 ? foo.c
528 528
529 529 Returns 0 if all files are successfully added.
530 530
531 531 options ([+] can be repeated):
532 532
533 533 -I --include PATTERN [+] include names matching the given patterns
534 534 -X --exclude PATTERN [+] exclude names matching the given patterns
535 535 -S --subrepos recurse into subrepositories
536 536 -n --dry-run do not perform actions, just print output
537 537
538 538 global options ([+] can be repeated):
539 539
540 540 -R --repository REPO repository root directory or name of overlay bundle
541 541 file
542 542 --cwd DIR change working directory
543 543 -y --noninteractive do not prompt, automatically pick the first choice for
544 544 all prompts
545 545 -q --quiet suppress output
546 546 -v --verbose enable additional output
547 547 --color TYPE when to colorize (boolean, always, auto, never, or
548 548 debug)
549 549 --config CONFIG [+] set/override config option (use 'section.name=value')
550 550 --debug enable debugging output
551 551 --debugger start debugger
552 552 --encoding ENCODE set the charset encoding (default: ascii)
553 553 --encodingmode MODE set the charset encoding mode (default: strict)
554 554 --traceback always print a traceback on exception
555 555 --time time how long the command takes
556 556 --profile print command execution profile
557 557 --version output version information and exit
558 558 -h --help display help and exit
559 559 --hidden consider hidden changesets
560 560 --pager TYPE when to paginate (boolean, always, auto, or never)
561 561 (default: auto)
562 562
563 563 Test the textwidth config option
564 564
565 565 $ hg root -h --config ui.textwidth=50
566 566 hg root
567 567
568 568 print the root (top) of the current working
569 569 directory
570 570
571 571 Print the root directory of the current
572 572 repository.
573 573
574 574 Returns 0 on success.
575 575
576 576 options:
577 577
578 578 -T --template TEMPLATE display with template
579 579
580 580 (some details hidden, use --verbose to show
581 581 complete help)
582 582
583 583 Test help option with version option
584 584
585 585 $ hg add -h --version
586 586 Mercurial Distributed SCM (version *) (glob)
587 587 (see https://mercurial-scm.org for more information)
588 588
589 589 Copyright (C) 2005-* Olivia Mackall and others (glob)
590 590 This is free software; see the source for copying conditions. There is NO
591 591 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
592 592
593 593 $ hg add --skjdfks
594 594 hg add: option --skjdfks not recognized
595 595 hg add [OPTION]... [FILE]...
596 596
597 597 add the specified files on the next commit
598 598
599 599 options ([+] can be repeated):
600 600
601 601 -I --include PATTERN [+] include names matching the given patterns
602 602 -X --exclude PATTERN [+] exclude names matching the given patterns
603 603 -S --subrepos recurse into subrepositories
604 604 -n --dry-run do not perform actions, just print output
605 605
606 606 (use 'hg add -h' to show more help)
607 607 [10]
608 608
609 609 Test ambiguous command help
610 610
611 611 $ hg help ad
612 612 list of commands:
613 613
614 614 Working directory management:
615 615
616 616 add add the specified files on the next commit
617 617 addremove add all new files, delete all missing files
618 618
619 619 Repository maintenance:
620 620
621 621 admin::verify
622 622 verify the integrity of the repository
623 623
624 624 (use 'hg help -v ad' to show built-in aliases and global options)
625 625
626 626 Test command without options
627 627
628 628 $ hg help verify
629 629 hg verify
630 630
631 631 verify the integrity of the repository
632 632
633 633 Verify the integrity of the current repository.
634 634
635 635 This will perform an extensive check of the repository's integrity,
636 636 validating the hashes and checksums of each entry in the changelog,
637 637 manifest, and tracked files, as well as the integrity of their crosslinks
638 638 and indices.
639 639
640 640 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
641 641 information about recovery from corruption of the repository.
642 642
643 643 For an alternative UI with a lot more control over the verification
644 644 process and better error reporting, try 'hg help admin::verify'.
645 645
646 646 Returns 0 on success, 1 if errors are encountered.
647 647
648 648 options:
649 649
650 650 (some details hidden, use --verbose to show complete help)
651 651
652 652 $ hg help diff
653 653 hg diff [OPTION]... ([-c REV] | [--from REV1] [--to REV2]) [FILE]...
654 654
655 655 diff repository (or selected files)
656 656
657 657 Show differences between revisions for the specified files.
658 658
659 659 Differences between files are shown using the unified diff format.
660 660
661 661 Note:
662 662 'hg diff' may generate unexpected results for merges, as it will
663 663 default to comparing against the working directory's first parent
664 664 changeset if no revisions are specified. To diff against the conflict
665 665 regions, you can use '--config diff.merge=yes'.
666 666
667 667 By default, the working directory files are compared to its first parent.
668 668 To see the differences from another revision, use --from. To see the
669 669 difference to another revision, use --to. For example, 'hg diff --from .^'
670 670 will show the differences from the working copy's grandparent to the
671 671 working copy, 'hg diff --to .' will show the diff from the working copy to
672 672 its parent (i.e. the reverse of the default), and 'hg diff --from 1.0 --to
673 673 1.2' will show the diff between those two revisions.
674 674
675 675 Alternatively you can specify -c/--change with a revision to see the
676 676 changes in that changeset relative to its first parent (i.e. 'hg diff -c
677 677 42' is equivalent to 'hg diff --from 42^ --to 42')
678 678
679 679 Without the -a/--text option, diff will avoid generating diffs of files it
680 680 detects as binary. With -a, diff will generate a diff anyway, probably
681 681 with undesirable results.
682 682
683 683 Use the -g/--git option to generate diffs in the git extended diff format.
684 684 For more information, read 'hg help diffs'.
685 685
686 686 Returns 0 on success.
687 687
688 688 options ([+] can be repeated):
689 689
690 690 --from REV1 revision to diff from
691 691 --to REV2 revision to diff to
692 692 -c --change REV change made by revision
693 693 -a --text treat all files as text
694 694 -g --git use git extended diff format
695 695 --binary generate binary diffs in git mode (default)
696 696 --nodates omit dates from diff headers
697 697 --noprefix omit a/ and b/ prefixes from filenames
698 698 -p --show-function show which function each change is in
699 699 --reverse produce a diff that undoes the changes
700 700 -w --ignore-all-space ignore white space when comparing lines
701 701 -b --ignore-space-change ignore changes in the amount of white space
702 702 -B --ignore-blank-lines ignore changes whose lines are all blank
703 703 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
704 704 -U --unified NUM number of lines of context to show
705 705 --stat output diffstat-style summary of changes
706 706 --root DIR produce diffs relative to subdirectory
707 707 -I --include PATTERN [+] include names matching the given patterns
708 708 -X --exclude PATTERN [+] exclude names matching the given patterns
709 709 -S --subrepos recurse into subrepositories
710 710
711 711 (some details hidden, use --verbose to show complete help)
712 712
713 713 $ hg help status
714 714 hg status [OPTION]... [FILE]...
715 715
716 716 aliases: st
717 717
718 718 show changed files in the working directory
719 719
720 720 Show status of files in the repository. If names are given, only files
721 721 that match are shown. Files that are clean or ignored or the source of a
722 722 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
723 723 -C/--copies or -A/--all are given. Unless options described with "show
724 724 only ..." are given, the options -mardu are used.
725 725
726 726 Option -q/--quiet hides untracked (unknown and ignored) files unless
727 727 explicitly requested with -u/--unknown or -i/--ignored.
728 728
729 729 Note:
730 730 'hg status' may appear to disagree with diff if permissions have
731 731 changed or a merge has occurred. The standard diff format does not
732 732 report permission changes and diff only reports changes relative to one
733 733 merge parent.
734 734
735 735 If one revision is given, it is used as the base revision. If two
736 736 revisions are given, the differences between them are shown. The --change
737 737 option can also be used as a shortcut to list the changed files of a
738 738 revision from its first parent.
739 739
740 740 The codes used to show the status of files are:
741 741
742 742 M = modified
743 743 A = added
744 744 R = removed
745 745 C = clean
746 746 ! = missing (deleted by non-hg command, but still tracked)
747 747 ? = not tracked
748 748 I = ignored
749 749 = origin of the previous file (with --copies)
750 750
751 751 Returns 0 on success.
752 752
753 753 options ([+] can be repeated):
754 754
755 755 -A --all show status of all files
756 756 -m --modified show only modified files
757 757 -a --added show only added files
758 758 -r --removed show only removed files
759 759 -d --deleted show only missing files
760 760 -c --clean show only files without changes
761 761 -u --unknown show only unknown (not tracked) files
762 762 -i --ignored show only ignored files
763 763 -n --no-status hide status prefix
764 764 -C --copies show source of copied files
765 765 -0 --print0 end filenames with NUL, for use with xargs
766 766 --rev REV [+] show difference from revision
767 767 --change REV list the changed files of a revision
768 768 -I --include PATTERN [+] include names matching the given patterns
769 769 -X --exclude PATTERN [+] exclude names matching the given patterns
770 770 -S --subrepos recurse into subrepositories
771 771 -T --template TEMPLATE display with template
772 772
773 773 (some details hidden, use --verbose to show complete help)
774 774
775 775 $ hg -q help status
776 776 hg status [OPTION]... [FILE]...
777 777
778 778 show changed files in the working directory
779 779
780 780 $ hg help foo
781 781 abort: no such help topic: foo
782 782 (try 'hg help --keyword foo')
783 783 [10]
784 784
785 785 $ hg skjdfks
786 786 hg: unknown command 'skjdfks'
787 787 (use 'hg help' for a list of commands)
788 788 [10]
789 789
790 790 Typoed command gives suggestion
791 791 $ hg puls
792 792 hg: unknown command 'puls'
793 793 (did you mean one of pull, push?)
794 794 [10]
795 795
796 796 Not enabled extension gets suggested
797 797
798 798 $ hg rebase
799 799 hg: unknown command 'rebase'
800 800 'rebase' is provided by the following extension:
801 801
802 802 rebase command to move sets of revisions to a different ancestor
803 803
804 804 (use 'hg help extensions' for information on enabling extensions)
805 805 [10]
806 806
807 807 Disabled extension gets suggested
808 808 $ hg --config extensions.rebase=! rebase
809 809 hg: unknown command 'rebase'
810 810 'rebase' is provided by the following extension:
811 811
812 812 rebase command to move sets of revisions to a different ancestor
813 813
814 814 (use 'hg help extensions' for information on enabling extensions)
815 815 [10]
816 816
817 817 Checking that help adapts based on the config:
818 818
819 819 $ hg help diff --config ui.tweakdefaults=true | grep -E -e '^ *(-g|config)'
820 820 -g --[no-]git use git extended diff format (default: on from
821 821 config)
822 822
823 823 Make sure that we don't run afoul of the help system thinking that
824 824 this is a section and erroring out weirdly.
825 825
826 826 $ hg .log
827 827 hg: unknown command '.log'
828 828 (did you mean log?)
829 829 [10]
830 830
831 831 $ hg log.
832 832 hg: unknown command 'log.'
833 833 (did you mean log?)
834 834 [10]
835 835 $ hg pu.lh
836 836 hg: unknown command 'pu.lh'
837 837 (did you mean one of pull, push?)
838 838 [10]
839 839
840 840 $ cat > helpext.py <<EOF
841 841 > import os
842 842 > from mercurial import commands, fancyopts, registrar
843 843 >
844 844 > def func(arg):
845 845 > return '%sfoo' % arg
846 846 > class customopt(fancyopts.customopt):
847 847 > def newstate(self, oldstate, newparam, abort):
848 848 > return '%sbar' % oldstate
849 849 > cmdtable = {}
850 850 > command = registrar.command(cmdtable)
851 851 >
852 852 > @command(b'nohelp',
853 853 > [(b'', b'longdesc', 3, b'x'*67),
854 854 > (b'n', b'', None, b'normal desc'),
855 855 > (b'', b'newline', b'', b'line1\nline2'),
856 856 > (b'', b'default-off', False, b'enable X'),
857 857 > (b'', b'default-on', True, b'enable Y'),
858 858 > (b'', b'callableopt', func, b'adds foo'),
859 859 > (b'', b'customopt', customopt(''), b'adds bar'),
860 860 > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')],
861 861 > b'hg nohelp',
862 862 > norepo=True)
863 863 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
864 864 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
865 865 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
866 866 > def nohelp(ui, *args, **kwargs):
867 867 > pass
868 868 >
869 869 > @command(b'hashelp', [], b'hg hashelp', norepo=True)
870 870 > def hashelp(ui, *args, **kwargs):
871 871 > """Extension command's help"""
872 872 >
873 873 > def uisetup(ui):
874 874 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
875 875 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
876 876 > ui.setconfig(b'alias', b'hgalias:doc', b'My doc', b'helpext')
877 877 > ui.setconfig(b'alias', b'hgalias:category', b'navigation', b'helpext')
878 878 > ui.setconfig(b'alias', b'hgaliasnodoc', b'summary', b'helpext')
879 879 >
880 880 > EOF
881 881 $ echo '[extensions]' >> $HGRCPATH
882 882 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
883 883
884 884 Test for aliases
885 885
886 886 $ hg help | grep hgalias
887 887 hgalias My doc
888 888
889 889 $ hg help hgalias
890 890 hg hgalias [--remote]
891 891
892 892 alias for: hg summary
893 893
894 894 My doc
895 895
896 896 defined by: helpext
897 897
898 898 options:
899 899
900 900 --remote check for push and pull
901 901
902 902 (some details hidden, use --verbose to show complete help)
903 903 $ hg help hgaliasnodoc
904 904 hg hgaliasnodoc [--remote]
905 905
906 906 alias for: hg summary
907 907
908 908 summarize working directory state
909 909
910 910 This generates a brief summary of the working directory state, including
911 911 parents, branch, commit status, phase and available updates.
912 912
913 913 With the --remote option, this will check the default paths for incoming
914 914 and outgoing changes. This can be time-consuming.
915 915
916 916 Returns 0 on success.
917 917
918 918 defined by: helpext
919 919
920 920 options:
921 921
922 922 --remote check for push and pull
923 923
924 924 (some details hidden, use --verbose to show complete help)
925 925
926 926 $ hg help shellalias
927 927 hg shellalias
928 928
929 929 shell alias for: echo hi
930 930
931 931 (no help text available)
932 932
933 933 defined by: helpext
934 934
935 935 (some details hidden, use --verbose to show complete help)
936 936
937 937 Test command with no help text
938 938
939 939 $ hg help nohelp
940 940 hg nohelp
941 941
942 942 (no help text available)
943 943
944 944 options:
945 945
946 946 --longdesc VALUE
947 947 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
948 948 xxxxxxxxxxxxxxxxxxxxxxx (default: 3)
949 949 -n -- normal desc
950 950 --newline VALUE line1 line2
951 951 --default-off enable X
952 952 --[no-]default-on enable Y (default: on)
953 953 --callableopt VALUE adds foo
954 954 --customopt VALUE adds bar
955 955 --customopt-withdefault VALUE adds bar (default: foo)
956 956
957 957 (some details hidden, use --verbose to show complete help)
958 958
959 959 Test that default list of commands includes extension commands that have help,
960 960 but not those that don't, except in verbose mode, when a keyword is passed, or
961 961 when help about the extension is requested.
962 962
963 963 #if no-extraextensions
964 964
965 965 $ hg help | grep hashelp
966 966 hashelp Extension command's help
967 967 $ hg help | grep nohelp
968 968 [1]
969 969 $ hg help -v | grep nohelp
970 970 nohelp (no help text available)
971 971
972 972 $ hg help -k nohelp
973 973 Commands:
974 974
975 975 nohelp hg nohelp
976 976
977 977 Extension Commands:
978 978
979 979 nohelp (no help text available)
980 980
981 981 $ hg help helpext
982 982 helpext extension - no help text available
983 983
984 984 list of commands:
985 985
986 986 hashelp Extension command's help
987 987 nohelp (no help text available)
988 988
989 989 (use 'hg help -v helpext' to show built-in aliases and global options)
990 990
991 991 #endif
992 992
993 993 Test list of internal help commands
994 994
995 995 $ hg help debug
996 996 debug commands (internal and unsupported):
997 997
998 998 debug-delta-find
999 999 display the computation to get to a valid delta for storing REV
1000 1000 debug-repair-issue6528
1001 1001 find affected revisions and repair them. See issue6528 for more
1002 1002 details.
1003 1003 debug-revlog-index
1004 1004 dump index data for a revlog
1005 1005 debug-revlog-stats
1006 1006 display statistics about revlogs in the store
1007 1007 debug::stable-tail-sort
1008 1008 display the stable-tail sort of the ancestors of a given node
1009 1009 debug::stable-tail-sort-leaps
1010 1010 display the leaps in the stable-tail sort of a node, one per
1011 1011 line
1012 1012 debug::unbundle
1013 1013 same as 'hg unbundle', but pretent to come from a push
1014 1014 debugancestor
1015 1015 find the ancestor revision of two revisions in a given index
1016 1016 debugantivirusrunning
1017 1017 attempt to trigger an antivirus scanner to see if one is active
1018 1018 debugapplystreamclonebundle
1019 1019 apply a stream clone bundle file
1020 1020 debugbackupbundle
1021 1021 lists the changesets available in backup bundles
1022 1022 debugbuilddag
1023 1023 builds a repo with a given DAG from scratch in the current
1024 1024 empty repo
1025 1025 debugbundle lists the contents of a bundle
1026 1026 debugcapabilities
1027 1027 lists the capabilities of a remote peer
1028 1028 debugchangedfiles
1029 1029 list the stored files changes for a revision
1030 1030 debugcheckstate
1031 1031 validate the correctness of the current dirstate
1032 1032 debugcolor show available color, effects or style
1033 1033 debugcommands
1034 1034 list all available commands and options
1035 1035 debugcomplete
1036 1036 returns the completion list associated with the given command
1037 1037 debugcreatestreamclonebundle
1038 1038 create a stream clone bundle file
1039 1039 debugdag format the changelog or an index DAG as a concise textual
1040 1040 description
1041 1041 debugdata dump the contents of a data file revision
1042 1042 debugdate parse and display a date
1043 1043 debugdeltachain
1044 1044 dump information about delta chains in a revlog
1045 1045 debugdirstate
1046 1046 show the contents of the current dirstate
1047 1047 debugdirstateignorepatternshash
1048 1048 show the hash of ignore patterns stored in dirstate if v2,
1049 1049 debugdiscovery
1050 1050 runs the changeset discovery protocol in isolation
1051 1051 debugdownload
1052 1052 download a resource using Mercurial logic and config
1053 1053 debugextensions
1054 1054 show information about active extensions
1055 1055 debugfileset parse and apply a fileset specification
1056 1056 debugformat display format information about the current repository
1057 1057 debugfsinfo show information detected about current filesystem
1058 1058 debuggetbundle
1059 1059 retrieves a bundle from a repo
1060 1060 debugignore display the combined ignore pattern and information about
1061 1061 ignored files
1062 1062 debugindexdot
1063 1063 dump an index DAG as a graphviz dot file
1064 1064 debugindexstats
1065 1065 show stats related to the changelog index
1066 1066 debuginstall test Mercurial installation
1067 1067 debugknown test whether node ids are known to a repo
1068 1068 debuglocks show or modify state of locks
1069 1069 debugmanifestfulltextcache
1070 1070 show, clear or amend the contents of the manifest fulltext
1071 1071 cache
1072 1072 debugmergestate
1073 1073 print merge state
1074 1074 debugnamecomplete
1075 1075 complete "names" - tags, open branch names, bookmark names
1076 1076 debugnodemap write and inspect on disk nodemap
1077 1077 debugobsolete
1078 1078 create arbitrary obsolete marker
1079 1079 debugoptADV (no help text available)
1080 1080 debugoptDEP (no help text available)
1081 1081 debugoptEXP (no help text available)
1082 1082 debugp1copies
1083 1083 dump copy information compared to p1
1084 1084 debugp2copies
1085 1085 dump copy information compared to p2
1086 1086 debugpathcomplete
1087 1087 complete part or all of a tracked path
1088 1088 debugpathcopies
1089 1089 show copies between two revisions
1090 1090 debugpeer establish a connection to a peer repository
1091 1091 debugpickmergetool
1092 1092 examine which merge tool is chosen for specified file
1093 1093 debugpushkey access the pushkey key/value protocol
1094 1094 debugpvec (no help text available)
1095 1095 debugrebuilddirstate
1096 1096 rebuild the dirstate as it would look like for the given
1097 1097 revision
1098 1098 debugrebuildfncache
1099 1099 rebuild the fncache file
1100 1100 debugrename dump rename information
1101 1101 debugrequires
1102 1102 print the current repo requirements
1103 1103 debugrevlog show data and statistics about a revlog
1104 1104 debugrevlogindex
1105 1105 dump the contents of a revlog index
1106 1106 debugrevspec parse and apply a revision specification
1107 1107 debugserve run a server with advanced settings
1108 1108 debugsetparents
1109 1109 manually set the parents of the current working directory
1110 1110 (DANGEROUS)
1111 1111 debugshell run an interactive Python interpreter
1112 1112 debugsidedata
1113 1113 dump the side data for a cl/manifest/file revision
1114 1114 debugssl test a secure connection to a server
1115 1115 debugstrip strip changesets and all their descendants from the repository
1116 1116 debugsub (no help text available)
1117 1117 debugsuccessorssets
1118 1118 show set of successors for revision
1119 1119 debugtagscache
1120 1120 display the contents of .hg/cache/hgtagsfnodes1
1121 1121 debugtemplate
1122 1122 parse and apply a template
1123 1123 debuguigetpass
1124 1124 show prompt to type password
1125 1125 debuguiprompt
1126 1126 show plain prompt
1127 1127 debugupdatecaches
1128 1128 warm all known caches in the repository
1129 1129 debugupgraderepo
1130 1130 upgrade a repository to use different features
1131 1131 debugwalk show how files match on given patterns
1132 1132 debugwhyunstable
1133 1133 explain instabilities of a changeset
1134 1134 debugwireargs
1135 1135 (no help text available)
1136 1136 debugwireproto
1137 1137 send wire protocol commands to a server
1138 1138
1139 1139 (use 'hg help -v debug' to show built-in aliases and global options)
1140 1140
1141 1141 internals topic renders index of available sub-topics
1142 1142
1143 1143 $ hg help internals
1144 1144 Technical implementation topics
1145 1145 """""""""""""""""""""""""""""""
1146 1146
1147 1147 To access a subtopic, use "hg help internals.{subtopic-name}"
1148 1148
1149 1149 bid-merge Bid Merge Algorithm
1150 1150 bundle2 Bundle2
1151 1151 bundles Bundles
1152 1152 cbor CBOR
1153 1153 censor Censor
1154 1154 changegroups Changegroups
1155 1155 config Config Registrar
1156 1156 dirstate-v2 dirstate-v2 file format
1157 1157 extensions Extension API
1158 1158 mergestate Mergestate
1159 1159 requirements Repository Requirements
1160 1160 revlogs Revision Logs
1161 1161 wireprotocol Wire Protocol
1162 1162 wireprotocolrpc
1163 1163 Wire Protocol RPC
1164 1164 wireprotocolv2
1165 1165 Wire Protocol Version 2
1166 1166
1167 1167 sub-topics can be accessed
1168 1168
1169 1169 $ hg help internals.changegroups
1170 1170 Changegroups
1171 1171 """"""""""""
1172 1172
1173 1173 Changegroups are representations of repository revlog data, specifically
1174 1174 the changelog data, root/flat manifest data, treemanifest data, and
1175 1175 filelogs.
1176 1176
1177 1177 There are 4 versions of changegroups: "1", "2", "3" and "4". From a high-
1178 1178 level, versions "1" and "2" are almost exactly the same, with the only
1179 1179 difference being an additional item in the *delta header*. Version "3"
1180 1180 adds support for storage flags in the *delta header* and optionally
1181 1181 exchanging treemanifests (enabled by setting an option on the
1182 1182 "changegroup" part in the bundle2). Version "4" adds support for
1183 1183 exchanging sidedata (additional revision metadata not part of the digest).
1184 1184
1185 1185 Changegroups when not exchanging treemanifests consist of 3 logical
1186 1186 segments:
1187 1187
1188 1188 +---------------------------------+
1189 1189 | | | |
1190 1190 | changeset | manifest | filelogs |
1191 1191 | | | |
1192 1192 | | | |
1193 1193 +---------------------------------+
1194 1194
1195 1195 When exchanging treemanifests, there are 4 logical segments:
1196 1196
1197 1197 +-------------------------------------------------+
1198 1198 | | | | |
1199 1199 | changeset | root | treemanifests | filelogs |
1200 1200 | | manifest | | |
1201 1201 | | | | |
1202 1202 +-------------------------------------------------+
1203 1203
1204 1204 The principle building block of each segment is a *chunk*. A *chunk* is a
1205 1205 framed piece of data:
1206 1206
1207 1207 +---------------------------------------+
1208 1208 | | |
1209 1209 | length | data |
1210 1210 | (4 bytes) | (<length - 4> bytes) |
1211 1211 | | |
1212 1212 +---------------------------------------+
1213 1213
1214 1214 All integers are big-endian signed integers. Each chunk starts with a
1215 1215 32-bit integer indicating the length of the entire chunk (including the
1216 1216 length field itself).
1217 1217
1218 1218 There is a special case chunk that has a value of 0 for the length
1219 1219 ("0x00000000"). We call this an *empty chunk*.
1220 1220
1221 1221 Delta Groups
1222 1222 ============
1223 1223
1224 1224 A *delta group* expresses the content of a revlog as a series of deltas,
1225 1225 or patches against previous revisions.
1226 1226
1227 1227 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1228 1228 to signal the end of the delta group:
1229 1229
1230 1230 +------------------------------------------------------------------------+
1231 1231 | | | | | |
1232 1232 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1233 1233 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1234 1234 | | | | | |
1235 1235 +------------------------------------------------------------------------+
1236 1236
1237 1237 Each *chunk*'s data consists of the following:
1238 1238
1239 1239 +---------------------------------------+
1240 1240 | | |
1241 1241 | delta header | delta data |
1242 1242 | (various by version) | (various) |
1243 1243 | | |
1244 1244 +---------------------------------------+
1245 1245
1246 1246 The *delta data* is a series of *delta*s that describe a diff from an
1247 1247 existing entry (either that the recipient already has, or previously
1248 1248 specified in the bundle/changegroup).
1249 1249
1250 1250 The *delta header* is different between versions "1", "2", "3" and "4" of
1251 1251 the changegroup format.
1252 1252
1253 1253 Version 1 (headerlen=80):
1254 1254
1255 1255 +------------------------------------------------------+
1256 1256 | | | | |
1257 1257 | node | p1 node | p2 node | link node |
1258 1258 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1259 1259 | | | | |
1260 1260 +------------------------------------------------------+
1261 1261
1262 1262 Version 2 (headerlen=100):
1263 1263
1264 1264 +------------------------------------------------------------------+
1265 1265 | | | | | |
1266 1266 | node | p1 node | p2 node | base node | link node |
1267 1267 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1268 1268 | | | | | |
1269 1269 +------------------------------------------------------------------+
1270 1270
1271 1271 Version 3 (headerlen=102):
1272 1272
1273 1273 +------------------------------------------------------------------------------+
1274 1274 | | | | | | |
1275 1275 | node | p1 node | p2 node | base node | link node | flags |
1276 1276 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1277 1277 | | | | | | |
1278 1278 +------------------------------------------------------------------------------+
1279 1279
1280 1280 Version 4 (headerlen=103):
1281 1281
1282 1282 +------------------------------------------------------------------------------+----------+
1283 1283 | | | | | | | |
1284 1284 | node | p1 node | p2 node | base node | link node | flags | pflags |
1285 1285 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | (1 byte) |
1286 1286 | | | | | | | |
1287 1287 +------------------------------------------------------------------------------+----------+
1288 1288
1289 1289 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1290 1290 contain a series of *delta*s, densely packed (no separators). These deltas
1291 1291 describe a diff from an existing entry (either that the recipient already
1292 1292 has, or previously specified in the bundle/changegroup). The format is
1293 1293 described more fully in "hg help internals.bdiff", but briefly:
1294 1294
1295 1295 +---------------------------------------------------------------+
1296 1296 | | | | |
1297 1297 | start offset | end offset | new length | content |
1298 1298 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1299 1299 | | | | |
1300 1300 +---------------------------------------------------------------+
1301 1301
1302 1302 Please note that the length field in the delta data does *not* include
1303 1303 itself.
1304 1304
1305 1305 In version 1, the delta is always applied against the previous node from
1306 1306 the changegroup or the first parent if this is the first entry in the
1307 1307 changegroup.
1308 1308
1309 1309 In version 2 and up, the delta base node is encoded in the entry in the
1310 1310 changegroup. This allows the delta to be expressed against any parent,
1311 1311 which can result in smaller deltas and more efficient encoding of data.
1312 1312
1313 1313 The *flags* field holds bitwise flags affecting the processing of revision
1314 1314 data. The following flags are defined:
1315 1315
1316 1316 32768
1317 1317 Censored revision. The revision's fulltext has been replaced by censor
1318 1318 metadata. May only occur on file revisions.
1319 1319
1320 1320 16384
1321 1321 Ellipsis revision. Revision hash does not match data (likely due to
1322 1322 rewritten parents).
1323 1323
1324 1324 8192
1325 1325 Externally stored. The revision fulltext contains "key:value" "\n"
1326 1326 delimited metadata defining an object stored elsewhere. Used by the LFS
1327 1327 extension.
1328 1328
1329 1329 4096
1330 1330 Contains copy information. This revision changes files in a way that
1331 1331 could affect copy tracing. This does *not* affect changegroup handling,
1332 1332 but is relevant for other parts of Mercurial.
1333 1333
1334 1334 For historical reasons, the integer values are identical to revlog version
1335 1335 1 per-revision storage flags and correspond to bits being set in this
1336 1336 2-byte field. Bits were allocated starting from the most-significant bit,
1337 1337 hence the reverse ordering and allocation of these flags.
1338 1338
1339 1339 The *pflags* (protocol flags) field holds bitwise flags affecting the
1340 1340 protocol itself. They are first in the header since they may affect the
1341 1341 handling of the rest of the fields in a future version. They are defined
1342 1342 as such:
1343 1343
1344 1344 1 indicates whether to read a chunk of sidedata (of variable length) right
1345 1345 after the revision flags.
1346 1346
1347 1347 Changeset Segment
1348 1348 =================
1349 1349
1350 1350 The *changeset segment* consists of a single *delta group* holding
1351 1351 changelog data. The *empty chunk* at the end of the *delta group* denotes
1352 1352 the boundary to the *manifest segment*.
1353 1353
1354 1354 Manifest Segment
1355 1355 ================
1356 1356
1357 1357 The *manifest segment* consists of a single *delta group* holding manifest
1358 1358 data. If treemanifests are in use, it contains only the manifest for the
1359 1359 root directory of the repository. Otherwise, it contains the entire
1360 1360 manifest data. The *empty chunk* at the end of the *delta group* denotes
1361 1361 the boundary to the next segment (either the *treemanifests segment* or
1362 1362 the *filelogs segment*, depending on version and the request options).
1363 1363
1364 1364 Treemanifests Segment
1365 1365 ---------------------
1366 1366
1367 1367 The *treemanifests segment* only exists in changegroup version "3" and
1368 1368 "4", and only if the 'treemanifest' param is part of the bundle2
1369 1369 changegroup part (it is not possible to use changegroup version 3 or 4
1370 1370 outside of bundle2). Aside from the filenames in the *treemanifests
1371 1371 segment* containing a trailing "/" character, it behaves identically to
1372 1372 the *filelogs segment* (see below). The final sub-segment is followed by
1373 1373 an *empty chunk* (logically, a sub-segment with filename size 0). This
1374 1374 denotes the boundary to the *filelogs segment*.
1375 1375
1376 1376 Filelogs Segment
1377 1377 ================
1378 1378
1379 1379 The *filelogs segment* consists of multiple sub-segments, each
1380 1380 corresponding to an individual file whose data is being described:
1381 1381
1382 1382 +--------------------------------------------------+
1383 1383 | | | | | |
1384 1384 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1385 1385 | | | | | (4 bytes) |
1386 1386 | | | | | |
1387 1387 +--------------------------------------------------+
1388 1388
1389 1389 The final filelog sub-segment is followed by an *empty chunk* (logically,
1390 1390 a sub-segment with filename size 0). This denotes the end of the segment
1391 1391 and of the overall changegroup.
1392 1392
1393 1393 Each filelog sub-segment consists of the following:
1394 1394
1395 1395 +------------------------------------------------------+
1396 1396 | | | |
1397 1397 | filename length | filename | delta group |
1398 1398 | (4 bytes) | (<length - 4> bytes) | (various) |
1399 1399 | | | |
1400 1400 +------------------------------------------------------+
1401 1401
1402 1402 That is, a *chunk* consisting of the filename (not terminated or padded)
1403 1403 followed by N chunks constituting the *delta group* for this file. The
1404 1404 *empty chunk* at the end of each *delta group* denotes the boundary to the
1405 1405 next filelog sub-segment.
1406 1406
1407 1407 non-existent subtopics print an error
1408 1408
1409 1409 $ hg help internals.foo
1410 1410 abort: no such help topic: internals.foo
1411 1411 (try 'hg help --keyword foo')
1412 1412 [10]
1413 1413
1414 1414 test advanced, deprecated and experimental options are hidden in command help
1415 1415 $ hg help debugoptADV
1416 1416 hg debugoptADV
1417 1417
1418 1418 (no help text available)
1419 1419
1420 1420 options:
1421 1421
1422 1422 (some details hidden, use --verbose to show complete help)
1423 1423 $ hg help debugoptDEP
1424 1424 hg debugoptDEP
1425 1425
1426 1426 (no help text available)
1427 1427
1428 1428 options:
1429 1429
1430 1430 (some details hidden, use --verbose to show complete help)
1431 1431
1432 1432 $ hg help debugoptEXP
1433 1433 hg debugoptEXP
1434 1434
1435 1435 (no help text available)
1436 1436
1437 1437 options:
1438 1438
1439 1439 (some details hidden, use --verbose to show complete help)
1440 1440
1441 1441 test advanced, deprecated and experimental options are shown with -v
1442 1442 $ hg help -v debugoptADV | grep aopt
1443 1443 --aopt option is (ADVANCED)
1444 1444 $ hg help -v debugoptDEP | grep dopt
1445 1445 --dopt option is (DEPRECATED)
1446 1446 $ hg help -v debugoptEXP | grep eopt
1447 1447 --eopt option is (EXPERIMENTAL)
1448 1448
1449 1449 #if gettext
1450 1450 test deprecated option is hidden with translation with untranslated description
1451 1451 (use many globy for not failing on changed transaction)
1452 1452 $ LANGUAGE=sv hg help debugoptDEP
1453 1453 hg debugoptDEP
1454 1454
1455 1455 (*) (glob)
1456 1456
1457 1457 options:
1458 1458
1459 1459 (some details hidden, use --verbose to show complete help)
1460 1460 #endif
1461 1461
1462 1462 Test commands that collide with topics (issue4240)
1463 1463
1464 1464 $ hg config -hq
1465 1465 hg config [-u] [NAME]...
1466 1466
1467 1467 show combined config settings from all hgrc files
1468 1468 $ hg showconfig -hq
1469 1469 hg config [-u] [NAME]...
1470 1470
1471 1471 show combined config settings from all hgrc files
1472 1472
1473 1473 Test a help topic
1474 1474
1475 1475 $ hg help dates
1476 1476 Date Formats
1477 1477 """"""""""""
1478 1478
1479 1479 Some commands allow the user to specify a date, e.g.:
1480 1480
1481 1481 - backout, commit, import, tag: Specify the commit date.
1482 1482 - log, revert, update: Select revision(s) by date.
1483 1483
1484 1484 Many date formats are valid. Here are some examples:
1485 1485
1486 1486 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1487 1487 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1488 1488 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1489 1489 - "Dec 6" (midnight)
1490 1490 - "13:18" (today assumed)
1491 1491 - "3:39" (3:39AM assumed)
1492 1492 - "3:39pm" (15:39)
1493 1493 - "2006-12-06 13:18:29" (ISO 8601 format)
1494 1494 - "2006-12-6 13:18"
1495 1495 - "2006-12-6"
1496 1496 - "12-6"
1497 1497 - "12/6"
1498 1498 - "12/6/6" (Dec 6 2006)
1499 1499 - "today" (midnight)
1500 1500 - "yesterday" (midnight)
1501 1501 - "now" - right now
1502 1502
1503 1503 Lastly, there is Mercurial's internal format:
1504 1504
1505 1505 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1506 1506
1507 1507 This is the internal representation format for dates. The first number is
1508 1508 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1509 1509 is the offset of the local timezone, in seconds west of UTC (negative if
1510 1510 the timezone is east of UTC).
1511 1511
1512 1512 The log command also accepts date ranges:
1513 1513
1514 1514 - "<DATE" - at or before a given date/time
1515 1515 - ">DATE" - on or after a given date/time
1516 1516 - "DATE to DATE" - a date range, inclusive
1517 1517 - "-DAYS" - within a given number of days from today
1518 1518
1519 1519 Test repeated config section name
1520 1520
1521 1521 $ hg help config.host
1522 1522 "http_proxy.host"
1523 1523 Host name and (optional) port of the proxy server, for example
1524 1524 "myproxy:8000".
1525 1525
1526 1526 "smtp.host"
1527 1527 Host name of mail server, e.g. "mail.example.com".
1528 1528
1529 1529
1530 1530 Test section name with dot
1531 1531
1532 1532 $ hg help config.ui.username
1533 1533 "ui.username"
1534 1534 The committer of a changeset created when running "commit". Typically
1535 1535 a person's name and email address, e.g. "Fred Widget
1536 1536 <fred@example.com>". Environment variables in the username are
1537 1537 expanded.
1538 1538
1539 1539 (default: "$EMAIL" or "username@hostname". If the username in hgrc is
1540 1540 empty, e.g. if the system admin set "username =" in the system hgrc,
1541 1541 it has to be specified manually or in a different hgrc file)
1542 1542
1543 1543
1544 1544 $ hg help config.annotate.git
1545 1545 abort: help section not found: config.annotate.git
1546 1546 [10]
1547 1547
1548 1548 $ hg help config.update.check
1549 1549 "commands.update.check"
1550 1550 Determines what level of checking 'hg update' will perform before
1551 1551 moving to a destination revision. Valid values are "abort", "none",
1552 1552 "linear", and "noconflict".
1553 1553
1554 1554 - "abort" always fails if the working directory has uncommitted
1555 1555 changes.
1556 1556 - "none" performs no checking, and may result in a merge with
1557 1557 uncommitted changes.
1558 1558 - "linear" allows any update as long as it follows a straight line in
1559 1559 the revision history, and may trigger a merge with uncommitted
1560 1560 changes.
1561 1561 - "noconflict" will allow any update which would not trigger a merge
1562 1562 with uncommitted changes, if any are present.
1563 1563
1564 1564 (default: "linear")
1565 1565
1566 1566
1567 1567 $ hg help config.commands.update.check
1568 1568 "commands.update.check"
1569 1569 Determines what level of checking 'hg update' will perform before
1570 1570 moving to a destination revision. Valid values are "abort", "none",
1571 1571 "linear", and "noconflict".
1572 1572
1573 1573 - "abort" always fails if the working directory has uncommitted
1574 1574 changes.
1575 1575 - "none" performs no checking, and may result in a merge with
1576 1576 uncommitted changes.
1577 1577 - "linear" allows any update as long as it follows a straight line in
1578 1578 the revision history, and may trigger a merge with uncommitted
1579 1579 changes.
1580 1580 - "noconflict" will allow any update which would not trigger a merge
1581 1581 with uncommitted changes, if any are present.
1582 1582
1583 1583 (default: "linear")
1584 1584
1585 1585
1586 1586 $ hg help config.ommands.update.check
1587 1587 abort: help section not found: config.ommands.update.check
1588 1588 [10]
1589 1589
1590 1590 Unrelated trailing paragraphs shouldn't be included
1591 1591
1592 1592 $ hg help config.extramsg | grep '^$'
1593 1593
1594 1594
1595 1595 Test capitalized section name
1596 1596
1597 1597 $ hg help scripting.HGPLAIN > /dev/null
1598 1598
1599 1599 Help subsection:
1600 1600
1601 1601 $ hg help config.charsets |grep "Email example:" > /dev/null
1602 1602 [1]
1603 1603
1604 1604 Show nested definitions
1605 1605 ("profiling.type"[break]"ls"[break]"stat"[break])
1606 1606
1607 1607 $ hg help config.type | grep -E '^$'|wc -l
1608 \s*3 (re)
1608 \s*4 (re)
1609 1609
1610 1610 $ hg help config.profiling.type.ls
1611 1611 "profiling.type.ls"
1612 1612 Use Python's built-in instrumenting profiler. This profiler works on
1613 1613 all platforms, but each line number it reports is the first line of
1614 1614 a function. This restriction makes it difficult to identify the
1615 1615 expensive parts of a non-trivial function.
1616 1616
1617 1617
1618 1618 Separate sections from subsections
1619 1619
1620 1620 $ hg help config.format | grep -E '^ ("|-)|^\s*$' | uniq
1621 1621 "format"
1622 1622 --------
1623 1623
1624 1624 "usegeneraldelta"
1625 1625
1626 1626 "dotencode"
1627 1627
1628 1628 "usefncache"
1629 1629
1630 1630 "use-dirstate-v2"
1631 1631
1632 1632 "use-dirstate-v2.automatic-upgrade-of-mismatching-repositories"
1633 1633
1634 1634 "use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet"
1635 1635
1636 1636 "use-dirstate-tracked-hint"
1637 1637
1638 1638 "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories"
1639 1639
1640 1640 "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet"
1641 1641
1642 1642 "use-persistent-nodemap"
1643 1643
1644 1644 "use-share-safe"
1645 1645
1646 1646 "use-share-safe.automatic-upgrade-of-mismatching-repositories"
1647 1647
1648 1648 "use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet"
1649 1649
1650 1650 "usestore"
1651 1651
1652 1652 "sparse-revlog"
1653 1653
1654 1654 "revlog-compression"
1655 1655
1656 1656 "bookmarks-in-store"
1657 1657
1658 1658 "profiling"
1659 1659 -----------
1660 1660
1661 1661 "format"
1662 1662
1663 1663 "progress"
1664 1664 ----------
1665 1665
1666 1666 "format"
1667 1667
1668 1668
1669 1669 Last item in help config.*:
1670 1670
1671 1671 $ hg help config.`hg help config|grep '^ "'| \
1672 1672 > tail -1|sed 's![ "]*!!g'`| \
1673 1673 > grep 'hg help -c config' > /dev/null
1674 1674 [1]
1675 1675
1676 1676 note to use help -c for general hg help config:
1677 1677
1678 1678 $ hg help config |grep 'hg help -c config' > /dev/null
1679 1679
1680 1680 Test templating help
1681 1681
1682 1682 $ hg help templating | grep -E '(desc|diffstat|firstline|nonempty) '
1683 1683 desc String. The text of the changeset description.
1684 1684 diffstat String. Statistics of changes with the following format:
1685 1685 firstline Any text. Returns the first line of text.
1686 1686 nonempty Any text. Returns '(none)' if the string is empty.
1687 1687
1688 1688 Test deprecated items
1689 1689
1690 1690 $ hg help -v templating | grep currentbookmark
1691 1691 currentbookmark
1692 1692 $ hg help templating | (grep currentbookmark || true)
1693 1693
1694 1694 Test help hooks
1695 1695
1696 1696 $ cat > helphook1.py <<EOF
1697 1697 > from mercurial import help
1698 1698 >
1699 1699 > def rewrite(ui, topic, doc):
1700 1700 > return doc + b'\nhelphook1\n'
1701 1701 >
1702 1702 > def extsetup(ui):
1703 1703 > help.addtopichook(b'revisions', rewrite)
1704 1704 > EOF
1705 1705 $ cat > helphook2.py <<EOF
1706 1706 > from mercurial import help
1707 1707 >
1708 1708 > def rewrite(ui, topic, doc):
1709 1709 > return doc + b'\nhelphook2\n'
1710 1710 >
1711 1711 > def extsetup(ui):
1712 1712 > help.addtopichook(b'revisions', rewrite)
1713 1713 > EOF
1714 1714 $ echo '[extensions]' >> $HGRCPATH
1715 1715 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1716 1716 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1717 1717 $ hg help revsets | grep helphook
1718 1718 helphook1
1719 1719 helphook2
1720 1720
1721 1721 help -c should only show debug --debug
1722 1722
1723 1723 $ hg help -c --debug|grep -E debug|wc -l|grep -E '^\s*0\s*$'
1724 1724 [1]
1725 1725
1726 1726 help -c should only show deprecated for -v
1727 1727
1728 1728 $ hg help -c -v|grep -E DEPRECATED|wc -l|grep -E '^\s*0\s*$'
1729 1729 [1]
1730 1730
1731 1731 Test -s / --system
1732 1732
1733 1733 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1734 1734 > wc -l | sed -e 's/ //g'
1735 1735 0
1736 1736 $ hg help config.files --system unix | grep 'USER' | \
1737 1737 > wc -l | sed -e 's/ //g'
1738 1738 0
1739 1739
1740 1740 Test -e / -c / -k combinations
1741 1741
1742 1742 $ hg help -c|grep -E '^[A-Z].*:|^ debug'
1743 1743 Commands:
1744 1744 $ hg help -e|grep -E '^[A-Z].*:|^ debug'
1745 1745 Extensions:
1746 1746 $ hg help -k|grep -E '^[A-Z].*:|^ debug'
1747 1747 Topics:
1748 1748 Commands:
1749 1749 Extensions:
1750 1750 Extension Commands:
1751 1751 $ hg help -c schemes
1752 1752 abort: no such help topic: schemes
1753 1753 (try 'hg help --keyword schemes')
1754 1754 [10]
1755 1755 $ hg help -e schemes |head -1
1756 1756 schemes extension - extend schemes with shortcuts to repository swarms
1757 1757 $ hg help -c -k dates |grep -E '^(Topics|Extensions|Commands):'
1758 1758 Commands:
1759 1759 $ hg help -e -k a |grep -E '^(Topics|Extensions|Commands):'
1760 1760 Extensions:
1761 1761 $ hg help -e -c -k date |grep -E '^(Topics|Extensions|Commands):'
1762 1762 Extensions:
1763 1763 Commands:
1764 1764 $ hg help -c commit > /dev/null
1765 1765 $ hg help -e -c commit > /dev/null
1766 1766 $ hg help -e commit
1767 1767 abort: no such help topic: commit
1768 1768 (try 'hg help --keyword commit')
1769 1769 [10]
1770 1770
1771 1771 Test keyword search help
1772 1772
1773 1773 $ cat > prefixedname.py <<EOF
1774 1774 > '''matched against word "clone"
1775 1775 > '''
1776 1776 > EOF
1777 1777 $ echo '[extensions]' >> $HGRCPATH
1778 1778 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1779 1779 $ hg help -k clone
1780 1780 Topics:
1781 1781
1782 1782 config Configuration Files
1783 1783 extensions Using Additional Features
1784 1784 glossary Glossary
1785 1785 phases Working with Phases
1786 1786 subrepos Subrepositories
1787 1787 urls URL Paths
1788 1788
1789 1789 Commands:
1790 1790
1791 1791 bookmarks create a new bookmark or list existing bookmarks
1792 1792 clone make a copy of an existing repository
1793 1793 paths show aliases for remote repositories
1794 1794 pull pull changes from the specified source
1795 1795 update update working directory (or switch revisions)
1796 1796
1797 1797 Extensions:
1798 1798
1799 1799 clonebundles advertise pre-generated bundles to seed clones
1800 1800 narrow create clones which fetch history data for subset of files
1801 1801 (EXPERIMENTAL)
1802 1802 prefixedname matched against word "clone"
1803 1803 relink recreates hardlinks between repository clones
1804 1804
1805 1805 Extension Commands:
1806 1806
1807 1807 admin::clone-bundles-clear remove existing clone bundle caches
1808 1808 admin::clone-bundles-refresh generate clone bundles according to the
1809 1809 configuration
1810 1810 qclone clone main and patch repository at same time
1811 1811
1812 1812 Test unfound topic
1813 1813
1814 1814 $ hg help nonexistingtopicthatwillneverexisteverever
1815 1815 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1816 1816 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1817 1817 [10]
1818 1818
1819 1819 Test unfound keyword
1820 1820
1821 1821 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1822 1822 abort: no matches
1823 1823 (try 'hg help' for a list of topics)
1824 1824 [10]
1825 1825
1826 1826 Test omit indicating for help
1827 1827
1828 1828 $ cat > addverboseitems.py <<EOF
1829 1829 > r'''extension to test omit indicating.
1830 1830 >
1831 1831 > This paragraph is never omitted (for extension)
1832 1832 >
1833 1833 > .. container:: verbose
1834 1834 >
1835 1835 > This paragraph is omitted,
1836 1836 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1837 1837 >
1838 1838 > This paragraph is never omitted, too (for extension)
1839 1839 > '''
1840 1840 > from mercurial import commands, help
1841 1841 > testtopic = br"""This paragraph is never omitted (for topic).
1842 1842 >
1843 1843 > .. container:: verbose
1844 1844 >
1845 1845 > This paragraph is omitted,
1846 1846 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1847 1847 >
1848 1848 > This paragraph is never omitted, too (for topic)
1849 1849 > """
1850 1850 > def extsetup(ui):
1851 1851 > help.helptable.append(([b"topic-containing-verbose"],
1852 1852 > b"This is the topic to test omit indicating.",
1853 1853 > lambda ui: testtopic))
1854 1854 > EOF
1855 1855 $ echo '[extensions]' >> $HGRCPATH
1856 1856 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1857 1857 $ hg help addverboseitems
1858 1858 addverboseitems extension - extension to test omit indicating.
1859 1859
1860 1860 This paragraph is never omitted (for extension)
1861 1861
1862 1862 This paragraph is never omitted, too (for extension)
1863 1863
1864 1864 (some details hidden, use --verbose to show complete help)
1865 1865
1866 1866 no commands defined
1867 1867 $ hg help -v addverboseitems
1868 1868 addverboseitems extension - extension to test omit indicating.
1869 1869
1870 1870 This paragraph is never omitted (for extension)
1871 1871
1872 1872 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1873 1873 extension)
1874 1874
1875 1875 This paragraph is never omitted, too (for extension)
1876 1876
1877 1877 no commands defined
1878 1878 $ hg help topic-containing-verbose
1879 1879 This is the topic to test omit indicating.
1880 1880 """"""""""""""""""""""""""""""""""""""""""
1881 1881
1882 1882 This paragraph is never omitted (for topic).
1883 1883
1884 1884 This paragraph is never omitted, too (for topic)
1885 1885
1886 1886 (some details hidden, use --verbose to show complete help)
1887 1887 $ hg help -v topic-containing-verbose
1888 1888 This is the topic to test omit indicating.
1889 1889 """"""""""""""""""""""""""""""""""""""""""
1890 1890
1891 1891 This paragraph is never omitted (for topic).
1892 1892
1893 1893 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1894 1894 topic)
1895 1895
1896 1896 This paragraph is never omitted, too (for topic)
1897 1897
1898 1898 Test section lookup
1899 1899
1900 1900 $ hg help revset.merge
1901 1901 "merge()"
1902 1902 Changeset is a merge changeset.
1903 1903
1904 1904 $ hg help glossary.dag
1905 1905 DAG
1906 1906 The repository of changesets of a distributed version control system
1907 1907 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1908 1908 of nodes and edges, where nodes correspond to changesets and edges
1909 1909 imply a parent -> child relation. This graph can be visualized by
1910 1910 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1911 1911 limited by the requirement for children to have at most two parents.
1912 1912
1913 1913
1914 1914 $ hg help hgrc.paths
1915 1915 "paths"
1916 1916 -------
1917 1917
1918 1918 Assigns symbolic names and behavior to repositories.
1919 1919
1920 1920 Options are symbolic names defining the URL or directory that is the
1921 1921 location of the repository. Example:
1922 1922
1923 1923 [paths]
1924 1924 my_server = https://example.com/my_repo
1925 1925 local_path = /home/me/repo
1926 1926
1927 1927 These symbolic names can be used from the command line. To pull from
1928 1928 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1929 1929 local_path'. You can check 'hg help urls' for details about valid URLs.
1930 1930
1931 1931 Options containing colons (":") denote sub-options that can influence
1932 1932 behavior for that specific path. Example:
1933 1933
1934 1934 [paths]
1935 1935 my_server = https://example.com/my_path
1936 1936 my_server:pushurl = ssh://example.com/my_path
1937 1937
1938 1938 Paths using the 'path://otherpath' scheme will inherit the sub-options
1939 1939 value from the path they point to.
1940 1940
1941 1941 The following sub-options can be defined:
1942 1942
1943 1943 "multi-urls"
1944 1944 A boolean option. When enabled the value of the '[paths]' entry will be
1945 1945 parsed as a list and the alias will resolve to multiple destination. If
1946 1946 some of the list entry use the 'path://' syntax, the suboption will be
1947 1947 inherited individually.
1948 1948
1949 1949 "pushurl"
1950 1950 The URL to use for push operations. If not defined, the location
1951 1951 defined by the path's main entry is used.
1952 1952
1953 1953 "pushrev"
1954 1954 A revset defining which revisions to push by default.
1955 1955
1956 1956 When 'hg push' is executed without a "-r" argument, the revset defined
1957 1957 by this sub-option is evaluated to determine what to push.
1958 1958
1959 1959 For example, a value of "." will push the working directory's revision
1960 1960 by default.
1961 1961
1962 1962 Revsets specifying bookmarks will not result in the bookmark being
1963 1963 pushed.
1964 1964
1965 1965 "bookmarks.mode"
1966 1966 How bookmark will be dealt during the exchange. It support the following
1967 1967 value
1968 1968
1969 1969 - "default": the default behavior, local and remote bookmarks are
1970 1970 "merged" on push/pull.
1971 1971 - "mirror": when pulling, replace local bookmarks by remote bookmarks.
1972 1972 This is useful to replicate a repository, or as an optimization.
1973 1973 - "ignore": ignore bookmarks during exchange. (This currently only
1974 1974 affect pulling)
1975 1975
1976 1976 The following special named paths exist:
1977 1977
1978 1978 "default"
1979 1979 The URL or directory to use when no source or remote is specified.
1980 1980
1981 1981 'hg clone' will automatically define this path to the location the
1982 1982 repository was cloned from.
1983 1983
1984 1984 "default-push"
1985 1985 (deprecated) The URL or directory for the default 'hg push' location.
1986 1986 "default:pushurl" should be used instead.
1987 1987
1988 1988 $ hg help glossary.mcguffin
1989 1989 abort: help section not found: glossary.mcguffin
1990 1990 [10]
1991 1991
1992 1992 $ hg help glossary.mc.guffin
1993 1993 abort: help section not found: glossary.mc.guffin
1994 1994 [10]
1995 1995
1996 1996 $ hg help template.files
1997 1997 files List of strings. All files modified, added, or removed by
1998 1998 this changeset.
1999 1999 files(pattern)
2000 2000 All files of the current changeset matching the pattern. See
2001 2001 'hg help patterns'.
2002 2002
2003 2003 Test section lookup by translated message
2004 2004
2005 2005 str.lower() instead of encoding.lower(str) on translated message might
2006 2006 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
2007 2007 as the second or later byte of multi-byte character.
2008 2008
2009 2009 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
2010 2010 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
2011 2011 replacement makes message meaningless.
2012 2012
2013 2013 This tests that section lookup by translated string isn't broken by
2014 2014 such str.lower().
2015 2015
2016 2016 $ "$PYTHON" <<EOF
2017 2017 > def escape(s):
2018 2018 > return b''.join(br'\\u%x' % ord(uc) for uc in s.decode('cp932'))
2019 2019 > # translation of "record" in ja_JP.cp932
2020 2020 > upper = b"\x8bL\x98^"
2021 2021 > # str.lower()-ed section name should be treated as different one
2022 2022 > lower = b"\x8bl\x98^"
2023 2023 > with open('ambiguous.py', 'wb') as fp:
2024 2024 > fp.write(b"""# ambiguous section names in ja_JP.cp932
2025 2025 > u'''summary of extension
2026 2026 >
2027 2027 > %s
2028 2028 > ----
2029 2029 >
2030 2030 > Upper name should show only this message
2031 2031 >
2032 2032 > %s
2033 2033 > ----
2034 2034 >
2035 2035 > Lower name should show only this message
2036 2036 >
2037 2037 > subsequent section
2038 2038 > ------------------
2039 2039 >
2040 2040 > This should be hidden at 'hg help ambiguous' with section name.
2041 2041 > '''
2042 2042 > """ % (escape(upper), escape(lower)))
2043 2043 > EOF
2044 2044
2045 2045 $ cat >> $HGRCPATH <<EOF
2046 2046 > [extensions]
2047 2047 > ambiguous = ./ambiguous.py
2048 2048 > EOF
2049 2049
2050 2050 $ "$PYTHON" <<EOF | sh
2051 2051 > from mercurial.utils import procutil
2052 2052 > upper = b"\x8bL\x98^"
2053 2053 > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % upper)
2054 2054 > EOF
2055 2055 \x8bL\x98^ (esc)
2056 2056 ----
2057 2057
2058 2058 Upper name should show only this message
2059 2059
2060 2060
2061 2061 $ "$PYTHON" <<EOF | sh
2062 2062 > from mercurial.utils import procutil
2063 2063 > lower = b"\x8bl\x98^"
2064 2064 > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % lower)
2065 2065 > EOF
2066 2066 \x8bl\x98^ (esc)
2067 2067 ----
2068 2068
2069 2069 Lower name should show only this message
2070 2070
2071 2071
2072 2072 $ cat >> $HGRCPATH <<EOF
2073 2073 > [extensions]
2074 2074 > ambiguous = !
2075 2075 > EOF
2076 2076
2077 2077 Show help content of disabled extensions
2078 2078
2079 2079 $ cat >> $HGRCPATH <<EOF
2080 2080 > [extensions]
2081 2081 > ambiguous = !./ambiguous.py
2082 2082 > EOF
2083 2083 $ hg help -e ambiguous
2084 2084 ambiguous extension - (no help text available)
2085 2085
2086 2086 (use 'hg help extensions' for information on enabling extensions)
2087 2087
2088 2088 Test dynamic list of merge tools only shows up once
2089 2089 $ hg help merge-tools
2090 2090 Merge Tools
2091 2091 """""""""""
2092 2092
2093 2093 To merge files Mercurial uses merge tools.
2094 2094
2095 2095 A merge tool combines two different versions of a file into a merged file.
2096 2096 Merge tools are given the two files and the greatest common ancestor of
2097 2097 the two file versions, so they can determine the changes made on both
2098 2098 branches.
2099 2099
2100 2100 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
2101 2101 backout' and in several extensions.
2102 2102
2103 2103 Usually, the merge tool tries to automatically reconcile the files by
2104 2104 combining all non-overlapping changes that occurred separately in the two
2105 2105 different evolutions of the same initial base file. Furthermore, some
2106 2106 interactive merge programs make it easier to manually resolve conflicting
2107 2107 merges, either in a graphical way, or by inserting some conflict markers.
2108 2108 Mercurial does not include any interactive merge programs but relies on
2109 2109 external tools for that.
2110 2110
2111 2111 Available merge tools
2112 2112 =====================
2113 2113
2114 2114 External merge tools and their properties are configured in the merge-
2115 2115 tools configuration section - see hgrc(5) - but they can often just be
2116 2116 named by their executable.
2117 2117
2118 2118 A merge tool is generally usable if its executable can be found on the
2119 2119 system and if it can handle the merge. The executable is found if it is an
2120 2120 absolute or relative executable path or the name of an application in the
2121 2121 executable search path. The tool is assumed to be able to handle the merge
2122 2122 if it can handle symlinks if the file is a symlink, if it can handle
2123 2123 binary files if the file is binary, and if a GUI is available if the tool
2124 2124 requires a GUI.
2125 2125
2126 2126 There are some internal merge tools which can be used. The internal merge
2127 2127 tools are:
2128 2128
2129 2129 ":dump"
2130 2130 Creates three versions of the files to merge, containing the contents of
2131 2131 local, other and base. These files can then be used to perform a merge
2132 2132 manually. If the file to be merged is named "a.txt", these files will
2133 2133 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
2134 2134 they will be placed in the same directory as "a.txt".
2135 2135
2136 2136 This implies premerge. Therefore, files aren't dumped, if premerge runs
2137 2137 successfully. Use :forcedump to forcibly write files out.
2138 2138
2139 2139 (actual capabilities: binary, symlink)
2140 2140
2141 2141 ":fail"
2142 2142 Rather than attempting to merge files that were modified on both
2143 2143 branches, it marks them as unresolved. The resolve command must be used
2144 2144 to resolve these conflicts.
2145 2145
2146 2146 (actual capabilities: binary, symlink)
2147 2147
2148 2148 ":forcedump"
2149 2149 Creates three versions of the files as same as :dump, but omits
2150 2150 premerge.
2151 2151
2152 2152 (actual capabilities: binary, symlink)
2153 2153
2154 2154 ":local"
2155 2155 Uses the local 'p1()' version of files as the merged version.
2156 2156
2157 2157 (actual capabilities: binary, symlink)
2158 2158
2159 2159 ":merge"
2160 2160 Uses the internal non-interactive simple merge algorithm for merging
2161 2161 files. It will fail if there are any conflicts and leave markers in the
2162 2162 partially merged file. Markers will have two sections, one for each side
2163 2163 of merge.
2164 2164
2165 2165 ":merge-local"
2166 2166 Like :merge, but resolve all conflicts non-interactively in favor of the
2167 2167 local 'p1()' changes.
2168 2168
2169 2169 ":merge-other"
2170 2170 Like :merge, but resolve all conflicts non-interactively in favor of the
2171 2171 other 'p2()' changes.
2172 2172
2173 2173 ":merge3"
2174 2174 Uses the internal non-interactive simple merge algorithm for merging
2175 2175 files. It will fail if there are any conflicts and leave markers in the
2176 2176 partially merged file. Marker will have three sections, one from each
2177 2177 side of the merge and one for the base content.
2178 2178
2179 2179 ":mergediff"
2180 2180 Uses the internal non-interactive simple merge algorithm for merging
2181 2181 files. It will fail if there are any conflicts and leave markers in the
2182 2182 partially merged file. The marker will have two sections, one with the
2183 2183 content from one side of the merge, and one with a diff from the base
2184 2184 content to the content on the other side. (experimental)
2185 2185
2186 2186 ":other"
2187 2187 Uses the other 'p2()' version of files as the merged version.
2188 2188
2189 2189 (actual capabilities: binary, symlink)
2190 2190
2191 2191 ":prompt"
2192 2192 Asks the user which of the local 'p1()' or the other 'p2()' version to
2193 2193 keep as the merged version.
2194 2194
2195 2195 (actual capabilities: binary, symlink)
2196 2196
2197 2197 ":tagmerge"
2198 2198 Uses the internal tag merge algorithm (experimental).
2199 2199
2200 2200 ":union"
2201 2201 Uses the internal non-interactive simple merge algorithm for merging
2202 2202 files. It will use both local and other sides for conflict regions by
2203 2203 adding local on top of other. No markers are inserted.
2204 2204
2205 2205 ":union-other-first"
2206 2206 Like :union, but add other on top of local.
2207 2207
2208 2208 Internal tools are always available and do not require a GUI but will by
2209 2209 default not handle symlinks or binary files. See next section for detail
2210 2210 about "actual capabilities" described above.
2211 2211
2212 2212 Choosing a merge tool
2213 2213 =====================
2214 2214
2215 2215 Mercurial uses these rules when deciding which merge tool to use:
2216 2216
2217 2217 1. If a tool has been specified with the --tool option to merge or
2218 2218 resolve, it is used. If it is the name of a tool in the merge-tools
2219 2219 configuration, its configuration is used. Otherwise the specified tool
2220 2220 must be executable by the shell.
2221 2221 2. If the "HGMERGE" environment variable is present, its value is used and
2222 2222 must be executable by the shell.
2223 2223 3. If the filename of the file to be merged matches any of the patterns in
2224 2224 the merge-patterns configuration section, the first usable merge tool
2225 2225 corresponding to a matching pattern is used.
2226 2226 4. If ui.merge is set it will be considered next. If the value is not the
2227 2227 name of a configured tool, the specified value is used and must be
2228 2228 executable by the shell. Otherwise the named tool is used if it is
2229 2229 usable.
2230 2230 5. If any usable merge tools are present in the merge-tools configuration
2231 2231 section, the one with the highest priority is used.
2232 2232 6. If a program named "hgmerge" can be found on the system, it is used -
2233 2233 but it will by default not be used for symlinks and binary files.
2234 2234 7. If the file to be merged is not binary and is not a symlink, then
2235 2235 internal ":merge" is used.
2236 2236 8. Otherwise, ":prompt" is used.
2237 2237
2238 2238 For historical reason, Mercurial treats merge tools as below while
2239 2239 examining rules above.
2240 2240
2241 2241 step specified via binary symlink
2242 2242 ----------------------------------
2243 2243 1. --tool o/o o/o
2244 2244 2. HGMERGE o/o o/o
2245 2245 3. merge-patterns o/o(*) x/?(*)
2246 2246 4. ui.merge x/?(*) x/?(*)
2247 2247
2248 2248 Each capability column indicates Mercurial behavior for internal/external
2249 2249 merge tools at examining each rule.
2250 2250
2251 2251 - "o": "assume that a tool has capability"
2252 2252 - "x": "assume that a tool does not have capability"
2253 2253 - "?": "check actual capability of a tool"
2254 2254
2255 2255 If "merge.strict-capability-check" configuration is true, Mercurial checks
2256 2256 capabilities of merge tools strictly in (*) cases above (= each capability
2257 2257 column becomes "?/?"). It is false by default for backward compatibility.
2258 2258
2259 2259 Note:
2260 2260 After selecting a merge program, Mercurial will by default attempt to
2261 2261 merge the files using a simple merge algorithm first. Only if it
2262 2262 doesn't succeed because of conflicting changes will Mercurial actually
2263 2263 execute the merge program. Whether to use the simple merge algorithm
2264 2264 first can be controlled by the premerge setting of the merge tool.
2265 2265 Premerge is enabled by default unless the file is binary or a symlink.
2266 2266
2267 2267 See the merge-tools and ui sections of hgrc(5) for details on the
2268 2268 configuration of merge tools.
2269 2269
2270 2270 Compression engines listed in `hg help bundlespec`
2271 2271
2272 2272 $ hg help bundlespec | grep gzip
2273 2273 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
2274 2274 An algorithm that produces smaller bundles than "gzip".
2275 2275 This engine will likely produce smaller bundles than "gzip" but will be
2276 2276 "gzip"
2277 2277 better compression than "gzip". It also frequently yields better (?)
2278 2278
2279 2279 Test usage of section marks in help documents
2280 2280
2281 2281 $ cd "$TESTDIR"/../doc
2282 2282 $ "$PYTHON" check-seclevel.py
2283 2283 $ cd $TESTTMP
2284 2284
2285 2285 #if serve
2286 2286
2287 2287 Test the help pages in hgweb.
2288 2288
2289 2289 Dish up an empty repo; serve it cold.
2290 2290
2291 2291 $ hg init "$TESTTMP/test"
2292 2292 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
2293 2293 $ cat hg.pid >> $DAEMON_PIDS
2294 2294
2295 2295 $ get-with-headers.py $LOCALIP:$HGPORT "help"
2296 2296 200 Script output follows
2297 2297
2298 2298 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2299 2299 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2300 2300 <head>
2301 2301 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2302 2302 <meta name="robots" content="index, nofollow" />
2303 2303 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2304 2304 <script type="text/javascript" src="/static/mercurial.js"></script>
2305 2305
2306 2306 <title>Help: Index</title>
2307 2307 </head>
2308 2308 <body>
2309 2309
2310 2310 <div class="container">
2311 2311 <div class="menu">
2312 2312 <div class="logo">
2313 2313 <a href="https://mercurial-scm.org/">
2314 2314 <img src="/static/hglogo.png" alt="mercurial" /></a>
2315 2315 </div>
2316 2316 <ul>
2317 2317 <li><a href="/shortlog">log</a></li>
2318 2318 <li><a href="/graph">graph</a></li>
2319 2319 <li><a href="/tags">tags</a></li>
2320 2320 <li><a href="/bookmarks">bookmarks</a></li>
2321 2321 <li><a href="/branches">branches</a></li>
2322 2322 </ul>
2323 2323 <ul>
2324 2324 <li class="active">help</li>
2325 2325 </ul>
2326 2326 </div>
2327 2327
2328 2328 <div class="main">
2329 2329 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2330 2330
2331 2331 <form class="search" action="/log">
2332 2332
2333 2333 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2334 2334 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2335 2335 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2336 2336 </form>
2337 2337 <table class="bigtable">
2338 2338 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
2339 2339
2340 2340 <tr><td>
2341 2341 <a href="/help/bundlespec">
2342 2342 bundlespec
2343 2343 </a>
2344 2344 </td><td>
2345 2345 Bundle File Formats
2346 2346 </td></tr>
2347 2347 <tr><td>
2348 2348 <a href="/help/color">
2349 2349 color
2350 2350 </a>
2351 2351 </td><td>
2352 2352 Colorizing Outputs
2353 2353 </td></tr>
2354 2354 <tr><td>
2355 2355 <a href="/help/config">
2356 2356 config
2357 2357 </a>
2358 2358 </td><td>
2359 2359 Configuration Files
2360 2360 </td></tr>
2361 2361 <tr><td>
2362 2362 <a href="/help/dates">
2363 2363 dates
2364 2364 </a>
2365 2365 </td><td>
2366 2366 Date Formats
2367 2367 </td></tr>
2368 2368 <tr><td>
2369 2369 <a href="/help/deprecated">
2370 2370 deprecated
2371 2371 </a>
2372 2372 </td><td>
2373 2373 Deprecated Features
2374 2374 </td></tr>
2375 2375 <tr><td>
2376 2376 <a href="/help/diffs">
2377 2377 diffs
2378 2378 </a>
2379 2379 </td><td>
2380 2380 Diff Formats
2381 2381 </td></tr>
2382 2382 <tr><td>
2383 2383 <a href="/help/environment">
2384 2384 environment
2385 2385 </a>
2386 2386 </td><td>
2387 2387 Environment Variables
2388 2388 </td></tr>
2389 2389 <tr><td>
2390 2390 <a href="/help/evolution">
2391 2391 evolution
2392 2392 </a>
2393 2393 </td><td>
2394 2394 Safely rewriting history (EXPERIMENTAL)
2395 2395 </td></tr>
2396 2396 <tr><td>
2397 2397 <a href="/help/extensions">
2398 2398 extensions
2399 2399 </a>
2400 2400 </td><td>
2401 2401 Using Additional Features
2402 2402 </td></tr>
2403 2403 <tr><td>
2404 2404 <a href="/help/filesets">
2405 2405 filesets
2406 2406 </a>
2407 2407 </td><td>
2408 2408 Specifying File Sets
2409 2409 </td></tr>
2410 2410 <tr><td>
2411 2411 <a href="/help/flags">
2412 2412 flags
2413 2413 </a>
2414 2414 </td><td>
2415 2415 Command-line flags
2416 2416 </td></tr>
2417 2417 <tr><td>
2418 2418 <a href="/help/glossary">
2419 2419 glossary
2420 2420 </a>
2421 2421 </td><td>
2422 2422 Glossary
2423 2423 </td></tr>
2424 2424 <tr><td>
2425 2425 <a href="/help/hgignore">
2426 2426 hgignore
2427 2427 </a>
2428 2428 </td><td>
2429 2429 Syntax for Mercurial Ignore Files
2430 2430 </td></tr>
2431 2431 <tr><td>
2432 2432 <a href="/help/hgweb">
2433 2433 hgweb
2434 2434 </a>
2435 2435 </td><td>
2436 2436 Configuring hgweb
2437 2437 </td></tr>
2438 2438 <tr><td>
2439 2439 <a href="/help/internals">
2440 2440 internals
2441 2441 </a>
2442 2442 </td><td>
2443 2443 Technical implementation topics
2444 2444 </td></tr>
2445 2445 <tr><td>
2446 2446 <a href="/help/merge-tools">
2447 2447 merge-tools
2448 2448 </a>
2449 2449 </td><td>
2450 2450 Merge Tools
2451 2451 </td></tr>
2452 2452 <tr><td>
2453 2453 <a href="/help/pager">
2454 2454 pager
2455 2455 </a>
2456 2456 </td><td>
2457 2457 Pager Support
2458 2458 </td></tr>
2459 2459 <tr><td>
2460 2460 <a href="/help/patterns">
2461 2461 patterns
2462 2462 </a>
2463 2463 </td><td>
2464 2464 File Name Patterns
2465 2465 </td></tr>
2466 2466 <tr><td>
2467 2467 <a href="/help/phases">
2468 2468 phases
2469 2469 </a>
2470 2470 </td><td>
2471 2471 Working with Phases
2472 2472 </td></tr>
2473 2473 <tr><td>
2474 2474 <a href="/help/revisions">
2475 2475 revisions
2476 2476 </a>
2477 2477 </td><td>
2478 2478 Specifying Revisions
2479 2479 </td></tr>
2480 2480 <tr><td>
2481 2481 <a href="/help/rust">
2482 2482 rust
2483 2483 </a>
2484 2484 </td><td>
2485 2485 Rust in Mercurial
2486 2486 </td></tr>
2487 2487 <tr><td>
2488 2488 <a href="/help/scripting">
2489 2489 scripting
2490 2490 </a>
2491 2491 </td><td>
2492 2492 Using Mercurial from scripts and automation
2493 2493 </td></tr>
2494 2494 <tr><td>
2495 2495 <a href="/help/subrepos">
2496 2496 subrepos
2497 2497 </a>
2498 2498 </td><td>
2499 2499 Subrepositories
2500 2500 </td></tr>
2501 2501 <tr><td>
2502 2502 <a href="/help/templating">
2503 2503 templating
2504 2504 </a>
2505 2505 </td><td>
2506 2506 Template Usage
2507 2507 </td></tr>
2508 2508 <tr><td>
2509 2509 <a href="/help/urls">
2510 2510 urls
2511 2511 </a>
2512 2512 </td><td>
2513 2513 URL Paths
2514 2514 </td></tr>
2515 2515 <tr><td>
2516 2516 <a href="/help/topic-containing-verbose">
2517 2517 topic-containing-verbose
2518 2518 </a>
2519 2519 </td><td>
2520 2520 This is the topic to test omit indicating.
2521 2521 </td></tr>
2522 2522
2523 2523
2524 2524 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2525 2525
2526 2526 <tr><td>
2527 2527 <a href="/help/abort">
2528 2528 abort
2529 2529 </a>
2530 2530 </td><td>
2531 2531 abort an unfinished operation (EXPERIMENTAL)
2532 2532 </td></tr>
2533 2533 <tr><td>
2534 2534 <a href="/help/add">
2535 2535 add
2536 2536 </a>
2537 2537 </td><td>
2538 2538 add the specified files on the next commit
2539 2539 </td></tr>
2540 2540 <tr><td>
2541 2541 <a href="/help/admin::chainsaw-update">
2542 2542 admin::chainsaw-update
2543 2543 </a>
2544 2544 </td><td>
2545 2545 pull and update to a given revision, no matter what, (EXPERIMENTAL)
2546 2546 </td></tr>
2547 2547 <tr><td>
2548 2548 <a href="/help/annotate">
2549 2549 annotate
2550 2550 </a>
2551 2551 </td><td>
2552 2552 show changeset information by line for each file
2553 2553 </td></tr>
2554 2554 <tr><td>
2555 2555 <a href="/help/clone">
2556 2556 clone
2557 2557 </a>
2558 2558 </td><td>
2559 2559 make a copy of an existing repository
2560 2560 </td></tr>
2561 2561 <tr><td>
2562 2562 <a href="/help/commit">
2563 2563 commit
2564 2564 </a>
2565 2565 </td><td>
2566 2566 commit the specified files or all outstanding changes
2567 2567 </td></tr>
2568 2568 <tr><td>
2569 2569 <a href="/help/continue">
2570 2570 continue
2571 2571 </a>
2572 2572 </td><td>
2573 2573 resumes an interrupted operation (EXPERIMENTAL)
2574 2574 </td></tr>
2575 2575 <tr><td>
2576 2576 <a href="/help/diff">
2577 2577 diff
2578 2578 </a>
2579 2579 </td><td>
2580 2580 diff repository (or selected files)
2581 2581 </td></tr>
2582 2582 <tr><td>
2583 2583 <a href="/help/export">
2584 2584 export
2585 2585 </a>
2586 2586 </td><td>
2587 2587 dump the header and diffs for one or more changesets
2588 2588 </td></tr>
2589 2589 <tr><td>
2590 2590 <a href="/help/forget">
2591 2591 forget
2592 2592 </a>
2593 2593 </td><td>
2594 2594 forget the specified files on the next commit
2595 2595 </td></tr>
2596 2596 <tr><td>
2597 2597 <a href="/help/init">
2598 2598 init
2599 2599 </a>
2600 2600 </td><td>
2601 2601 create a new repository in the given directory
2602 2602 </td></tr>
2603 2603 <tr><td>
2604 2604 <a href="/help/log">
2605 2605 log
2606 2606 </a>
2607 2607 </td><td>
2608 2608 show revision history of entire repository or files
2609 2609 </td></tr>
2610 2610 <tr><td>
2611 2611 <a href="/help/merge">
2612 2612 merge
2613 2613 </a>
2614 2614 </td><td>
2615 2615 merge another revision into working directory
2616 2616 </td></tr>
2617 2617 <tr><td>
2618 2618 <a href="/help/pull">
2619 2619 pull
2620 2620 </a>
2621 2621 </td><td>
2622 2622 pull changes from the specified source
2623 2623 </td></tr>
2624 2624 <tr><td>
2625 2625 <a href="/help/push">
2626 2626 push
2627 2627 </a>
2628 2628 </td><td>
2629 2629 push changes to the specified destination
2630 2630 </td></tr>
2631 2631 <tr><td>
2632 2632 <a href="/help/remove">
2633 2633 remove
2634 2634 </a>
2635 2635 </td><td>
2636 2636 remove the specified files on the next commit
2637 2637 </td></tr>
2638 2638 <tr><td>
2639 2639 <a href="/help/serve">
2640 2640 serve
2641 2641 </a>
2642 2642 </td><td>
2643 2643 start stand-alone webserver
2644 2644 </td></tr>
2645 2645 <tr><td>
2646 2646 <a href="/help/status">
2647 2647 status
2648 2648 </a>
2649 2649 </td><td>
2650 2650 show changed files in the working directory
2651 2651 </td></tr>
2652 2652 <tr><td>
2653 2653 <a href="/help/summary">
2654 2654 summary
2655 2655 </a>
2656 2656 </td><td>
2657 2657 summarize working directory state
2658 2658 </td></tr>
2659 2659 <tr><td>
2660 2660 <a href="/help/update">
2661 2661 update
2662 2662 </a>
2663 2663 </td><td>
2664 2664 update working directory (or switch revisions)
2665 2665 </td></tr>
2666 2666
2667 2667
2668 2668
2669 2669 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2670 2670
2671 2671 <tr><td>
2672 2672 <a href="/help/addremove">
2673 2673 addremove
2674 2674 </a>
2675 2675 </td><td>
2676 2676 add all new files, delete all missing files
2677 2677 </td></tr>
2678 2678 <tr><td>
2679 2679 <a href="/help/admin::verify">
2680 2680 admin::verify
2681 2681 </a>
2682 2682 </td><td>
2683 2683 verify the integrity of the repository
2684 2684 </td></tr>
2685 2685 <tr><td>
2686 2686 <a href="/help/archive">
2687 2687 archive
2688 2688 </a>
2689 2689 </td><td>
2690 2690 create an unversioned archive of a repository revision
2691 2691 </td></tr>
2692 2692 <tr><td>
2693 2693 <a href="/help/backout">
2694 2694 backout
2695 2695 </a>
2696 2696 </td><td>
2697 2697 reverse effect of earlier changeset
2698 2698 </td></tr>
2699 2699 <tr><td>
2700 2700 <a href="/help/bisect">
2701 2701 bisect
2702 2702 </a>
2703 2703 </td><td>
2704 2704 subdivision search of changesets
2705 2705 </td></tr>
2706 2706 <tr><td>
2707 2707 <a href="/help/bookmarks">
2708 2708 bookmarks
2709 2709 </a>
2710 2710 </td><td>
2711 2711 create a new bookmark or list existing bookmarks
2712 2712 </td></tr>
2713 2713 <tr><td>
2714 2714 <a href="/help/branch">
2715 2715 branch
2716 2716 </a>
2717 2717 </td><td>
2718 2718 set or show the current branch name
2719 2719 </td></tr>
2720 2720 <tr><td>
2721 2721 <a href="/help/branches">
2722 2722 branches
2723 2723 </a>
2724 2724 </td><td>
2725 2725 list repository named branches
2726 2726 </td></tr>
2727 2727 <tr><td>
2728 2728 <a href="/help/bundle">
2729 2729 bundle
2730 2730 </a>
2731 2731 </td><td>
2732 2732 create a bundle file
2733 2733 </td></tr>
2734 2734 <tr><td>
2735 2735 <a href="/help/cat">
2736 2736 cat
2737 2737 </a>
2738 2738 </td><td>
2739 2739 output the current or given revision of files
2740 2740 </td></tr>
2741 2741 <tr><td>
2742 2742 <a href="/help/config">
2743 2743 config
2744 2744 </a>
2745 2745 </td><td>
2746 2746 show combined config settings from all hgrc files
2747 2747 </td></tr>
2748 2748 <tr><td>
2749 2749 <a href="/help/copy">
2750 2750 copy
2751 2751 </a>
2752 2752 </td><td>
2753 2753 mark files as copied for the next commit
2754 2754 </td></tr>
2755 2755 <tr><td>
2756 2756 <a href="/help/files">
2757 2757 files
2758 2758 </a>
2759 2759 </td><td>
2760 2760 list tracked files
2761 2761 </td></tr>
2762 2762 <tr><td>
2763 2763 <a href="/help/graft">
2764 2764 graft
2765 2765 </a>
2766 2766 </td><td>
2767 2767 copy changes from other branches onto the current branch
2768 2768 </td></tr>
2769 2769 <tr><td>
2770 2770 <a href="/help/grep">
2771 2771 grep
2772 2772 </a>
2773 2773 </td><td>
2774 2774 search for a pattern in specified files
2775 2775 </td></tr>
2776 2776 <tr><td>
2777 2777 <a href="/help/hashelp">
2778 2778 hashelp
2779 2779 </a>
2780 2780 </td><td>
2781 2781 Extension command's help
2782 2782 </td></tr>
2783 2783 <tr><td>
2784 2784 <a href="/help/heads">
2785 2785 heads
2786 2786 </a>
2787 2787 </td><td>
2788 2788 show branch heads
2789 2789 </td></tr>
2790 2790 <tr><td>
2791 2791 <a href="/help/help">
2792 2792 help
2793 2793 </a>
2794 2794 </td><td>
2795 2795 show help for a given topic or a help overview
2796 2796 </td></tr>
2797 2797 <tr><td>
2798 2798 <a href="/help/hgalias">
2799 2799 hgalias
2800 2800 </a>
2801 2801 </td><td>
2802 2802 My doc
2803 2803 </td></tr>
2804 2804 <tr><td>
2805 2805 <a href="/help/hgaliasnodoc">
2806 2806 hgaliasnodoc
2807 2807 </a>
2808 2808 </td><td>
2809 2809 summarize working directory state
2810 2810 </td></tr>
2811 2811 <tr><td>
2812 2812 <a href="/help/identify">
2813 2813 identify
2814 2814 </a>
2815 2815 </td><td>
2816 2816 identify the working directory or specified revision
2817 2817 </td></tr>
2818 2818 <tr><td>
2819 2819 <a href="/help/import">
2820 2820 import
2821 2821 </a>
2822 2822 </td><td>
2823 2823 import an ordered set of patches
2824 2824 </td></tr>
2825 2825 <tr><td>
2826 2826 <a href="/help/incoming">
2827 2827 incoming
2828 2828 </a>
2829 2829 </td><td>
2830 2830 show new changesets found in source
2831 2831 </td></tr>
2832 2832 <tr><td>
2833 2833 <a href="/help/manifest">
2834 2834 manifest
2835 2835 </a>
2836 2836 </td><td>
2837 2837 output the current or given revision of the project manifest
2838 2838 </td></tr>
2839 2839 <tr><td>
2840 2840 <a href="/help/nohelp">
2841 2841 nohelp
2842 2842 </a>
2843 2843 </td><td>
2844 2844 (no help text available)
2845 2845 </td></tr>
2846 2846 <tr><td>
2847 2847 <a href="/help/outgoing">
2848 2848 outgoing
2849 2849 </a>
2850 2850 </td><td>
2851 2851 show changesets not found in the destination
2852 2852 </td></tr>
2853 2853 <tr><td>
2854 2854 <a href="/help/paths">
2855 2855 paths
2856 2856 </a>
2857 2857 </td><td>
2858 2858 show aliases for remote repositories
2859 2859 </td></tr>
2860 2860 <tr><td>
2861 2861 <a href="/help/phase">
2862 2862 phase
2863 2863 </a>
2864 2864 </td><td>
2865 2865 set or show the current phase name
2866 2866 </td></tr>
2867 2867 <tr><td>
2868 2868 <a href="/help/purge">
2869 2869 purge
2870 2870 </a>
2871 2871 </td><td>
2872 2872 removes files not tracked by Mercurial
2873 2873 </td></tr>
2874 2874 <tr><td>
2875 2875 <a href="/help/recover">
2876 2876 recover
2877 2877 </a>
2878 2878 </td><td>
2879 2879 roll back an interrupted transaction
2880 2880 </td></tr>
2881 2881 <tr><td>
2882 2882 <a href="/help/rename">
2883 2883 rename
2884 2884 </a>
2885 2885 </td><td>
2886 2886 rename files; equivalent of copy + remove
2887 2887 </td></tr>
2888 2888 <tr><td>
2889 2889 <a href="/help/resolve">
2890 2890 resolve
2891 2891 </a>
2892 2892 </td><td>
2893 2893 redo merges or set/view the merge status of files
2894 2894 </td></tr>
2895 2895 <tr><td>
2896 2896 <a href="/help/revert">
2897 2897 revert
2898 2898 </a>
2899 2899 </td><td>
2900 2900 restore files to their checkout state
2901 2901 </td></tr>
2902 2902 <tr><td>
2903 2903 <a href="/help/root">
2904 2904 root
2905 2905 </a>
2906 2906 </td><td>
2907 2907 print the root (top) of the current working directory
2908 2908 </td></tr>
2909 2909 <tr><td>
2910 2910 <a href="/help/shellalias">
2911 2911 shellalias
2912 2912 </a>
2913 2913 </td><td>
2914 2914 (no help text available)
2915 2915 </td></tr>
2916 2916 <tr><td>
2917 2917 <a href="/help/shelve">
2918 2918 shelve
2919 2919 </a>
2920 2920 </td><td>
2921 2921 save and set aside changes from the working directory
2922 2922 </td></tr>
2923 2923 <tr><td>
2924 2924 <a href="/help/tag">
2925 2925 tag
2926 2926 </a>
2927 2927 </td><td>
2928 2928 add one or more tags for the current or given revision
2929 2929 </td></tr>
2930 2930 <tr><td>
2931 2931 <a href="/help/tags">
2932 2932 tags
2933 2933 </a>
2934 2934 </td><td>
2935 2935 list repository tags
2936 2936 </td></tr>
2937 2937 <tr><td>
2938 2938 <a href="/help/unbundle">
2939 2939 unbundle
2940 2940 </a>
2941 2941 </td><td>
2942 2942 apply one or more bundle files
2943 2943 </td></tr>
2944 2944 <tr><td>
2945 2945 <a href="/help/unshelve">
2946 2946 unshelve
2947 2947 </a>
2948 2948 </td><td>
2949 2949 restore a shelved change to the working directory
2950 2950 </td></tr>
2951 2951 <tr><td>
2952 2952 <a href="/help/verify">
2953 2953 verify
2954 2954 </a>
2955 2955 </td><td>
2956 2956 verify the integrity of the repository
2957 2957 </td></tr>
2958 2958 <tr><td>
2959 2959 <a href="/help/version">
2960 2960 version
2961 2961 </a>
2962 2962 </td><td>
2963 2963 output version and copyright information
2964 2964 </td></tr>
2965 2965
2966 2966
2967 2967 </table>
2968 2968 </div>
2969 2969 </div>
2970 2970
2971 2971
2972 2972
2973 2973 </body>
2974 2974 </html>
2975 2975
2976 2976
2977 2977 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2978 2978 200 Script output follows
2979 2979
2980 2980 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2981 2981 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2982 2982 <head>
2983 2983 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2984 2984 <meta name="robots" content="index, nofollow" />
2985 2985 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2986 2986 <script type="text/javascript" src="/static/mercurial.js"></script>
2987 2987
2988 2988 <title>Help: add</title>
2989 2989 </head>
2990 2990 <body>
2991 2991
2992 2992 <div class="container">
2993 2993 <div class="menu">
2994 2994 <div class="logo">
2995 2995 <a href="https://mercurial-scm.org/">
2996 2996 <img src="/static/hglogo.png" alt="mercurial" /></a>
2997 2997 </div>
2998 2998 <ul>
2999 2999 <li><a href="/shortlog">log</a></li>
3000 3000 <li><a href="/graph">graph</a></li>
3001 3001 <li><a href="/tags">tags</a></li>
3002 3002 <li><a href="/bookmarks">bookmarks</a></li>
3003 3003 <li><a href="/branches">branches</a></li>
3004 3004 </ul>
3005 3005 <ul>
3006 3006 <li class="active"><a href="/help">help</a></li>
3007 3007 </ul>
3008 3008 </div>
3009 3009
3010 3010 <div class="main">
3011 3011 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3012 3012 <h3>Help: add</h3>
3013 3013
3014 3014 <form class="search" action="/log">
3015 3015
3016 3016 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3017 3017 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3018 3018 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3019 3019 </form>
3020 3020 <div id="doc">
3021 3021 <p>
3022 3022 hg add [OPTION]... [FILE]...
3023 3023 </p>
3024 3024 <p>
3025 3025 add the specified files on the next commit
3026 3026 </p>
3027 3027 <p>
3028 3028 Schedule files to be version controlled and added to the
3029 3029 repository.
3030 3030 </p>
3031 3031 <p>
3032 3032 The files will be added to the repository at the next commit. To
3033 3033 undo an add before that, see 'hg forget'.
3034 3034 </p>
3035 3035 <p>
3036 3036 If no names are given, add all files to the repository (except
3037 3037 files matching &quot;.hgignore&quot;).
3038 3038 </p>
3039 3039 <p>
3040 3040 Examples:
3041 3041 </p>
3042 3042 <ul>
3043 3043 <li> New (unknown) files are added automatically by 'hg add':
3044 3044 <pre>
3045 3045 \$ ls (re)
3046 3046 foo.c
3047 3047 \$ hg status (re)
3048 3048 ? foo.c
3049 3049 \$ hg add (re)
3050 3050 adding foo.c
3051 3051 \$ hg status (re)
3052 3052 A foo.c
3053 3053 </pre>
3054 3054 <li> Specific files to be added can be specified:
3055 3055 <pre>
3056 3056 \$ ls (re)
3057 3057 bar.c foo.c
3058 3058 \$ hg status (re)
3059 3059 ? bar.c
3060 3060 ? foo.c
3061 3061 \$ hg add bar.c (re)
3062 3062 \$ hg status (re)
3063 3063 A bar.c
3064 3064 ? foo.c
3065 3065 </pre>
3066 3066 </ul>
3067 3067 <p>
3068 3068 Returns 0 if all files are successfully added.
3069 3069 </p>
3070 3070 <p>
3071 3071 options ([+] can be repeated):
3072 3072 </p>
3073 3073 <table>
3074 3074 <tr><td>-I</td>
3075 3075 <td>--include PATTERN [+]</td>
3076 3076 <td>include names matching the given patterns</td></tr>
3077 3077 <tr><td>-X</td>
3078 3078 <td>--exclude PATTERN [+]</td>
3079 3079 <td>exclude names matching the given patterns</td></tr>
3080 3080 <tr><td>-S</td>
3081 3081 <td>--subrepos</td>
3082 3082 <td>recurse into subrepositories</td></tr>
3083 3083 <tr><td>-n</td>
3084 3084 <td>--dry-run</td>
3085 3085 <td>do not perform actions, just print output</td></tr>
3086 3086 </table>
3087 3087 <p>
3088 3088 global options ([+] can be repeated):
3089 3089 </p>
3090 3090 <table>
3091 3091 <tr><td>-R</td>
3092 3092 <td>--repository REPO</td>
3093 3093 <td>repository root directory or name of overlay bundle file</td></tr>
3094 3094 <tr><td></td>
3095 3095 <td>--cwd DIR</td>
3096 3096 <td>change working directory</td></tr>
3097 3097 <tr><td>-y</td>
3098 3098 <td>--noninteractive</td>
3099 3099 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
3100 3100 <tr><td>-q</td>
3101 3101 <td>--quiet</td>
3102 3102 <td>suppress output</td></tr>
3103 3103 <tr><td>-v</td>
3104 3104 <td>--verbose</td>
3105 3105 <td>enable additional output</td></tr>
3106 3106 <tr><td></td>
3107 3107 <td>--color TYPE</td>
3108 3108 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
3109 3109 <tr><td></td>
3110 3110 <td>--config CONFIG [+]</td>
3111 3111 <td>set/override config option (use 'section.name=value')</td></tr>
3112 3112 <tr><td></td>
3113 3113 <td>--debug</td>
3114 3114 <td>enable debugging output</td></tr>
3115 3115 <tr><td></td>
3116 3116 <td>--debugger</td>
3117 3117 <td>start debugger</td></tr>
3118 3118 <tr><td></td>
3119 3119 <td>--encoding ENCODE</td>
3120 3120 <td>set the charset encoding (default: ascii)</td></tr>
3121 3121 <tr><td></td>
3122 3122 <td>--encodingmode MODE</td>
3123 3123 <td>set the charset encoding mode (default: strict)</td></tr>
3124 3124 <tr><td></td>
3125 3125 <td>--traceback</td>
3126 3126 <td>always print a traceback on exception</td></tr>
3127 3127 <tr><td></td>
3128 3128 <td>--time</td>
3129 3129 <td>time how long the command takes</td></tr>
3130 3130 <tr><td></td>
3131 3131 <td>--profile</td>
3132 3132 <td>print command execution profile</td></tr>
3133 3133 <tr><td></td>
3134 3134 <td>--version</td>
3135 3135 <td>output version information and exit</td></tr>
3136 3136 <tr><td>-h</td>
3137 3137 <td>--help</td>
3138 3138 <td>display help and exit</td></tr>
3139 3139 <tr><td></td>
3140 3140 <td>--hidden</td>
3141 3141 <td>consider hidden changesets</td></tr>
3142 3142 <tr><td></td>
3143 3143 <td>--pager TYPE</td>
3144 3144 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
3145 3145 </table>
3146 3146
3147 3147 </div>
3148 3148 </div>
3149 3149 </div>
3150 3150
3151 3151
3152 3152
3153 3153 </body>
3154 3154 </html>
3155 3155
3156 3156
3157 3157 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
3158 3158 200 Script output follows
3159 3159
3160 3160 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3161 3161 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3162 3162 <head>
3163 3163 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3164 3164 <meta name="robots" content="index, nofollow" />
3165 3165 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3166 3166 <script type="text/javascript" src="/static/mercurial.js"></script>
3167 3167
3168 3168 <title>Help: remove</title>
3169 3169 </head>
3170 3170 <body>
3171 3171
3172 3172 <div class="container">
3173 3173 <div class="menu">
3174 3174 <div class="logo">
3175 3175 <a href="https://mercurial-scm.org/">
3176 3176 <img src="/static/hglogo.png" alt="mercurial" /></a>
3177 3177 </div>
3178 3178 <ul>
3179 3179 <li><a href="/shortlog">log</a></li>
3180 3180 <li><a href="/graph">graph</a></li>
3181 3181 <li><a href="/tags">tags</a></li>
3182 3182 <li><a href="/bookmarks">bookmarks</a></li>
3183 3183 <li><a href="/branches">branches</a></li>
3184 3184 </ul>
3185 3185 <ul>
3186 3186 <li class="active"><a href="/help">help</a></li>
3187 3187 </ul>
3188 3188 </div>
3189 3189
3190 3190 <div class="main">
3191 3191 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3192 3192 <h3>Help: remove</h3>
3193 3193
3194 3194 <form class="search" action="/log">
3195 3195
3196 3196 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3197 3197 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3198 3198 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3199 3199 </form>
3200 3200 <div id="doc">
3201 3201 <p>
3202 3202 hg remove [OPTION]... FILE...
3203 3203 </p>
3204 3204 <p>
3205 3205 aliases: rm
3206 3206 </p>
3207 3207 <p>
3208 3208 remove the specified files on the next commit
3209 3209 </p>
3210 3210 <p>
3211 3211 Schedule the indicated files for removal from the current branch.
3212 3212 </p>
3213 3213 <p>
3214 3214 This command schedules the files to be removed at the next commit.
3215 3215 To undo a remove before that, see 'hg revert'. To undo added
3216 3216 files, see 'hg forget'.
3217 3217 </p>
3218 3218 <p>
3219 3219 -A/--after can be used to remove only files that have already
3220 3220 been deleted, -f/--force can be used to force deletion, and -Af
3221 3221 can be used to remove files from the next revision without
3222 3222 deleting them from the working directory.
3223 3223 </p>
3224 3224 <p>
3225 3225 The following table details the behavior of remove for different
3226 3226 file states (columns) and option combinations (rows). The file
3227 3227 states are Added [A], Clean [C], Modified [M] and Missing [!]
3228 3228 (as reported by 'hg status'). The actions are Warn, Remove
3229 3229 (from branch) and Delete (from disk):
3230 3230 </p>
3231 3231 <table>
3232 3232 <tr><td>opt/state</td>
3233 3233 <td>A</td>
3234 3234 <td>C</td>
3235 3235 <td>M</td>
3236 3236 <td>!</td></tr>
3237 3237 <tr><td>none</td>
3238 3238 <td>W</td>
3239 3239 <td>RD</td>
3240 3240 <td>W</td>
3241 3241 <td>R</td></tr>
3242 3242 <tr><td>-f</td>
3243 3243 <td>R</td>
3244 3244 <td>RD</td>
3245 3245 <td>RD</td>
3246 3246 <td>R</td></tr>
3247 3247 <tr><td>-A</td>
3248 3248 <td>W</td>
3249 3249 <td>W</td>
3250 3250 <td>W</td>
3251 3251 <td>R</td></tr>
3252 3252 <tr><td>-Af</td>
3253 3253 <td>R</td>
3254 3254 <td>R</td>
3255 3255 <td>R</td>
3256 3256 <td>R</td></tr>
3257 3257 </table>
3258 3258 <p>
3259 3259 <b>Note:</b>
3260 3260 </p>
3261 3261 <p>
3262 3262 'hg remove' never deletes files in Added [A] state from the
3263 3263 working directory, not even if &quot;--force&quot; is specified.
3264 3264 </p>
3265 3265 <p>
3266 3266 Returns 0 on success, 1 if any warnings encountered.
3267 3267 </p>
3268 3268 <p>
3269 3269 options ([+] can be repeated):
3270 3270 </p>
3271 3271 <table>
3272 3272 <tr><td>-A</td>
3273 3273 <td>--after</td>
3274 3274 <td>record delete for missing files</td></tr>
3275 3275 <tr><td>-f</td>
3276 3276 <td>--force</td>
3277 3277 <td>forget added files, delete modified files</td></tr>
3278 3278 <tr><td>-S</td>
3279 3279 <td>--subrepos</td>
3280 3280 <td>recurse into subrepositories</td></tr>
3281 3281 <tr><td>-I</td>
3282 3282 <td>--include PATTERN [+]</td>
3283 3283 <td>include names matching the given patterns</td></tr>
3284 3284 <tr><td>-X</td>
3285 3285 <td>--exclude PATTERN [+]</td>
3286 3286 <td>exclude names matching the given patterns</td></tr>
3287 3287 <tr><td>-n</td>
3288 3288 <td>--dry-run</td>
3289 3289 <td>do not perform actions, just print output</td></tr>
3290 3290 </table>
3291 3291 <p>
3292 3292 global options ([+] can be repeated):
3293 3293 </p>
3294 3294 <table>
3295 3295 <tr><td>-R</td>
3296 3296 <td>--repository REPO</td>
3297 3297 <td>repository root directory or name of overlay bundle file</td></tr>
3298 3298 <tr><td></td>
3299 3299 <td>--cwd DIR</td>
3300 3300 <td>change working directory</td></tr>
3301 3301 <tr><td>-y</td>
3302 3302 <td>--noninteractive</td>
3303 3303 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
3304 3304 <tr><td>-q</td>
3305 3305 <td>--quiet</td>
3306 3306 <td>suppress output</td></tr>
3307 3307 <tr><td>-v</td>
3308 3308 <td>--verbose</td>
3309 3309 <td>enable additional output</td></tr>
3310 3310 <tr><td></td>
3311 3311 <td>--color TYPE</td>
3312 3312 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
3313 3313 <tr><td></td>
3314 3314 <td>--config CONFIG [+]</td>
3315 3315 <td>set/override config option (use 'section.name=value')</td></tr>
3316 3316 <tr><td></td>
3317 3317 <td>--debug</td>
3318 3318 <td>enable debugging output</td></tr>
3319 3319 <tr><td></td>
3320 3320 <td>--debugger</td>
3321 3321 <td>start debugger</td></tr>
3322 3322 <tr><td></td>
3323 3323 <td>--encoding ENCODE</td>
3324 3324 <td>set the charset encoding (default: ascii)</td></tr>
3325 3325 <tr><td></td>
3326 3326 <td>--encodingmode MODE</td>
3327 3327 <td>set the charset encoding mode (default: strict)</td></tr>
3328 3328 <tr><td></td>
3329 3329 <td>--traceback</td>
3330 3330 <td>always print a traceback on exception</td></tr>
3331 3331 <tr><td></td>
3332 3332 <td>--time</td>
3333 3333 <td>time how long the command takes</td></tr>
3334 3334 <tr><td></td>
3335 3335 <td>--profile</td>
3336 3336 <td>print command execution profile</td></tr>
3337 3337 <tr><td></td>
3338 3338 <td>--version</td>
3339 3339 <td>output version information and exit</td></tr>
3340 3340 <tr><td>-h</td>
3341 3341 <td>--help</td>
3342 3342 <td>display help and exit</td></tr>
3343 3343 <tr><td></td>
3344 3344 <td>--hidden</td>
3345 3345 <td>consider hidden changesets</td></tr>
3346 3346 <tr><td></td>
3347 3347 <td>--pager TYPE</td>
3348 3348 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
3349 3349 </table>
3350 3350
3351 3351 </div>
3352 3352 </div>
3353 3353 </div>
3354 3354
3355 3355
3356 3356
3357 3357 </body>
3358 3358 </html>
3359 3359
3360 3360
3361 3361 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
3362 3362 200 Script output follows
3363 3363
3364 3364 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3365 3365 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3366 3366 <head>
3367 3367 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3368 3368 <meta name="robots" content="index, nofollow" />
3369 3369 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3370 3370 <script type="text/javascript" src="/static/mercurial.js"></script>
3371 3371
3372 3372 <title>Help: dates</title>
3373 3373 </head>
3374 3374 <body>
3375 3375
3376 3376 <div class="container">
3377 3377 <div class="menu">
3378 3378 <div class="logo">
3379 3379 <a href="https://mercurial-scm.org/">
3380 3380 <img src="/static/hglogo.png" alt="mercurial" /></a>
3381 3381 </div>
3382 3382 <ul>
3383 3383 <li><a href="/shortlog">log</a></li>
3384 3384 <li><a href="/graph">graph</a></li>
3385 3385 <li><a href="/tags">tags</a></li>
3386 3386 <li><a href="/bookmarks">bookmarks</a></li>
3387 3387 <li><a href="/branches">branches</a></li>
3388 3388 </ul>
3389 3389 <ul>
3390 3390 <li class="active"><a href="/help">help</a></li>
3391 3391 </ul>
3392 3392 </div>
3393 3393
3394 3394 <div class="main">
3395 3395 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3396 3396 <h3>Help: dates</h3>
3397 3397
3398 3398 <form class="search" action="/log">
3399 3399
3400 3400 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3401 3401 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3402 3402 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3403 3403 </form>
3404 3404 <div id="doc">
3405 3405 <h1>Date Formats</h1>
3406 3406 <p>
3407 3407 Some commands allow the user to specify a date, e.g.:
3408 3408 </p>
3409 3409 <ul>
3410 3410 <li> backout, commit, import, tag: Specify the commit date.
3411 3411 <li> log, revert, update: Select revision(s) by date.
3412 3412 </ul>
3413 3413 <p>
3414 3414 Many date formats are valid. Here are some examples:
3415 3415 </p>
3416 3416 <ul>
3417 3417 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
3418 3418 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
3419 3419 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
3420 3420 <li> &quot;Dec 6&quot; (midnight)
3421 3421 <li> &quot;13:18&quot; (today assumed)
3422 3422 <li> &quot;3:39&quot; (3:39AM assumed)
3423 3423 <li> &quot;3:39pm&quot; (15:39)
3424 3424 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
3425 3425 <li> &quot;2006-12-6 13:18&quot;
3426 3426 <li> &quot;2006-12-6&quot;
3427 3427 <li> &quot;12-6&quot;
3428 3428 <li> &quot;12/6&quot;
3429 3429 <li> &quot;12/6/6&quot; (Dec 6 2006)
3430 3430 <li> &quot;today&quot; (midnight)
3431 3431 <li> &quot;yesterday&quot; (midnight)
3432 3432 <li> &quot;now&quot; - right now
3433 3433 </ul>
3434 3434 <p>
3435 3435 Lastly, there is Mercurial's internal format:
3436 3436 </p>
3437 3437 <ul>
3438 3438 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
3439 3439 </ul>
3440 3440 <p>
3441 3441 This is the internal representation format for dates. The first number
3442 3442 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
3443 3443 second is the offset of the local timezone, in seconds west of UTC
3444 3444 (negative if the timezone is east of UTC).
3445 3445 </p>
3446 3446 <p>
3447 3447 The log command also accepts date ranges:
3448 3448 </p>
3449 3449 <ul>
3450 3450 <li> &quot;&lt;DATE&quot; - at or before a given date/time
3451 3451 <li> &quot;&gt;DATE&quot; - on or after a given date/time
3452 3452 <li> &quot;DATE to DATE&quot; - a date range, inclusive
3453 3453 <li> &quot;-DAYS&quot; - within a given number of days from today
3454 3454 </ul>
3455 3455
3456 3456 </div>
3457 3457 </div>
3458 3458 </div>
3459 3459
3460 3460
3461 3461
3462 3462 </body>
3463 3463 </html>
3464 3464
3465 3465
3466 3466 $ get-with-headers.py $LOCALIP:$HGPORT "help/pager"
3467 3467 200 Script output follows
3468 3468
3469 3469 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3470 3470 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3471 3471 <head>
3472 3472 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3473 3473 <meta name="robots" content="index, nofollow" />
3474 3474 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3475 3475 <script type="text/javascript" src="/static/mercurial.js"></script>
3476 3476
3477 3477 <title>Help: pager</title>
3478 3478 </head>
3479 3479 <body>
3480 3480
3481 3481 <div class="container">
3482 3482 <div class="menu">
3483 3483 <div class="logo">
3484 3484 <a href="https://mercurial-scm.org/">
3485 3485 <img src="/static/hglogo.png" alt="mercurial" /></a>
3486 3486 </div>
3487 3487 <ul>
3488 3488 <li><a href="/shortlog">log</a></li>
3489 3489 <li><a href="/graph">graph</a></li>
3490 3490 <li><a href="/tags">tags</a></li>
3491 3491 <li><a href="/bookmarks">bookmarks</a></li>
3492 3492 <li><a href="/branches">branches</a></li>
3493 3493 </ul>
3494 3494 <ul>
3495 3495 <li class="active"><a href="/help">help</a></li>
3496 3496 </ul>
3497 3497 </div>
3498 3498
3499 3499 <div class="main">
3500 3500 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3501 3501 <h3>Help: pager</h3>
3502 3502
3503 3503 <form class="search" action="/log">
3504 3504
3505 3505 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3506 3506 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3507 3507 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3508 3508 </form>
3509 3509 <div id="doc">
3510 3510 <h1>Pager Support</h1>
3511 3511 <p>
3512 3512 Some Mercurial commands can produce a lot of output, and Mercurial will
3513 3513 attempt to use a pager to make those commands more pleasant.
3514 3514 </p>
3515 3515 <p>
3516 3516 To set the pager that should be used, set the application variable:
3517 3517 </p>
3518 3518 <pre>
3519 3519 [pager]
3520 3520 pager = less -FRX
3521 3521 </pre>
3522 3522 <p>
3523 3523 If no pager is set in the user or repository configuration, Mercurial uses the
3524 3524 environment variable $PAGER. If $PAGER is not set, pager.pager from the default
3525 3525 or system configuration is used. If none of these are set, a default pager will
3526 3526 be used, typically 'less' on Unix and 'more' on Windows.
3527 3527 </p>
3528 3528 <p>
3529 3529 You can disable the pager for certain commands by adding them to the
3530 3530 pager.ignore list:
3531 3531 </p>
3532 3532 <pre>
3533 3533 [pager]
3534 3534 ignore = version, help, update
3535 3535 </pre>
3536 3536 <p>
3537 3537 To ignore global commands like 'hg version' or 'hg help', you have
3538 3538 to specify them in your user configuration file.
3539 3539 </p>
3540 3540 <p>
3541 3541 To control whether the pager is used at all for an individual command,
3542 3542 you can use --pager=&lt;value&gt;:
3543 3543 </p>
3544 3544 <ul>
3545 3545 <li> use as needed: 'auto'.
3546 3546 <li> require the pager: 'yes' or 'on'.
3547 3547 <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work).
3548 3548 </ul>
3549 3549 <p>
3550 3550 To globally turn off all attempts to use a pager, set:
3551 3551 </p>
3552 3552 <pre>
3553 3553 [ui]
3554 3554 paginate = never
3555 3555 </pre>
3556 3556 <p>
3557 3557 which will prevent the pager from running.
3558 3558 </p>
3559 3559
3560 3560 </div>
3561 3561 </div>
3562 3562 </div>
3563 3563
3564 3564
3565 3565
3566 3566 </body>
3567 3567 </html>
3568 3568
3569 3569
3570 3570 Sub-topic indexes rendered properly
3571 3571
3572 3572 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3573 3573 200 Script output follows
3574 3574
3575 3575 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3576 3576 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3577 3577 <head>
3578 3578 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3579 3579 <meta name="robots" content="index, nofollow" />
3580 3580 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3581 3581 <script type="text/javascript" src="/static/mercurial.js"></script>
3582 3582
3583 3583 <title>Help: internals</title>
3584 3584 </head>
3585 3585 <body>
3586 3586
3587 3587 <div class="container">
3588 3588 <div class="menu">
3589 3589 <div class="logo">
3590 3590 <a href="https://mercurial-scm.org/">
3591 3591 <img src="/static/hglogo.png" alt="mercurial" /></a>
3592 3592 </div>
3593 3593 <ul>
3594 3594 <li><a href="/shortlog">log</a></li>
3595 3595 <li><a href="/graph">graph</a></li>
3596 3596 <li><a href="/tags">tags</a></li>
3597 3597 <li><a href="/bookmarks">bookmarks</a></li>
3598 3598 <li><a href="/branches">branches</a></li>
3599 3599 </ul>
3600 3600 <ul>
3601 3601 <li><a href="/help">help</a></li>
3602 3602 </ul>
3603 3603 </div>
3604 3604
3605 3605 <div class="main">
3606 3606 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3607 3607
3608 3608 <form class="search" action="/log">
3609 3609
3610 3610 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3611 3611 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3612 3612 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3613 3613 </form>
3614 3614 <table class="bigtable">
3615 3615 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3616 3616
3617 3617 <tr><td>
3618 3618 <a href="/help/internals.bid-merge">
3619 3619 bid-merge
3620 3620 </a>
3621 3621 </td><td>
3622 3622 Bid Merge Algorithm
3623 3623 </td></tr>
3624 3624 <tr><td>
3625 3625 <a href="/help/internals.bundle2">
3626 3626 bundle2
3627 3627 </a>
3628 3628 </td><td>
3629 3629 Bundle2
3630 3630 </td></tr>
3631 3631 <tr><td>
3632 3632 <a href="/help/internals.bundles">
3633 3633 bundles
3634 3634 </a>
3635 3635 </td><td>
3636 3636 Bundles
3637 3637 </td></tr>
3638 3638 <tr><td>
3639 3639 <a href="/help/internals.cbor">
3640 3640 cbor
3641 3641 </a>
3642 3642 </td><td>
3643 3643 CBOR
3644 3644 </td></tr>
3645 3645 <tr><td>
3646 3646 <a href="/help/internals.censor">
3647 3647 censor
3648 3648 </a>
3649 3649 </td><td>
3650 3650 Censor
3651 3651 </td></tr>
3652 3652 <tr><td>
3653 3653 <a href="/help/internals.changegroups">
3654 3654 changegroups
3655 3655 </a>
3656 3656 </td><td>
3657 3657 Changegroups
3658 3658 </td></tr>
3659 3659 <tr><td>
3660 3660 <a href="/help/internals.config">
3661 3661 config
3662 3662 </a>
3663 3663 </td><td>
3664 3664 Config Registrar
3665 3665 </td></tr>
3666 3666 <tr><td>
3667 3667 <a href="/help/internals.dirstate-v2">
3668 3668 dirstate-v2
3669 3669 </a>
3670 3670 </td><td>
3671 3671 dirstate-v2 file format
3672 3672 </td></tr>
3673 3673 <tr><td>
3674 3674 <a href="/help/internals.extensions">
3675 3675 extensions
3676 3676 </a>
3677 3677 </td><td>
3678 3678 Extension API
3679 3679 </td></tr>
3680 3680 <tr><td>
3681 3681 <a href="/help/internals.mergestate">
3682 3682 mergestate
3683 3683 </a>
3684 3684 </td><td>
3685 3685 Mergestate
3686 3686 </td></tr>
3687 3687 <tr><td>
3688 3688 <a href="/help/internals.requirements">
3689 3689 requirements
3690 3690 </a>
3691 3691 </td><td>
3692 3692 Repository Requirements
3693 3693 </td></tr>
3694 3694 <tr><td>
3695 3695 <a href="/help/internals.revlogs">
3696 3696 revlogs
3697 3697 </a>
3698 3698 </td><td>
3699 3699 Revision Logs
3700 3700 </td></tr>
3701 3701 <tr><td>
3702 3702 <a href="/help/internals.wireprotocol">
3703 3703 wireprotocol
3704 3704 </a>
3705 3705 </td><td>
3706 3706 Wire Protocol
3707 3707 </td></tr>
3708 3708 <tr><td>
3709 3709 <a href="/help/internals.wireprotocolrpc">
3710 3710 wireprotocolrpc
3711 3711 </a>
3712 3712 </td><td>
3713 3713 Wire Protocol RPC
3714 3714 </td></tr>
3715 3715 <tr><td>
3716 3716 <a href="/help/internals.wireprotocolv2">
3717 3717 wireprotocolv2
3718 3718 </a>
3719 3719 </td><td>
3720 3720 Wire Protocol Version 2
3721 3721 </td></tr>
3722 3722
3723 3723
3724 3724
3725 3725
3726 3726
3727 3727 </table>
3728 3728 </div>
3729 3729 </div>
3730 3730
3731 3731
3732 3732
3733 3733 </body>
3734 3734 </html>
3735 3735
3736 3736
3737 3737 Sub-topic topics rendered properly
3738 3738
3739 3739 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3740 3740 200 Script output follows
3741 3741
3742 3742 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3743 3743 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3744 3744 <head>
3745 3745 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3746 3746 <meta name="robots" content="index, nofollow" />
3747 3747 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3748 3748 <script type="text/javascript" src="/static/mercurial.js"></script>
3749 3749
3750 3750 <title>Help: internals.changegroups</title>
3751 3751 </head>
3752 3752 <body>
3753 3753
3754 3754 <div class="container">
3755 3755 <div class="menu">
3756 3756 <div class="logo">
3757 3757 <a href="https://mercurial-scm.org/">
3758 3758 <img src="/static/hglogo.png" alt="mercurial" /></a>
3759 3759 </div>
3760 3760 <ul>
3761 3761 <li><a href="/shortlog">log</a></li>
3762 3762 <li><a href="/graph">graph</a></li>
3763 3763 <li><a href="/tags">tags</a></li>
3764 3764 <li><a href="/bookmarks">bookmarks</a></li>
3765 3765 <li><a href="/branches">branches</a></li>
3766 3766 </ul>
3767 3767 <ul>
3768 3768 <li class="active"><a href="/help">help</a></li>
3769 3769 </ul>
3770 3770 </div>
3771 3771
3772 3772 <div class="main">
3773 3773 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3774 3774 <h3>Help: internals.changegroups</h3>
3775 3775
3776 3776 <form class="search" action="/log">
3777 3777
3778 3778 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3779 3779 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3780 3780 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3781 3781 </form>
3782 3782 <div id="doc">
3783 3783 <h1>Changegroups</h1>
3784 3784 <p>
3785 3785 Changegroups are representations of repository revlog data, specifically
3786 3786 the changelog data, root/flat manifest data, treemanifest data, and
3787 3787 filelogs.
3788 3788 </p>
3789 3789 <p>
3790 3790 There are 4 versions of changegroups: &quot;1&quot;, &quot;2&quot;, &quot;3&quot; and &quot;4&quot;. From a
3791 3791 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3792 3792 only difference being an additional item in the *delta header*. Version
3793 3793 &quot;3&quot; adds support for storage flags in the *delta header* and optionally
3794 3794 exchanging treemanifests (enabled by setting an option on the
3795 3795 &quot;changegroup&quot; part in the bundle2). Version &quot;4&quot; adds support for exchanging
3796 3796 sidedata (additional revision metadata not part of the digest).
3797 3797 </p>
3798 3798 <p>
3799 3799 Changegroups when not exchanging treemanifests consist of 3 logical
3800 3800 segments:
3801 3801 </p>
3802 3802 <pre>
3803 3803 +---------------------------------+
3804 3804 | | | |
3805 3805 | changeset | manifest | filelogs |
3806 3806 | | | |
3807 3807 | | | |
3808 3808 +---------------------------------+
3809 3809 </pre>
3810 3810 <p>
3811 3811 When exchanging treemanifests, there are 4 logical segments:
3812 3812 </p>
3813 3813 <pre>
3814 3814 +-------------------------------------------------+
3815 3815 | | | | |
3816 3816 | changeset | root | treemanifests | filelogs |
3817 3817 | | manifest | | |
3818 3818 | | | | |
3819 3819 +-------------------------------------------------+
3820 3820 </pre>
3821 3821 <p>
3822 3822 The principle building block of each segment is a *chunk*. A *chunk*
3823 3823 is a framed piece of data:
3824 3824 </p>
3825 3825 <pre>
3826 3826 +---------------------------------------+
3827 3827 | | |
3828 3828 | length | data |
3829 3829 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3830 3830 | | |
3831 3831 +---------------------------------------+
3832 3832 </pre>
3833 3833 <p>
3834 3834 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3835 3835 integer indicating the length of the entire chunk (including the length field
3836 3836 itself).
3837 3837 </p>
3838 3838 <p>
3839 3839 There is a special case chunk that has a value of 0 for the length
3840 3840 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3841 3841 </p>
3842 3842 <h2>Delta Groups</h2>
3843 3843 <p>
3844 3844 A *delta group* expresses the content of a revlog as a series of deltas,
3845 3845 or patches against previous revisions.
3846 3846 </p>
3847 3847 <p>
3848 3848 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3849 3849 to signal the end of the delta group:
3850 3850 </p>
3851 3851 <pre>
3852 3852 +------------------------------------------------------------------------+
3853 3853 | | | | | |
3854 3854 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3855 3855 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3856 3856 | | | | | |
3857 3857 +------------------------------------------------------------------------+
3858 3858 </pre>
3859 3859 <p>
3860 3860 Each *chunk*'s data consists of the following:
3861 3861 </p>
3862 3862 <pre>
3863 3863 +---------------------------------------+
3864 3864 | | |
3865 3865 | delta header | delta data |
3866 3866 | (various by version) | (various) |
3867 3867 | | |
3868 3868 +---------------------------------------+
3869 3869 </pre>
3870 3870 <p>
3871 3871 The *delta data* is a series of *delta*s that describe a diff from an existing
3872 3872 entry (either that the recipient already has, or previously specified in the
3873 3873 bundle/changegroup).
3874 3874 </p>
3875 3875 <p>
3876 3876 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, &quot;3&quot; and &quot;4&quot;
3877 3877 of the changegroup format.
3878 3878 </p>
3879 3879 <p>
3880 3880 Version 1 (headerlen=80):
3881 3881 </p>
3882 3882 <pre>
3883 3883 +------------------------------------------------------+
3884 3884 | | | | |
3885 3885 | node | p1 node | p2 node | link node |
3886 3886 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3887 3887 | | | | |
3888 3888 +------------------------------------------------------+
3889 3889 </pre>
3890 3890 <p>
3891 3891 Version 2 (headerlen=100):
3892 3892 </p>
3893 3893 <pre>
3894 3894 +------------------------------------------------------------------+
3895 3895 | | | | | |
3896 3896 | node | p1 node | p2 node | base node | link node |
3897 3897 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3898 3898 | | | | | |
3899 3899 +------------------------------------------------------------------+
3900 3900 </pre>
3901 3901 <p>
3902 3902 Version 3 (headerlen=102):
3903 3903 </p>
3904 3904 <pre>
3905 3905 +------------------------------------------------------------------------------+
3906 3906 | | | | | | |
3907 3907 | node | p1 node | p2 node | base node | link node | flags |
3908 3908 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3909 3909 | | | | | | |
3910 3910 +------------------------------------------------------------------------------+
3911 3911 </pre>
3912 3912 <p>
3913 3913 Version 4 (headerlen=103):
3914 3914 </p>
3915 3915 <pre>
3916 3916 +------------------------------------------------------------------------------+----------+
3917 3917 | | | | | | | |
3918 3918 | node | p1 node | p2 node | base node | link node | flags | pflags |
3919 3919 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | (1 byte) |
3920 3920 | | | | | | | |
3921 3921 +------------------------------------------------------------------------------+----------+
3922 3922 </pre>
3923 3923 <p>
3924 3924 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3925 3925 series of *delta*s, densely packed (no separators). These deltas describe a diff
3926 3926 from an existing entry (either that the recipient already has, or previously
3927 3927 specified in the bundle/changegroup). The format is described more fully in
3928 3928 &quot;hg help internals.bdiff&quot;, but briefly:
3929 3929 </p>
3930 3930 <pre>
3931 3931 +---------------------------------------------------------------+
3932 3932 | | | | |
3933 3933 | start offset | end offset | new length | content |
3934 3934 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3935 3935 | | | | |
3936 3936 +---------------------------------------------------------------+
3937 3937 </pre>
3938 3938 <p>
3939 3939 Please note that the length field in the delta data does *not* include itself.
3940 3940 </p>
3941 3941 <p>
3942 3942 In version 1, the delta is always applied against the previous node from
3943 3943 the changegroup or the first parent if this is the first entry in the
3944 3944 changegroup.
3945 3945 </p>
3946 3946 <p>
3947 3947 In version 2 and up, the delta base node is encoded in the entry in the
3948 3948 changegroup. This allows the delta to be expressed against any parent,
3949 3949 which can result in smaller deltas and more efficient encoding of data.
3950 3950 </p>
3951 3951 <p>
3952 3952 The *flags* field holds bitwise flags affecting the processing of revision
3953 3953 data. The following flags are defined:
3954 3954 </p>
3955 3955 <dl>
3956 3956 <dt>32768
3957 3957 <dd>Censored revision. The revision's fulltext has been replaced by censor metadata. May only occur on file revisions.
3958 3958 <dt>16384
3959 3959 <dd>Ellipsis revision. Revision hash does not match data (likely due to rewritten parents).
3960 3960 <dt>8192
3961 3961 <dd>Externally stored. The revision fulltext contains &quot;key:value&quot; &quot;\n&quot; delimited metadata defining an object stored elsewhere. Used by the LFS extension.
3962 3962 <dt>4096
3963 3963 <dd>Contains copy information. This revision changes files in a way that could affect copy tracing. This does *not* affect changegroup handling, but is relevant for other parts of Mercurial.
3964 3964 </dl>
3965 3965 <p>
3966 3966 For historical reasons, the integer values are identical to revlog version 1
3967 3967 per-revision storage flags and correspond to bits being set in this 2-byte
3968 3968 field. Bits were allocated starting from the most-significant bit, hence the
3969 3969 reverse ordering and allocation of these flags.
3970 3970 </p>
3971 3971 <p>
3972 3972 The *pflags* (protocol flags) field holds bitwise flags affecting the protocol
3973 3973 itself. They are first in the header since they may affect the handling of the
3974 3974 rest of the fields in a future version. They are defined as such:
3975 3975 </p>
3976 3976 <dl>
3977 3977 <dt>1 indicates whether to read a chunk of sidedata (of variable length) right
3978 3978 <dd>after the revision flags.
3979 3979 </dl>
3980 3980 <h2>Changeset Segment</h2>
3981 3981 <p>
3982 3982 The *changeset segment* consists of a single *delta group* holding
3983 3983 changelog data. The *empty chunk* at the end of the *delta group* denotes
3984 3984 the boundary to the *manifest segment*.
3985 3985 </p>
3986 3986 <h2>Manifest Segment</h2>
3987 3987 <p>
3988 3988 The *manifest segment* consists of a single *delta group* holding manifest
3989 3989 data. If treemanifests are in use, it contains only the manifest for the
3990 3990 root directory of the repository. Otherwise, it contains the entire
3991 3991 manifest data. The *empty chunk* at the end of the *delta group* denotes
3992 3992 the boundary to the next segment (either the *treemanifests segment* or the
3993 3993 *filelogs segment*, depending on version and the request options).
3994 3994 </p>
3995 3995 <h3>Treemanifests Segment</h3>
3996 3996 <p>
3997 3997 The *treemanifests segment* only exists in changegroup version &quot;3&quot; and &quot;4&quot;,
3998 3998 and only if the 'treemanifest' param is part of the bundle2 changegroup part
3999 3999 (it is not possible to use changegroup version 3 or 4 outside of bundle2).
4000 4000 Aside from the filenames in the *treemanifests segment* containing a
4001 4001 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
4002 4002 (see below). The final sub-segment is followed by an *empty chunk* (logically,
4003 4003 a sub-segment with filename size 0). This denotes the boundary to the
4004 4004 *filelogs segment*.
4005 4005 </p>
4006 4006 <h2>Filelogs Segment</h2>
4007 4007 <p>
4008 4008 The *filelogs segment* consists of multiple sub-segments, each
4009 4009 corresponding to an individual file whose data is being described:
4010 4010 </p>
4011 4011 <pre>
4012 4012 +--------------------------------------------------+
4013 4013 | | | | | |
4014 4014 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
4015 4015 | | | | | (4 bytes) |
4016 4016 | | | | | |
4017 4017 +--------------------------------------------------+
4018 4018 </pre>
4019 4019 <p>
4020 4020 The final filelog sub-segment is followed by an *empty chunk* (logically,
4021 4021 a sub-segment with filename size 0). This denotes the end of the segment
4022 4022 and of the overall changegroup.
4023 4023 </p>
4024 4024 <p>
4025 4025 Each filelog sub-segment consists of the following:
4026 4026 </p>
4027 4027 <pre>
4028 4028 +------------------------------------------------------+
4029 4029 | | | |
4030 4030 | filename length | filename | delta group |
4031 4031 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
4032 4032 | | | |
4033 4033 +------------------------------------------------------+
4034 4034 </pre>
4035 4035 <p>
4036 4036 That is, a *chunk* consisting of the filename (not terminated or padded)
4037 4037 followed by N chunks constituting the *delta group* for this file. The
4038 4038 *empty chunk* at the end of each *delta group* denotes the boundary to the
4039 4039 next filelog sub-segment.
4040 4040 </p>
4041 4041
4042 4042 </div>
4043 4043 </div>
4044 4044 </div>
4045 4045
4046 4046
4047 4047
4048 4048 </body>
4049 4049 </html>
4050 4050
4051 4051
4052 4052 $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic"
4053 4053 404 Not Found
4054 4054
4055 4055 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4056 4056 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
4057 4057 <head>
4058 4058 <link rel="icon" href="/static/hgicon.png" type="image/png" />
4059 4059 <meta name="robots" content="index, nofollow" />
4060 4060 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
4061 4061 <script type="text/javascript" src="/static/mercurial.js"></script>
4062 4062
4063 4063 <title>test: error</title>
4064 4064 </head>
4065 4065 <body>
4066 4066
4067 4067 <div class="container">
4068 4068 <div class="menu">
4069 4069 <div class="logo">
4070 4070 <a href="https://mercurial-scm.org/">
4071 4071 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
4072 4072 </div>
4073 4073 <ul>
4074 4074 <li><a href="/shortlog">log</a></li>
4075 4075 <li><a href="/graph">graph</a></li>
4076 4076 <li><a href="/tags">tags</a></li>
4077 4077 <li><a href="/bookmarks">bookmarks</a></li>
4078 4078 <li><a href="/branches">branches</a></li>
4079 4079 </ul>
4080 4080 <ul>
4081 4081 <li><a href="/help">help</a></li>
4082 4082 </ul>
4083 4083 </div>
4084 4084
4085 4085 <div class="main">
4086 4086
4087 4087 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
4088 4088 <h3>error</h3>
4089 4089
4090 4090
4091 4091 <form class="search" action="/log">
4092 4092
4093 4093 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
4094 4094 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
4095 4095 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
4096 4096 </form>
4097 4097
4098 4098 <div class="description">
4099 4099 <p>
4100 4100 An error occurred while processing your request:
4101 4101 </p>
4102 4102 <p>
4103 4103 Not Found
4104 4104 </p>
4105 4105 </div>
4106 4106 </div>
4107 4107 </div>
4108 4108
4109 4109
4110 4110
4111 4111 </body>
4112 4112 </html>
4113 4113
4114 4114 [1]
4115 4115
4116 4116 $ killdaemons.py
4117 4117
4118 4118 #endif
General Comments 0
You need to be logged in to leave comments. Login now