##// END OF EJS Templates
auto-upgrade: add an option to silence the tracked-hint message...
marmoute -
r50237:67b210bb default
parent child Browse files
Show More
@@ -1,2821 +1,2827
1 1 # configitems.py - centralized declaration of configuration option
2 2 #
3 3 # Copyright 2017 Pierre-Yves David <pierre-yves.david@octobus.net>
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8
9 9 import functools
10 10 import re
11 11
12 12 from . import (
13 13 encoding,
14 14 error,
15 15 )
16 16
17 17
18 18 def loadconfigtable(ui, extname, configtable):
19 19 """update config item known to the ui with the extension ones"""
20 20 for section, items in sorted(configtable.items()):
21 21 knownitems = ui._knownconfig.setdefault(section, itemregister())
22 22 knownkeys = set(knownitems)
23 23 newkeys = set(items)
24 24 for key in sorted(knownkeys & newkeys):
25 25 msg = b"extension '%s' overwrite config item '%s.%s'"
26 26 msg %= (extname, section, key)
27 27 ui.develwarn(msg, config=b'warn-config')
28 28
29 29 knownitems.update(items)
30 30
31 31
32 32 class configitem:
33 33 """represent a known config item
34 34
35 35 :section: the official config section where to find this item,
36 36 :name: the official name within the section,
37 37 :default: default value for this item,
38 38 :alias: optional list of tuples as alternatives,
39 39 :generic: this is a generic definition, match name using regular expression.
40 40 """
41 41
42 42 def __init__(
43 43 self,
44 44 section,
45 45 name,
46 46 default=None,
47 47 alias=(),
48 48 generic=False,
49 49 priority=0,
50 50 experimental=False,
51 51 ):
52 52 self.section = section
53 53 self.name = name
54 54 self.default = default
55 55 self.alias = list(alias)
56 56 self.generic = generic
57 57 self.priority = priority
58 58 self.experimental = experimental
59 59 self._re = None
60 60 if generic:
61 61 self._re = re.compile(self.name)
62 62
63 63
64 64 class itemregister(dict):
65 65 """A specialized dictionary that can handle wild-card selection"""
66 66
67 67 def __init__(self):
68 68 super(itemregister, self).__init__()
69 69 self._generics = set()
70 70
71 71 def update(self, other):
72 72 super(itemregister, self).update(other)
73 73 self._generics.update(other._generics)
74 74
75 75 def __setitem__(self, key, item):
76 76 super(itemregister, self).__setitem__(key, item)
77 77 if item.generic:
78 78 self._generics.add(item)
79 79
80 80 def get(self, key):
81 81 baseitem = super(itemregister, self).get(key)
82 82 if baseitem is not None and not baseitem.generic:
83 83 return baseitem
84 84
85 85 # search for a matching generic item
86 86 generics = sorted(self._generics, key=(lambda x: (x.priority, x.name)))
87 87 for item in generics:
88 88 # we use 'match' instead of 'search' to make the matching simpler
89 89 # for people unfamiliar with regular expression. Having the match
90 90 # rooted to the start of the string will produce less surprising
91 91 # result for user writing simple regex for sub-attribute.
92 92 #
93 93 # For example using "color\..*" match produces an unsurprising
94 94 # result, while using search could suddenly match apparently
95 95 # unrelated configuration that happens to contains "color."
96 96 # anywhere. This is a tradeoff where we favor requiring ".*" on
97 97 # some match to avoid the need to prefix most pattern with "^".
98 98 # The "^" seems more error prone.
99 99 if item._re.match(key):
100 100 return item
101 101
102 102 return None
103 103
104 104
105 105 coreitems = {}
106 106
107 107
108 108 def _register(configtable, *args, **kwargs):
109 109 item = configitem(*args, **kwargs)
110 110 section = configtable.setdefault(item.section, itemregister())
111 111 if item.name in section:
112 112 msg = b"duplicated config item registration for '%s.%s'"
113 113 raise error.ProgrammingError(msg % (item.section, item.name))
114 114 section[item.name] = item
115 115
116 116
117 117 # special value for case where the default is derived from other values
118 118 dynamicdefault = object()
119 119
120 120 # Registering actual config items
121 121
122 122
123 123 def getitemregister(configtable):
124 124 f = functools.partial(_register, configtable)
125 125 # export pseudo enum as configitem.*
126 126 f.dynamicdefault = dynamicdefault
127 127 return f
128 128
129 129
130 130 coreconfigitem = getitemregister(coreitems)
131 131
132 132
133 133 def _registerdiffopts(section, configprefix=b''):
134 134 coreconfigitem(
135 135 section,
136 136 configprefix + b'nodates',
137 137 default=False,
138 138 )
139 139 coreconfigitem(
140 140 section,
141 141 configprefix + b'showfunc',
142 142 default=False,
143 143 )
144 144 coreconfigitem(
145 145 section,
146 146 configprefix + b'unified',
147 147 default=None,
148 148 )
149 149 coreconfigitem(
150 150 section,
151 151 configprefix + b'git',
152 152 default=False,
153 153 )
154 154 coreconfigitem(
155 155 section,
156 156 configprefix + b'ignorews',
157 157 default=False,
158 158 )
159 159 coreconfigitem(
160 160 section,
161 161 configprefix + b'ignorewsamount',
162 162 default=False,
163 163 )
164 164 coreconfigitem(
165 165 section,
166 166 configprefix + b'ignoreblanklines',
167 167 default=False,
168 168 )
169 169 coreconfigitem(
170 170 section,
171 171 configprefix + b'ignorewseol',
172 172 default=False,
173 173 )
174 174 coreconfigitem(
175 175 section,
176 176 configprefix + b'nobinary',
177 177 default=False,
178 178 )
179 179 coreconfigitem(
180 180 section,
181 181 configprefix + b'noprefix',
182 182 default=False,
183 183 )
184 184 coreconfigitem(
185 185 section,
186 186 configprefix + b'word-diff',
187 187 default=False,
188 188 )
189 189
190 190
191 191 coreconfigitem(
192 192 b'alias',
193 193 b'.*',
194 194 default=dynamicdefault,
195 195 generic=True,
196 196 )
197 197 coreconfigitem(
198 198 b'auth',
199 199 b'cookiefile',
200 200 default=None,
201 201 )
202 202 _registerdiffopts(section=b'annotate')
203 203 # bookmarks.pushing: internal hack for discovery
204 204 coreconfigitem(
205 205 b'bookmarks',
206 206 b'pushing',
207 207 default=list,
208 208 )
209 209 # bundle.mainreporoot: internal hack for bundlerepo
210 210 coreconfigitem(
211 211 b'bundle',
212 212 b'mainreporoot',
213 213 default=b'',
214 214 )
215 215 coreconfigitem(
216 216 b'censor',
217 217 b'policy',
218 218 default=b'abort',
219 219 experimental=True,
220 220 )
221 221 coreconfigitem(
222 222 b'chgserver',
223 223 b'idletimeout',
224 224 default=3600,
225 225 )
226 226 coreconfigitem(
227 227 b'chgserver',
228 228 b'skiphash',
229 229 default=False,
230 230 )
231 231 coreconfigitem(
232 232 b'cmdserver',
233 233 b'log',
234 234 default=None,
235 235 )
236 236 coreconfigitem(
237 237 b'cmdserver',
238 238 b'max-log-files',
239 239 default=7,
240 240 )
241 241 coreconfigitem(
242 242 b'cmdserver',
243 243 b'max-log-size',
244 244 default=b'1 MB',
245 245 )
246 246 coreconfigitem(
247 247 b'cmdserver',
248 248 b'max-repo-cache',
249 249 default=0,
250 250 experimental=True,
251 251 )
252 252 coreconfigitem(
253 253 b'cmdserver',
254 254 b'message-encodings',
255 255 default=list,
256 256 )
257 257 coreconfigitem(
258 258 b'cmdserver',
259 259 b'track-log',
260 260 default=lambda: [b'chgserver', b'cmdserver', b'repocache'],
261 261 )
262 262 coreconfigitem(
263 263 b'cmdserver',
264 264 b'shutdown-on-interrupt',
265 265 default=True,
266 266 )
267 267 coreconfigitem(
268 268 b'color',
269 269 b'.*',
270 270 default=None,
271 271 generic=True,
272 272 )
273 273 coreconfigitem(
274 274 b'color',
275 275 b'mode',
276 276 default=b'auto',
277 277 )
278 278 coreconfigitem(
279 279 b'color',
280 280 b'pagermode',
281 281 default=dynamicdefault,
282 282 )
283 283 coreconfigitem(
284 284 b'command-templates',
285 285 b'graphnode',
286 286 default=None,
287 287 alias=[(b'ui', b'graphnodetemplate')],
288 288 )
289 289 coreconfigitem(
290 290 b'command-templates',
291 291 b'log',
292 292 default=None,
293 293 alias=[(b'ui', b'logtemplate')],
294 294 )
295 295 coreconfigitem(
296 296 b'command-templates',
297 297 b'mergemarker',
298 298 default=(
299 299 b'{node|short} '
300 300 b'{ifeq(tags, "tip", "", '
301 301 b'ifeq(tags, "", "", "{tags} "))}'
302 302 b'{if(bookmarks, "{bookmarks} ")}'
303 303 b'{ifeq(branch, "default", "", "{branch} ")}'
304 304 b'- {author|user}: {desc|firstline}'
305 305 ),
306 306 alias=[(b'ui', b'mergemarkertemplate')],
307 307 )
308 308 coreconfigitem(
309 309 b'command-templates',
310 310 b'pre-merge-tool-output',
311 311 default=None,
312 312 alias=[(b'ui', b'pre-merge-tool-output-template')],
313 313 )
314 314 coreconfigitem(
315 315 b'command-templates',
316 316 b'oneline-summary',
317 317 default=None,
318 318 )
319 319 coreconfigitem(
320 320 b'command-templates',
321 321 b'oneline-summary.*',
322 322 default=dynamicdefault,
323 323 generic=True,
324 324 )
325 325 _registerdiffopts(section=b'commands', configprefix=b'commit.interactive.')
326 326 coreconfigitem(
327 327 b'commands',
328 328 b'commit.post-status',
329 329 default=False,
330 330 )
331 331 coreconfigitem(
332 332 b'commands',
333 333 b'grep.all-files',
334 334 default=False,
335 335 experimental=True,
336 336 )
337 337 coreconfigitem(
338 338 b'commands',
339 339 b'merge.require-rev',
340 340 default=False,
341 341 )
342 342 coreconfigitem(
343 343 b'commands',
344 344 b'push.require-revs',
345 345 default=False,
346 346 )
347 347 coreconfigitem(
348 348 b'commands',
349 349 b'resolve.confirm',
350 350 default=False,
351 351 )
352 352 coreconfigitem(
353 353 b'commands',
354 354 b'resolve.explicit-re-merge',
355 355 default=False,
356 356 )
357 357 coreconfigitem(
358 358 b'commands',
359 359 b'resolve.mark-check',
360 360 default=b'none',
361 361 )
362 362 _registerdiffopts(section=b'commands', configprefix=b'revert.interactive.')
363 363 coreconfigitem(
364 364 b'commands',
365 365 b'show.aliasprefix',
366 366 default=list,
367 367 )
368 368 coreconfigitem(
369 369 b'commands',
370 370 b'status.relative',
371 371 default=False,
372 372 )
373 373 coreconfigitem(
374 374 b'commands',
375 375 b'status.skipstates',
376 376 default=[],
377 377 experimental=True,
378 378 )
379 379 coreconfigitem(
380 380 b'commands',
381 381 b'status.terse',
382 382 default=b'',
383 383 )
384 384 coreconfigitem(
385 385 b'commands',
386 386 b'status.verbose',
387 387 default=False,
388 388 )
389 389 coreconfigitem(
390 390 b'commands',
391 391 b'update.check',
392 392 default=None,
393 393 )
394 394 coreconfigitem(
395 395 b'commands',
396 396 b'update.requiredest',
397 397 default=False,
398 398 )
399 399 coreconfigitem(
400 400 b'committemplate',
401 401 b'.*',
402 402 default=None,
403 403 generic=True,
404 404 )
405 405 coreconfigitem(
406 406 b'convert',
407 407 b'bzr.saverev',
408 408 default=True,
409 409 )
410 410 coreconfigitem(
411 411 b'convert',
412 412 b'cvsps.cache',
413 413 default=True,
414 414 )
415 415 coreconfigitem(
416 416 b'convert',
417 417 b'cvsps.fuzz',
418 418 default=60,
419 419 )
420 420 coreconfigitem(
421 421 b'convert',
422 422 b'cvsps.logencoding',
423 423 default=None,
424 424 )
425 425 coreconfigitem(
426 426 b'convert',
427 427 b'cvsps.mergefrom',
428 428 default=None,
429 429 )
430 430 coreconfigitem(
431 431 b'convert',
432 432 b'cvsps.mergeto',
433 433 default=None,
434 434 )
435 435 coreconfigitem(
436 436 b'convert',
437 437 b'git.committeractions',
438 438 default=lambda: [b'messagedifferent'],
439 439 )
440 440 coreconfigitem(
441 441 b'convert',
442 442 b'git.extrakeys',
443 443 default=list,
444 444 )
445 445 coreconfigitem(
446 446 b'convert',
447 447 b'git.findcopiesharder',
448 448 default=False,
449 449 )
450 450 coreconfigitem(
451 451 b'convert',
452 452 b'git.remoteprefix',
453 453 default=b'remote',
454 454 )
455 455 coreconfigitem(
456 456 b'convert',
457 457 b'git.renamelimit',
458 458 default=400,
459 459 )
460 460 coreconfigitem(
461 461 b'convert',
462 462 b'git.saverev',
463 463 default=True,
464 464 )
465 465 coreconfigitem(
466 466 b'convert',
467 467 b'git.similarity',
468 468 default=50,
469 469 )
470 470 coreconfigitem(
471 471 b'convert',
472 472 b'git.skipsubmodules',
473 473 default=False,
474 474 )
475 475 coreconfigitem(
476 476 b'convert',
477 477 b'hg.clonebranches',
478 478 default=False,
479 479 )
480 480 coreconfigitem(
481 481 b'convert',
482 482 b'hg.ignoreerrors',
483 483 default=False,
484 484 )
485 485 coreconfigitem(
486 486 b'convert',
487 487 b'hg.preserve-hash',
488 488 default=False,
489 489 )
490 490 coreconfigitem(
491 491 b'convert',
492 492 b'hg.revs',
493 493 default=None,
494 494 )
495 495 coreconfigitem(
496 496 b'convert',
497 497 b'hg.saverev',
498 498 default=False,
499 499 )
500 500 coreconfigitem(
501 501 b'convert',
502 502 b'hg.sourcename',
503 503 default=None,
504 504 )
505 505 coreconfigitem(
506 506 b'convert',
507 507 b'hg.startrev',
508 508 default=None,
509 509 )
510 510 coreconfigitem(
511 511 b'convert',
512 512 b'hg.tagsbranch',
513 513 default=b'default',
514 514 )
515 515 coreconfigitem(
516 516 b'convert',
517 517 b'hg.usebranchnames',
518 518 default=True,
519 519 )
520 520 coreconfigitem(
521 521 b'convert',
522 522 b'ignoreancestorcheck',
523 523 default=False,
524 524 experimental=True,
525 525 )
526 526 coreconfigitem(
527 527 b'convert',
528 528 b'localtimezone',
529 529 default=False,
530 530 )
531 531 coreconfigitem(
532 532 b'convert',
533 533 b'p4.encoding',
534 534 default=dynamicdefault,
535 535 )
536 536 coreconfigitem(
537 537 b'convert',
538 538 b'p4.startrev',
539 539 default=0,
540 540 )
541 541 coreconfigitem(
542 542 b'convert',
543 543 b'skiptags',
544 544 default=False,
545 545 )
546 546 coreconfigitem(
547 547 b'convert',
548 548 b'svn.debugsvnlog',
549 549 default=True,
550 550 )
551 551 coreconfigitem(
552 552 b'convert',
553 553 b'svn.trunk',
554 554 default=None,
555 555 )
556 556 coreconfigitem(
557 557 b'convert',
558 558 b'svn.tags',
559 559 default=None,
560 560 )
561 561 coreconfigitem(
562 562 b'convert',
563 563 b'svn.branches',
564 564 default=None,
565 565 )
566 566 coreconfigitem(
567 567 b'convert',
568 568 b'svn.startrev',
569 569 default=0,
570 570 )
571 571 coreconfigitem(
572 572 b'convert',
573 573 b'svn.dangerous-set-commit-dates',
574 574 default=False,
575 575 )
576 576 coreconfigitem(
577 577 b'debug',
578 578 b'dirstate.delaywrite',
579 579 default=0,
580 580 )
581 581 coreconfigitem(
582 582 b'debug',
583 583 b'revlog.verifyposition.changelog',
584 584 default=b'',
585 585 )
586 586 coreconfigitem(
587 587 b'debug',
588 588 b'revlog.debug-delta',
589 589 default=False,
590 590 )
591 591 coreconfigitem(
592 592 b'defaults',
593 593 b'.*',
594 594 default=None,
595 595 generic=True,
596 596 )
597 597 coreconfigitem(
598 598 b'devel',
599 599 b'all-warnings',
600 600 default=False,
601 601 )
602 602 coreconfigitem(
603 603 b'devel',
604 604 b'bundle2.debug',
605 605 default=False,
606 606 )
607 607 coreconfigitem(
608 608 b'devel',
609 609 b'bundle.delta',
610 610 default=b'',
611 611 )
612 612 coreconfigitem(
613 613 b'devel',
614 614 b'cache-vfs',
615 615 default=None,
616 616 )
617 617 coreconfigitem(
618 618 b'devel',
619 619 b'check-locks',
620 620 default=False,
621 621 )
622 622 coreconfigitem(
623 623 b'devel',
624 624 b'check-relroot',
625 625 default=False,
626 626 )
627 627 # Track copy information for all file, not just "added" one (very slow)
628 628 coreconfigitem(
629 629 b'devel',
630 630 b'copy-tracing.trace-all-files',
631 631 default=False,
632 632 )
633 633 coreconfigitem(
634 634 b'devel',
635 635 b'default-date',
636 636 default=None,
637 637 )
638 638 coreconfigitem(
639 639 b'devel',
640 640 b'deprec-warn',
641 641 default=False,
642 642 )
643 643 coreconfigitem(
644 644 b'devel',
645 645 b'disableloaddefaultcerts',
646 646 default=False,
647 647 )
648 648 coreconfigitem(
649 649 b'devel',
650 650 b'warn-empty-changegroup',
651 651 default=False,
652 652 )
653 653 coreconfigitem(
654 654 b'devel',
655 655 b'legacy.exchange',
656 656 default=list,
657 657 )
658 658 # When True, revlogs use a special reference version of the nodemap, that is not
659 659 # performant but is "known" to behave properly.
660 660 coreconfigitem(
661 661 b'devel',
662 662 b'persistent-nodemap',
663 663 default=False,
664 664 )
665 665 coreconfigitem(
666 666 b'devel',
667 667 b'servercafile',
668 668 default=b'',
669 669 )
670 670 coreconfigitem(
671 671 b'devel',
672 672 b'serverexactprotocol',
673 673 default=b'',
674 674 )
675 675 coreconfigitem(
676 676 b'devel',
677 677 b'serverrequirecert',
678 678 default=False,
679 679 )
680 680 coreconfigitem(
681 681 b'devel',
682 682 b'strip-obsmarkers',
683 683 default=True,
684 684 )
685 685 coreconfigitem(
686 686 b'devel',
687 687 b'warn-config',
688 688 default=None,
689 689 )
690 690 coreconfigitem(
691 691 b'devel',
692 692 b'warn-config-default',
693 693 default=None,
694 694 )
695 695 coreconfigitem(
696 696 b'devel',
697 697 b'user.obsmarker',
698 698 default=None,
699 699 )
700 700 coreconfigitem(
701 701 b'devel',
702 702 b'warn-config-unknown',
703 703 default=None,
704 704 )
705 705 coreconfigitem(
706 706 b'devel',
707 707 b'debug.copies',
708 708 default=False,
709 709 )
710 710 coreconfigitem(
711 711 b'devel',
712 712 b'copy-tracing.multi-thread',
713 713 default=True,
714 714 )
715 715 coreconfigitem(
716 716 b'devel',
717 717 b'debug.extensions',
718 718 default=False,
719 719 )
720 720 coreconfigitem(
721 721 b'devel',
722 722 b'debug.repo-filters',
723 723 default=False,
724 724 )
725 725 coreconfigitem(
726 726 b'devel',
727 727 b'debug.peer-request',
728 728 default=False,
729 729 )
730 730 # If discovery.exchange-heads is False, the discovery will not start with
731 731 # remote head fetching and local head querying.
732 732 coreconfigitem(
733 733 b'devel',
734 734 b'discovery.exchange-heads',
735 735 default=True,
736 736 )
737 737 # If discovery.grow-sample is False, the sample size used in set discovery will
738 738 # not be increased through the process
739 739 coreconfigitem(
740 740 b'devel',
741 741 b'discovery.grow-sample',
742 742 default=True,
743 743 )
744 744 # When discovery.grow-sample.dynamic is True, the default, the sample size is
745 745 # adapted to the shape of the undecided set (it is set to the max of:
746 746 # <target-size>, len(roots(undecided)), len(heads(undecided)
747 747 coreconfigitem(
748 748 b'devel',
749 749 b'discovery.grow-sample.dynamic',
750 750 default=True,
751 751 )
752 752 # discovery.grow-sample.rate control the rate at which the sample grow
753 753 coreconfigitem(
754 754 b'devel',
755 755 b'discovery.grow-sample.rate',
756 756 default=1.05,
757 757 )
758 758 # If discovery.randomize is False, random sampling during discovery are
759 759 # deterministic. It is meant for integration tests.
760 760 coreconfigitem(
761 761 b'devel',
762 762 b'discovery.randomize',
763 763 default=True,
764 764 )
765 765 # Control the initial size of the discovery sample
766 766 coreconfigitem(
767 767 b'devel',
768 768 b'discovery.sample-size',
769 769 default=200,
770 770 )
771 771 # Control the initial size of the discovery for initial change
772 772 coreconfigitem(
773 773 b'devel',
774 774 b'discovery.sample-size.initial',
775 775 default=100,
776 776 )
777 777 _registerdiffopts(section=b'diff')
778 778 coreconfigitem(
779 779 b'diff',
780 780 b'merge',
781 781 default=False,
782 782 experimental=True,
783 783 )
784 784 coreconfigitem(
785 785 b'email',
786 786 b'bcc',
787 787 default=None,
788 788 )
789 789 coreconfigitem(
790 790 b'email',
791 791 b'cc',
792 792 default=None,
793 793 )
794 794 coreconfigitem(
795 795 b'email',
796 796 b'charsets',
797 797 default=list,
798 798 )
799 799 coreconfigitem(
800 800 b'email',
801 801 b'from',
802 802 default=None,
803 803 )
804 804 coreconfigitem(
805 805 b'email',
806 806 b'method',
807 807 default=b'smtp',
808 808 )
809 809 coreconfigitem(
810 810 b'email',
811 811 b'reply-to',
812 812 default=None,
813 813 )
814 814 coreconfigitem(
815 815 b'email',
816 816 b'to',
817 817 default=None,
818 818 )
819 819 coreconfigitem(
820 820 b'experimental',
821 821 b'archivemetatemplate',
822 822 default=dynamicdefault,
823 823 )
824 824 coreconfigitem(
825 825 b'experimental',
826 826 b'auto-publish',
827 827 default=b'publish',
828 828 )
829 829 coreconfigitem(
830 830 b'experimental',
831 831 b'bundle-phases',
832 832 default=False,
833 833 )
834 834 coreconfigitem(
835 835 b'experimental',
836 836 b'bundle2-advertise',
837 837 default=True,
838 838 )
839 839 coreconfigitem(
840 840 b'experimental',
841 841 b'bundle2-output-capture',
842 842 default=False,
843 843 )
844 844 coreconfigitem(
845 845 b'experimental',
846 846 b'bundle2.pushback',
847 847 default=False,
848 848 )
849 849 coreconfigitem(
850 850 b'experimental',
851 851 b'bundle2lazylocking',
852 852 default=False,
853 853 )
854 854 coreconfigitem(
855 855 b'experimental',
856 856 b'bundlecomplevel',
857 857 default=None,
858 858 )
859 859 coreconfigitem(
860 860 b'experimental',
861 861 b'bundlecomplevel.bzip2',
862 862 default=None,
863 863 )
864 864 coreconfigitem(
865 865 b'experimental',
866 866 b'bundlecomplevel.gzip',
867 867 default=None,
868 868 )
869 869 coreconfigitem(
870 870 b'experimental',
871 871 b'bundlecomplevel.none',
872 872 default=None,
873 873 )
874 874 coreconfigitem(
875 875 b'experimental',
876 876 b'bundlecomplevel.zstd',
877 877 default=None,
878 878 )
879 879 coreconfigitem(
880 880 b'experimental',
881 881 b'bundlecompthreads',
882 882 default=None,
883 883 )
884 884 coreconfigitem(
885 885 b'experimental',
886 886 b'bundlecompthreads.bzip2',
887 887 default=None,
888 888 )
889 889 coreconfigitem(
890 890 b'experimental',
891 891 b'bundlecompthreads.gzip',
892 892 default=None,
893 893 )
894 894 coreconfigitem(
895 895 b'experimental',
896 896 b'bundlecompthreads.none',
897 897 default=None,
898 898 )
899 899 coreconfigitem(
900 900 b'experimental',
901 901 b'bundlecompthreads.zstd',
902 902 default=None,
903 903 )
904 904 coreconfigitem(
905 905 b'experimental',
906 906 b'changegroup3',
907 907 default=False,
908 908 )
909 909 coreconfigitem(
910 910 b'experimental',
911 911 b'changegroup4',
912 912 default=False,
913 913 )
914 914 coreconfigitem(
915 915 b'experimental',
916 916 b'cleanup-as-archived',
917 917 default=False,
918 918 )
919 919 coreconfigitem(
920 920 b'experimental',
921 921 b'clientcompressionengines',
922 922 default=list,
923 923 )
924 924 coreconfigitem(
925 925 b'experimental',
926 926 b'copytrace',
927 927 default=b'on',
928 928 )
929 929 coreconfigitem(
930 930 b'experimental',
931 931 b'copytrace.movecandidateslimit',
932 932 default=100,
933 933 )
934 934 coreconfigitem(
935 935 b'experimental',
936 936 b'copytrace.sourcecommitlimit',
937 937 default=100,
938 938 )
939 939 coreconfigitem(
940 940 b'experimental',
941 941 b'copies.read-from',
942 942 default=b"filelog-only",
943 943 )
944 944 coreconfigitem(
945 945 b'experimental',
946 946 b'copies.write-to',
947 947 default=b'filelog-only',
948 948 )
949 949 coreconfigitem(
950 950 b'experimental',
951 951 b'crecordtest',
952 952 default=None,
953 953 )
954 954 coreconfigitem(
955 955 b'experimental',
956 956 b'directaccess',
957 957 default=False,
958 958 )
959 959 coreconfigitem(
960 960 b'experimental',
961 961 b'directaccess.revnums',
962 962 default=False,
963 963 )
964 964 coreconfigitem(
965 965 b'experimental',
966 966 b'editortmpinhg',
967 967 default=False,
968 968 )
969 969 coreconfigitem(
970 970 b'experimental',
971 971 b'evolution',
972 972 default=list,
973 973 )
974 974 coreconfigitem(
975 975 b'experimental',
976 976 b'evolution.allowdivergence',
977 977 default=False,
978 978 alias=[(b'experimental', b'allowdivergence')],
979 979 )
980 980 coreconfigitem(
981 981 b'experimental',
982 982 b'evolution.allowunstable',
983 983 default=None,
984 984 )
985 985 coreconfigitem(
986 986 b'experimental',
987 987 b'evolution.createmarkers',
988 988 default=None,
989 989 )
990 990 coreconfigitem(
991 991 b'experimental',
992 992 b'evolution.effect-flags',
993 993 default=True,
994 994 alias=[(b'experimental', b'effect-flags')],
995 995 )
996 996 coreconfigitem(
997 997 b'experimental',
998 998 b'evolution.exchange',
999 999 default=None,
1000 1000 )
1001 1001 coreconfigitem(
1002 1002 b'experimental',
1003 1003 b'evolution.bundle-obsmarker',
1004 1004 default=False,
1005 1005 )
1006 1006 coreconfigitem(
1007 1007 b'experimental',
1008 1008 b'evolution.bundle-obsmarker:mandatory',
1009 1009 default=True,
1010 1010 )
1011 1011 coreconfigitem(
1012 1012 b'experimental',
1013 1013 b'log.topo',
1014 1014 default=False,
1015 1015 )
1016 1016 coreconfigitem(
1017 1017 b'experimental',
1018 1018 b'evolution.report-instabilities',
1019 1019 default=True,
1020 1020 )
1021 1021 coreconfigitem(
1022 1022 b'experimental',
1023 1023 b'evolution.track-operation',
1024 1024 default=True,
1025 1025 )
1026 1026 # repo-level config to exclude a revset visibility
1027 1027 #
1028 1028 # The target use case is to use `share` to expose different subset of the same
1029 1029 # repository, especially server side. See also `server.view`.
1030 1030 coreconfigitem(
1031 1031 b'experimental',
1032 1032 b'extra-filter-revs',
1033 1033 default=None,
1034 1034 )
1035 1035 coreconfigitem(
1036 1036 b'experimental',
1037 1037 b'maxdeltachainspan',
1038 1038 default=-1,
1039 1039 )
1040 1040 # tracks files which were undeleted (merge might delete them but we explicitly
1041 1041 # kept/undeleted them) and creates new filenodes for them
1042 1042 coreconfigitem(
1043 1043 b'experimental',
1044 1044 b'merge-track-salvaged',
1045 1045 default=False,
1046 1046 )
1047 1047 coreconfigitem(
1048 1048 b'experimental',
1049 1049 b'mmapindexthreshold',
1050 1050 default=None,
1051 1051 )
1052 1052 coreconfigitem(
1053 1053 b'experimental',
1054 1054 b'narrow',
1055 1055 default=False,
1056 1056 )
1057 1057 coreconfigitem(
1058 1058 b'experimental',
1059 1059 b'nonnormalparanoidcheck',
1060 1060 default=False,
1061 1061 )
1062 1062 coreconfigitem(
1063 1063 b'experimental',
1064 1064 b'exportableenviron',
1065 1065 default=list,
1066 1066 )
1067 1067 coreconfigitem(
1068 1068 b'experimental',
1069 1069 b'extendedheader.index',
1070 1070 default=None,
1071 1071 )
1072 1072 coreconfigitem(
1073 1073 b'experimental',
1074 1074 b'extendedheader.similarity',
1075 1075 default=False,
1076 1076 )
1077 1077 coreconfigitem(
1078 1078 b'experimental',
1079 1079 b'graphshorten',
1080 1080 default=False,
1081 1081 )
1082 1082 coreconfigitem(
1083 1083 b'experimental',
1084 1084 b'graphstyle.parent',
1085 1085 default=dynamicdefault,
1086 1086 )
1087 1087 coreconfigitem(
1088 1088 b'experimental',
1089 1089 b'graphstyle.missing',
1090 1090 default=dynamicdefault,
1091 1091 )
1092 1092 coreconfigitem(
1093 1093 b'experimental',
1094 1094 b'graphstyle.grandparent',
1095 1095 default=dynamicdefault,
1096 1096 )
1097 1097 coreconfigitem(
1098 1098 b'experimental',
1099 1099 b'hook-track-tags',
1100 1100 default=False,
1101 1101 )
1102 1102 coreconfigitem(
1103 1103 b'experimental',
1104 1104 b'httppostargs',
1105 1105 default=False,
1106 1106 )
1107 1107 coreconfigitem(b'experimental', b'nointerrupt', default=False)
1108 1108 coreconfigitem(b'experimental', b'nointerrupt-interactiveonly', default=True)
1109 1109
1110 1110 coreconfigitem(
1111 1111 b'experimental',
1112 1112 b'obsmarkers-exchange-debug',
1113 1113 default=False,
1114 1114 )
1115 1115 coreconfigitem(
1116 1116 b'experimental',
1117 1117 b'remotenames',
1118 1118 default=False,
1119 1119 )
1120 1120 coreconfigitem(
1121 1121 b'experimental',
1122 1122 b'removeemptydirs',
1123 1123 default=True,
1124 1124 )
1125 1125 coreconfigitem(
1126 1126 b'experimental',
1127 1127 b'revert.interactive.select-to-keep',
1128 1128 default=False,
1129 1129 )
1130 1130 coreconfigitem(
1131 1131 b'experimental',
1132 1132 b'revisions.prefixhexnode',
1133 1133 default=False,
1134 1134 )
1135 1135 # "out of experimental" todo list.
1136 1136 #
1137 1137 # * include management of a persistent nodemap in the main docket
1138 1138 # * enforce a "no-truncate" policy for mmap safety
1139 1139 # - for censoring operation
1140 1140 # - for stripping operation
1141 1141 # - for rollback operation
1142 1142 # * proper streaming (race free) of the docket file
1143 1143 # * track garbage data to evemtually allow rewriting -existing- sidedata.
1144 1144 # * Exchange-wise, we will also need to do something more efficient than
1145 1145 # keeping references to the affected revlogs, especially memory-wise when
1146 1146 # rewriting sidedata.
1147 1147 # * introduce a proper solution to reduce the number of filelog related files.
1148 1148 # * use caching for reading sidedata (similar to what we do for data).
1149 1149 # * no longer set offset=0 if sidedata_size=0 (simplify cutoff computation).
1150 1150 # * Improvement to consider
1151 1151 # - avoid compression header in chunk using the default compression?
1152 1152 # - forbid "inline" compression mode entirely?
1153 1153 # - split the data offset and flag field (the 2 bytes save are mostly trouble)
1154 1154 # - keep track of uncompressed -chunk- size (to preallocate memory better)
1155 1155 # - keep track of chain base or size (probably not that useful anymore)
1156 1156 coreconfigitem(
1157 1157 b'experimental',
1158 1158 b'revlogv2',
1159 1159 default=None,
1160 1160 )
1161 1161 coreconfigitem(
1162 1162 b'experimental',
1163 1163 b'revisions.disambiguatewithin',
1164 1164 default=None,
1165 1165 )
1166 1166 coreconfigitem(
1167 1167 b'experimental',
1168 1168 b'rust.index',
1169 1169 default=False,
1170 1170 )
1171 1171 coreconfigitem(
1172 1172 b'experimental',
1173 1173 b'server.filesdata.recommended-batch-size',
1174 1174 default=50000,
1175 1175 )
1176 1176 coreconfigitem(
1177 1177 b'experimental',
1178 1178 b'server.manifestdata.recommended-batch-size',
1179 1179 default=100000,
1180 1180 )
1181 1181 coreconfigitem(
1182 1182 b'experimental',
1183 1183 b'server.stream-narrow-clones',
1184 1184 default=False,
1185 1185 )
1186 1186 coreconfigitem(
1187 1187 b'experimental',
1188 1188 b'single-head-per-branch',
1189 1189 default=False,
1190 1190 )
1191 1191 coreconfigitem(
1192 1192 b'experimental',
1193 1193 b'single-head-per-branch:account-closed-heads',
1194 1194 default=False,
1195 1195 )
1196 1196 coreconfigitem(
1197 1197 b'experimental',
1198 1198 b'single-head-per-branch:public-changes-only',
1199 1199 default=False,
1200 1200 )
1201 1201 coreconfigitem(
1202 1202 b'experimental',
1203 1203 b'sparse-read',
1204 1204 default=False,
1205 1205 )
1206 1206 coreconfigitem(
1207 1207 b'experimental',
1208 1208 b'sparse-read.density-threshold',
1209 1209 default=0.50,
1210 1210 )
1211 1211 coreconfigitem(
1212 1212 b'experimental',
1213 1213 b'sparse-read.min-gap-size',
1214 1214 default=b'65K',
1215 1215 )
1216 1216 coreconfigitem(
1217 1217 b'experimental',
1218 1218 b'treemanifest',
1219 1219 default=False,
1220 1220 )
1221 1221 coreconfigitem(
1222 1222 b'experimental',
1223 1223 b'update.atomic-file',
1224 1224 default=False,
1225 1225 )
1226 1226 coreconfigitem(
1227 1227 b'experimental',
1228 1228 b'web.full-garbage-collection-rate',
1229 1229 default=1, # still forcing a full collection on each request
1230 1230 )
1231 1231 coreconfigitem(
1232 1232 b'experimental',
1233 1233 b'worker.wdir-get-thread-safe',
1234 1234 default=False,
1235 1235 )
1236 1236 coreconfigitem(
1237 1237 b'experimental',
1238 1238 b'worker.repository-upgrade',
1239 1239 default=False,
1240 1240 )
1241 1241 coreconfigitem(
1242 1242 b'experimental',
1243 1243 b'xdiff',
1244 1244 default=False,
1245 1245 )
1246 1246 coreconfigitem(
1247 1247 b'extensions',
1248 1248 b'[^:]*',
1249 1249 default=None,
1250 1250 generic=True,
1251 1251 )
1252 1252 coreconfigitem(
1253 1253 b'extensions',
1254 1254 b'[^:]*:required',
1255 1255 default=False,
1256 1256 generic=True,
1257 1257 )
1258 1258 coreconfigitem(
1259 1259 b'extdata',
1260 1260 b'.*',
1261 1261 default=None,
1262 1262 generic=True,
1263 1263 )
1264 1264 coreconfigitem(
1265 1265 b'format',
1266 1266 b'bookmarks-in-store',
1267 1267 default=False,
1268 1268 )
1269 1269 coreconfigitem(
1270 1270 b'format',
1271 1271 b'chunkcachesize',
1272 1272 default=None,
1273 1273 experimental=True,
1274 1274 )
1275 1275 coreconfigitem(
1276 1276 # Enable this dirstate format *when creating a new repository*.
1277 1277 # Which format to use for existing repos is controlled by .hg/requires
1278 1278 b'format',
1279 1279 b'use-dirstate-v2',
1280 1280 default=False,
1281 1281 experimental=True,
1282 1282 alias=[(b'format', b'exp-rc-dirstate-v2')],
1283 1283 )
1284 1284 coreconfigitem(
1285 1285 b'format',
1286 1286 b'use-dirstate-v2.automatic-upgrade-of-mismatching-repositories',
1287 1287 default=False,
1288 1288 experimental=True,
1289 1289 )
1290 1290 coreconfigitem(
1291 1291 b'format',
1292 1292 b'use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet',
1293 1293 default=False,
1294 1294 experimental=True,
1295 1295 )
1296 1296 coreconfigitem(
1297 1297 b'format',
1298 1298 b'use-dirstate-tracked-hint',
1299 1299 default=False,
1300 1300 experimental=True,
1301 1301 )
1302 1302 coreconfigitem(
1303 1303 b'format',
1304 1304 b'use-dirstate-tracked-hint.version',
1305 1305 default=1,
1306 1306 experimental=True,
1307 1307 )
1308 1308 coreconfigitem(
1309 1309 b'format',
1310 1310 b'use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories',
1311 1311 default=False,
1312 1312 experimental=True,
1313 1313 )
1314 1314 coreconfigitem(
1315 1315 b'format',
1316 b'use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet',
1317 default=False,
1318 experimental=True,
1319 )
1320 coreconfigitem(
1321 b'format',
1316 1322 b'dotencode',
1317 1323 default=True,
1318 1324 )
1319 1325 coreconfigitem(
1320 1326 b'format',
1321 1327 b'generaldelta',
1322 1328 default=False,
1323 1329 experimental=True,
1324 1330 )
1325 1331 coreconfigitem(
1326 1332 b'format',
1327 1333 b'manifestcachesize',
1328 1334 default=None,
1329 1335 experimental=True,
1330 1336 )
1331 1337 coreconfigitem(
1332 1338 b'format',
1333 1339 b'maxchainlen',
1334 1340 default=dynamicdefault,
1335 1341 experimental=True,
1336 1342 )
1337 1343 coreconfigitem(
1338 1344 b'format',
1339 1345 b'obsstore-version',
1340 1346 default=None,
1341 1347 )
1342 1348 coreconfigitem(
1343 1349 b'format',
1344 1350 b'sparse-revlog',
1345 1351 default=True,
1346 1352 )
1347 1353 coreconfigitem(
1348 1354 b'format',
1349 1355 b'revlog-compression',
1350 1356 default=lambda: [b'zstd', b'zlib'],
1351 1357 alias=[(b'experimental', b'format.compression')],
1352 1358 )
1353 1359 # Experimental TODOs:
1354 1360 #
1355 1361 # * Same as for revlogv2 (but for the reduction of the number of files)
1356 1362 # * Actually computing the rank of changesets
1357 1363 # * Improvement to investigate
1358 1364 # - storing .hgtags fnode
1359 1365 # - storing branch related identifier
1360 1366
1361 1367 coreconfigitem(
1362 1368 b'format',
1363 1369 b'exp-use-changelog-v2',
1364 1370 default=None,
1365 1371 experimental=True,
1366 1372 )
1367 1373 coreconfigitem(
1368 1374 b'format',
1369 1375 b'usefncache',
1370 1376 default=True,
1371 1377 )
1372 1378 coreconfigitem(
1373 1379 b'format',
1374 1380 b'usegeneraldelta',
1375 1381 default=True,
1376 1382 )
1377 1383 coreconfigitem(
1378 1384 b'format',
1379 1385 b'usestore',
1380 1386 default=True,
1381 1387 )
1382 1388
1383 1389
1384 1390 def _persistent_nodemap_default():
1385 1391 """compute `use-persistent-nodemap` default value
1386 1392
1387 1393 The feature is disabled unless a fast implementation is available.
1388 1394 """
1389 1395 from . import policy
1390 1396
1391 1397 return policy.importrust('revlog') is not None
1392 1398
1393 1399
1394 1400 coreconfigitem(
1395 1401 b'format',
1396 1402 b'use-persistent-nodemap',
1397 1403 default=_persistent_nodemap_default,
1398 1404 )
1399 1405 coreconfigitem(
1400 1406 b'format',
1401 1407 b'exp-use-copies-side-data-changeset',
1402 1408 default=False,
1403 1409 experimental=True,
1404 1410 )
1405 1411 coreconfigitem(
1406 1412 b'format',
1407 1413 b'use-share-safe',
1408 1414 default=True,
1409 1415 )
1410 1416 coreconfigitem(
1411 1417 b'format',
1412 1418 b'use-share-safe.automatic-upgrade-of-mismatching-repositories',
1413 1419 default=False,
1414 1420 experimental=True,
1415 1421 )
1416 1422 coreconfigitem(
1417 1423 b'format',
1418 1424 b'use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet',
1419 1425 default=False,
1420 1426 experimental=True,
1421 1427 )
1422 1428 coreconfigitem(
1423 1429 b'format',
1424 1430 b'internal-phase',
1425 1431 default=False,
1426 1432 experimental=True,
1427 1433 )
1428 1434 coreconfigitem(
1429 1435 b'fsmonitor',
1430 1436 b'warn_when_unused',
1431 1437 default=True,
1432 1438 )
1433 1439 coreconfigitem(
1434 1440 b'fsmonitor',
1435 1441 b'warn_update_file_count',
1436 1442 default=50000,
1437 1443 )
1438 1444 coreconfigitem(
1439 1445 b'fsmonitor',
1440 1446 b'warn_update_file_count_rust',
1441 1447 default=400000,
1442 1448 )
1443 1449 coreconfigitem(
1444 1450 b'help',
1445 1451 br'hidden-command\..*',
1446 1452 default=False,
1447 1453 generic=True,
1448 1454 )
1449 1455 coreconfigitem(
1450 1456 b'help',
1451 1457 br'hidden-topic\..*',
1452 1458 default=False,
1453 1459 generic=True,
1454 1460 )
1455 1461 coreconfigitem(
1456 1462 b'hooks',
1457 1463 b'[^:]*',
1458 1464 default=dynamicdefault,
1459 1465 generic=True,
1460 1466 )
1461 1467 coreconfigitem(
1462 1468 b'hooks',
1463 1469 b'.*:run-with-plain',
1464 1470 default=True,
1465 1471 generic=True,
1466 1472 )
1467 1473 coreconfigitem(
1468 1474 b'hgweb-paths',
1469 1475 b'.*',
1470 1476 default=list,
1471 1477 generic=True,
1472 1478 )
1473 1479 coreconfigitem(
1474 1480 b'hostfingerprints',
1475 1481 b'.*',
1476 1482 default=list,
1477 1483 generic=True,
1478 1484 )
1479 1485 coreconfigitem(
1480 1486 b'hostsecurity',
1481 1487 b'ciphers',
1482 1488 default=None,
1483 1489 )
1484 1490 coreconfigitem(
1485 1491 b'hostsecurity',
1486 1492 b'minimumprotocol',
1487 1493 default=dynamicdefault,
1488 1494 )
1489 1495 coreconfigitem(
1490 1496 b'hostsecurity',
1491 1497 b'.*:minimumprotocol$',
1492 1498 default=dynamicdefault,
1493 1499 generic=True,
1494 1500 )
1495 1501 coreconfigitem(
1496 1502 b'hostsecurity',
1497 1503 b'.*:ciphers$',
1498 1504 default=dynamicdefault,
1499 1505 generic=True,
1500 1506 )
1501 1507 coreconfigitem(
1502 1508 b'hostsecurity',
1503 1509 b'.*:fingerprints$',
1504 1510 default=list,
1505 1511 generic=True,
1506 1512 )
1507 1513 coreconfigitem(
1508 1514 b'hostsecurity',
1509 1515 b'.*:verifycertsfile$',
1510 1516 default=None,
1511 1517 generic=True,
1512 1518 )
1513 1519
1514 1520 coreconfigitem(
1515 1521 b'http_proxy',
1516 1522 b'always',
1517 1523 default=False,
1518 1524 )
1519 1525 coreconfigitem(
1520 1526 b'http_proxy',
1521 1527 b'host',
1522 1528 default=None,
1523 1529 )
1524 1530 coreconfigitem(
1525 1531 b'http_proxy',
1526 1532 b'no',
1527 1533 default=list,
1528 1534 )
1529 1535 coreconfigitem(
1530 1536 b'http_proxy',
1531 1537 b'passwd',
1532 1538 default=None,
1533 1539 )
1534 1540 coreconfigitem(
1535 1541 b'http_proxy',
1536 1542 b'user',
1537 1543 default=None,
1538 1544 )
1539 1545
1540 1546 coreconfigitem(
1541 1547 b'http',
1542 1548 b'timeout',
1543 1549 default=None,
1544 1550 )
1545 1551
1546 1552 coreconfigitem(
1547 1553 b'logtoprocess',
1548 1554 b'commandexception',
1549 1555 default=None,
1550 1556 )
1551 1557 coreconfigitem(
1552 1558 b'logtoprocess',
1553 1559 b'commandfinish',
1554 1560 default=None,
1555 1561 )
1556 1562 coreconfigitem(
1557 1563 b'logtoprocess',
1558 1564 b'command',
1559 1565 default=None,
1560 1566 )
1561 1567 coreconfigitem(
1562 1568 b'logtoprocess',
1563 1569 b'develwarn',
1564 1570 default=None,
1565 1571 )
1566 1572 coreconfigitem(
1567 1573 b'logtoprocess',
1568 1574 b'uiblocked',
1569 1575 default=None,
1570 1576 )
1571 1577 coreconfigitem(
1572 1578 b'merge',
1573 1579 b'checkunknown',
1574 1580 default=b'abort',
1575 1581 )
1576 1582 coreconfigitem(
1577 1583 b'merge',
1578 1584 b'checkignored',
1579 1585 default=b'abort',
1580 1586 )
1581 1587 coreconfigitem(
1582 1588 b'experimental',
1583 1589 b'merge.checkpathconflicts',
1584 1590 default=False,
1585 1591 )
1586 1592 coreconfigitem(
1587 1593 b'merge',
1588 1594 b'followcopies',
1589 1595 default=True,
1590 1596 )
1591 1597 coreconfigitem(
1592 1598 b'merge',
1593 1599 b'on-failure',
1594 1600 default=b'continue',
1595 1601 )
1596 1602 coreconfigitem(
1597 1603 b'merge',
1598 1604 b'preferancestor',
1599 1605 default=lambda: [b'*'],
1600 1606 experimental=True,
1601 1607 )
1602 1608 coreconfigitem(
1603 1609 b'merge',
1604 1610 b'strict-capability-check',
1605 1611 default=False,
1606 1612 )
1607 1613 coreconfigitem(
1608 1614 b'merge',
1609 1615 b'disable-partial-tools',
1610 1616 default=False,
1611 1617 experimental=True,
1612 1618 )
1613 1619 coreconfigitem(
1614 1620 b'partial-merge-tools',
1615 1621 b'.*',
1616 1622 default=None,
1617 1623 generic=True,
1618 1624 experimental=True,
1619 1625 )
1620 1626 coreconfigitem(
1621 1627 b'partial-merge-tools',
1622 1628 br'.*\.patterns',
1623 1629 default=dynamicdefault,
1624 1630 generic=True,
1625 1631 priority=-1,
1626 1632 experimental=True,
1627 1633 )
1628 1634 coreconfigitem(
1629 1635 b'partial-merge-tools',
1630 1636 br'.*\.executable$',
1631 1637 default=dynamicdefault,
1632 1638 generic=True,
1633 1639 priority=-1,
1634 1640 experimental=True,
1635 1641 )
1636 1642 coreconfigitem(
1637 1643 b'partial-merge-tools',
1638 1644 br'.*\.order',
1639 1645 default=0,
1640 1646 generic=True,
1641 1647 priority=-1,
1642 1648 experimental=True,
1643 1649 )
1644 1650 coreconfigitem(
1645 1651 b'partial-merge-tools',
1646 1652 br'.*\.args',
1647 1653 default=b"$local $base $other",
1648 1654 generic=True,
1649 1655 priority=-1,
1650 1656 experimental=True,
1651 1657 )
1652 1658 coreconfigitem(
1653 1659 b'partial-merge-tools',
1654 1660 br'.*\.disable',
1655 1661 default=False,
1656 1662 generic=True,
1657 1663 priority=-1,
1658 1664 experimental=True,
1659 1665 )
1660 1666 coreconfigitem(
1661 1667 b'merge-tools',
1662 1668 b'.*',
1663 1669 default=None,
1664 1670 generic=True,
1665 1671 )
1666 1672 coreconfigitem(
1667 1673 b'merge-tools',
1668 1674 br'.*\.args$',
1669 1675 default=b"$local $base $other",
1670 1676 generic=True,
1671 1677 priority=-1,
1672 1678 )
1673 1679 coreconfigitem(
1674 1680 b'merge-tools',
1675 1681 br'.*\.binary$',
1676 1682 default=False,
1677 1683 generic=True,
1678 1684 priority=-1,
1679 1685 )
1680 1686 coreconfigitem(
1681 1687 b'merge-tools',
1682 1688 br'.*\.check$',
1683 1689 default=list,
1684 1690 generic=True,
1685 1691 priority=-1,
1686 1692 )
1687 1693 coreconfigitem(
1688 1694 b'merge-tools',
1689 1695 br'.*\.checkchanged$',
1690 1696 default=False,
1691 1697 generic=True,
1692 1698 priority=-1,
1693 1699 )
1694 1700 coreconfigitem(
1695 1701 b'merge-tools',
1696 1702 br'.*\.executable$',
1697 1703 default=dynamicdefault,
1698 1704 generic=True,
1699 1705 priority=-1,
1700 1706 )
1701 1707 coreconfigitem(
1702 1708 b'merge-tools',
1703 1709 br'.*\.fixeol$',
1704 1710 default=False,
1705 1711 generic=True,
1706 1712 priority=-1,
1707 1713 )
1708 1714 coreconfigitem(
1709 1715 b'merge-tools',
1710 1716 br'.*\.gui$',
1711 1717 default=False,
1712 1718 generic=True,
1713 1719 priority=-1,
1714 1720 )
1715 1721 coreconfigitem(
1716 1722 b'merge-tools',
1717 1723 br'.*\.mergemarkers$',
1718 1724 default=b'basic',
1719 1725 generic=True,
1720 1726 priority=-1,
1721 1727 )
1722 1728 coreconfigitem(
1723 1729 b'merge-tools',
1724 1730 br'.*\.mergemarkertemplate$',
1725 1731 default=dynamicdefault, # take from command-templates.mergemarker
1726 1732 generic=True,
1727 1733 priority=-1,
1728 1734 )
1729 1735 coreconfigitem(
1730 1736 b'merge-tools',
1731 1737 br'.*\.priority$',
1732 1738 default=0,
1733 1739 generic=True,
1734 1740 priority=-1,
1735 1741 )
1736 1742 coreconfigitem(
1737 1743 b'merge-tools',
1738 1744 br'.*\.premerge$',
1739 1745 default=dynamicdefault,
1740 1746 generic=True,
1741 1747 priority=-1,
1742 1748 )
1743 1749 coreconfigitem(
1744 1750 b'merge-tools',
1745 1751 br'.*\.symlink$',
1746 1752 default=False,
1747 1753 generic=True,
1748 1754 priority=-1,
1749 1755 )
1750 1756 coreconfigitem(
1751 1757 b'pager',
1752 1758 b'attend-.*',
1753 1759 default=dynamicdefault,
1754 1760 generic=True,
1755 1761 )
1756 1762 coreconfigitem(
1757 1763 b'pager',
1758 1764 b'ignore',
1759 1765 default=list,
1760 1766 )
1761 1767 coreconfigitem(
1762 1768 b'pager',
1763 1769 b'pager',
1764 1770 default=dynamicdefault,
1765 1771 )
1766 1772 coreconfigitem(
1767 1773 b'patch',
1768 1774 b'eol',
1769 1775 default=b'strict',
1770 1776 )
1771 1777 coreconfigitem(
1772 1778 b'patch',
1773 1779 b'fuzz',
1774 1780 default=2,
1775 1781 )
1776 1782 coreconfigitem(
1777 1783 b'paths',
1778 1784 b'default',
1779 1785 default=None,
1780 1786 )
1781 1787 coreconfigitem(
1782 1788 b'paths',
1783 1789 b'default-push',
1784 1790 default=None,
1785 1791 )
1786 1792 coreconfigitem(
1787 1793 b'paths',
1788 1794 b'.*',
1789 1795 default=None,
1790 1796 generic=True,
1791 1797 )
1792 1798 coreconfigitem(
1793 1799 b'paths',
1794 1800 b'.*:bookmarks.mode',
1795 1801 default='default',
1796 1802 generic=True,
1797 1803 )
1798 1804 coreconfigitem(
1799 1805 b'paths',
1800 1806 b'.*:multi-urls',
1801 1807 default=False,
1802 1808 generic=True,
1803 1809 )
1804 1810 coreconfigitem(
1805 1811 b'paths',
1806 1812 b'.*:pushrev',
1807 1813 default=None,
1808 1814 generic=True,
1809 1815 )
1810 1816 coreconfigitem(
1811 1817 b'paths',
1812 1818 b'.*:pushurl',
1813 1819 default=None,
1814 1820 generic=True,
1815 1821 )
1816 1822 coreconfigitem(
1817 1823 b'phases',
1818 1824 b'checksubrepos',
1819 1825 default=b'follow',
1820 1826 )
1821 1827 coreconfigitem(
1822 1828 b'phases',
1823 1829 b'new-commit',
1824 1830 default=b'draft',
1825 1831 )
1826 1832 coreconfigitem(
1827 1833 b'phases',
1828 1834 b'publish',
1829 1835 default=True,
1830 1836 )
1831 1837 coreconfigitem(
1832 1838 b'profiling',
1833 1839 b'enabled',
1834 1840 default=False,
1835 1841 )
1836 1842 coreconfigitem(
1837 1843 b'profiling',
1838 1844 b'format',
1839 1845 default=b'text',
1840 1846 )
1841 1847 coreconfigitem(
1842 1848 b'profiling',
1843 1849 b'freq',
1844 1850 default=1000,
1845 1851 )
1846 1852 coreconfigitem(
1847 1853 b'profiling',
1848 1854 b'limit',
1849 1855 default=30,
1850 1856 )
1851 1857 coreconfigitem(
1852 1858 b'profiling',
1853 1859 b'nested',
1854 1860 default=0,
1855 1861 )
1856 1862 coreconfigitem(
1857 1863 b'profiling',
1858 1864 b'output',
1859 1865 default=None,
1860 1866 )
1861 1867 coreconfigitem(
1862 1868 b'profiling',
1863 1869 b'showmax',
1864 1870 default=0.999,
1865 1871 )
1866 1872 coreconfigitem(
1867 1873 b'profiling',
1868 1874 b'showmin',
1869 1875 default=dynamicdefault,
1870 1876 )
1871 1877 coreconfigitem(
1872 1878 b'profiling',
1873 1879 b'showtime',
1874 1880 default=True,
1875 1881 )
1876 1882 coreconfigitem(
1877 1883 b'profiling',
1878 1884 b'sort',
1879 1885 default=b'inlinetime',
1880 1886 )
1881 1887 coreconfigitem(
1882 1888 b'profiling',
1883 1889 b'statformat',
1884 1890 default=b'hotpath',
1885 1891 )
1886 1892 coreconfigitem(
1887 1893 b'profiling',
1888 1894 b'time-track',
1889 1895 default=dynamicdefault,
1890 1896 )
1891 1897 coreconfigitem(
1892 1898 b'profiling',
1893 1899 b'type',
1894 1900 default=b'stat',
1895 1901 )
1896 1902 coreconfigitem(
1897 1903 b'progress',
1898 1904 b'assume-tty',
1899 1905 default=False,
1900 1906 )
1901 1907 coreconfigitem(
1902 1908 b'progress',
1903 1909 b'changedelay',
1904 1910 default=1,
1905 1911 )
1906 1912 coreconfigitem(
1907 1913 b'progress',
1908 1914 b'clear-complete',
1909 1915 default=True,
1910 1916 )
1911 1917 coreconfigitem(
1912 1918 b'progress',
1913 1919 b'debug',
1914 1920 default=False,
1915 1921 )
1916 1922 coreconfigitem(
1917 1923 b'progress',
1918 1924 b'delay',
1919 1925 default=3,
1920 1926 )
1921 1927 coreconfigitem(
1922 1928 b'progress',
1923 1929 b'disable',
1924 1930 default=False,
1925 1931 )
1926 1932 coreconfigitem(
1927 1933 b'progress',
1928 1934 b'estimateinterval',
1929 1935 default=60.0,
1930 1936 )
1931 1937 coreconfigitem(
1932 1938 b'progress',
1933 1939 b'format',
1934 1940 default=lambda: [b'topic', b'bar', b'number', b'estimate'],
1935 1941 )
1936 1942 coreconfigitem(
1937 1943 b'progress',
1938 1944 b'refresh',
1939 1945 default=0.1,
1940 1946 )
1941 1947 coreconfigitem(
1942 1948 b'progress',
1943 1949 b'width',
1944 1950 default=dynamicdefault,
1945 1951 )
1946 1952 coreconfigitem(
1947 1953 b'pull',
1948 1954 b'confirm',
1949 1955 default=False,
1950 1956 )
1951 1957 coreconfigitem(
1952 1958 b'push',
1953 1959 b'pushvars.server',
1954 1960 default=False,
1955 1961 )
1956 1962 coreconfigitem(
1957 1963 b'rewrite',
1958 1964 b'backup-bundle',
1959 1965 default=True,
1960 1966 alias=[(b'ui', b'history-editing-backup')],
1961 1967 )
1962 1968 coreconfigitem(
1963 1969 b'rewrite',
1964 1970 b'update-timestamp',
1965 1971 default=False,
1966 1972 )
1967 1973 coreconfigitem(
1968 1974 b'rewrite',
1969 1975 b'empty-successor',
1970 1976 default=b'skip',
1971 1977 experimental=True,
1972 1978 )
1973 1979 # experimental as long as format.use-dirstate-v2 is.
1974 1980 coreconfigitem(
1975 1981 b'storage',
1976 1982 b'dirstate-v2.slow-path',
1977 1983 default=b"abort",
1978 1984 experimental=True,
1979 1985 )
1980 1986 coreconfigitem(
1981 1987 b'storage',
1982 1988 b'new-repo-backend',
1983 1989 default=b'revlogv1',
1984 1990 experimental=True,
1985 1991 )
1986 1992 coreconfigitem(
1987 1993 b'storage',
1988 1994 b'revlog.optimize-delta-parent-choice',
1989 1995 default=True,
1990 1996 alias=[(b'format', b'aggressivemergedeltas')],
1991 1997 )
1992 1998 coreconfigitem(
1993 1999 b'storage',
1994 2000 b'revlog.issue6528.fix-incoming',
1995 2001 default=True,
1996 2002 )
1997 2003 # experimental as long as rust is experimental (or a C version is implemented)
1998 2004 coreconfigitem(
1999 2005 b'storage',
2000 2006 b'revlog.persistent-nodemap.mmap',
2001 2007 default=True,
2002 2008 )
2003 2009 # experimental as long as format.use-persistent-nodemap is.
2004 2010 coreconfigitem(
2005 2011 b'storage',
2006 2012 b'revlog.persistent-nodemap.slow-path',
2007 2013 default=b"abort",
2008 2014 )
2009 2015
2010 2016 coreconfigitem(
2011 2017 b'storage',
2012 2018 b'revlog.reuse-external-delta',
2013 2019 default=True,
2014 2020 )
2015 2021 coreconfigitem(
2016 2022 b'storage',
2017 2023 b'revlog.reuse-external-delta-parent',
2018 2024 default=None,
2019 2025 )
2020 2026 coreconfigitem(
2021 2027 b'storage',
2022 2028 b'revlog.zlib.level',
2023 2029 default=None,
2024 2030 )
2025 2031 coreconfigitem(
2026 2032 b'storage',
2027 2033 b'revlog.zstd.level',
2028 2034 default=None,
2029 2035 )
2030 2036 coreconfigitem(
2031 2037 b'server',
2032 2038 b'bookmarks-pushkey-compat',
2033 2039 default=True,
2034 2040 )
2035 2041 coreconfigitem(
2036 2042 b'server',
2037 2043 b'bundle1',
2038 2044 default=True,
2039 2045 )
2040 2046 coreconfigitem(
2041 2047 b'server',
2042 2048 b'bundle1gd',
2043 2049 default=None,
2044 2050 )
2045 2051 coreconfigitem(
2046 2052 b'server',
2047 2053 b'bundle1.pull',
2048 2054 default=None,
2049 2055 )
2050 2056 coreconfigitem(
2051 2057 b'server',
2052 2058 b'bundle1gd.pull',
2053 2059 default=None,
2054 2060 )
2055 2061 coreconfigitem(
2056 2062 b'server',
2057 2063 b'bundle1.push',
2058 2064 default=None,
2059 2065 )
2060 2066 coreconfigitem(
2061 2067 b'server',
2062 2068 b'bundle1gd.push',
2063 2069 default=None,
2064 2070 )
2065 2071 coreconfigitem(
2066 2072 b'server',
2067 2073 b'bundle2.stream',
2068 2074 default=True,
2069 2075 alias=[(b'experimental', b'bundle2.stream')],
2070 2076 )
2071 2077 coreconfigitem(
2072 2078 b'server',
2073 2079 b'compressionengines',
2074 2080 default=list,
2075 2081 )
2076 2082 coreconfigitem(
2077 2083 b'server',
2078 2084 b'concurrent-push-mode',
2079 2085 default=b'check-related',
2080 2086 )
2081 2087 coreconfigitem(
2082 2088 b'server',
2083 2089 b'disablefullbundle',
2084 2090 default=False,
2085 2091 )
2086 2092 coreconfigitem(
2087 2093 b'server',
2088 2094 b'maxhttpheaderlen',
2089 2095 default=1024,
2090 2096 )
2091 2097 coreconfigitem(
2092 2098 b'server',
2093 2099 b'pullbundle',
2094 2100 default=False,
2095 2101 )
2096 2102 coreconfigitem(
2097 2103 b'server',
2098 2104 b'preferuncompressed',
2099 2105 default=False,
2100 2106 )
2101 2107 coreconfigitem(
2102 2108 b'server',
2103 2109 b'streamunbundle',
2104 2110 default=False,
2105 2111 )
2106 2112 coreconfigitem(
2107 2113 b'server',
2108 2114 b'uncompressed',
2109 2115 default=True,
2110 2116 )
2111 2117 coreconfigitem(
2112 2118 b'server',
2113 2119 b'uncompressedallowsecret',
2114 2120 default=False,
2115 2121 )
2116 2122 coreconfigitem(
2117 2123 b'server',
2118 2124 b'view',
2119 2125 default=b'served',
2120 2126 )
2121 2127 coreconfigitem(
2122 2128 b'server',
2123 2129 b'validate',
2124 2130 default=False,
2125 2131 )
2126 2132 coreconfigitem(
2127 2133 b'server',
2128 2134 b'zliblevel',
2129 2135 default=-1,
2130 2136 )
2131 2137 coreconfigitem(
2132 2138 b'server',
2133 2139 b'zstdlevel',
2134 2140 default=3,
2135 2141 )
2136 2142 coreconfigitem(
2137 2143 b'share',
2138 2144 b'pool',
2139 2145 default=None,
2140 2146 )
2141 2147 coreconfigitem(
2142 2148 b'share',
2143 2149 b'poolnaming',
2144 2150 default=b'identity',
2145 2151 )
2146 2152 coreconfigitem(
2147 2153 b'share',
2148 2154 b'safe-mismatch.source-not-safe',
2149 2155 default=b'abort',
2150 2156 )
2151 2157 coreconfigitem(
2152 2158 b'share',
2153 2159 b'safe-mismatch.source-safe',
2154 2160 default=b'abort',
2155 2161 )
2156 2162 coreconfigitem(
2157 2163 b'share',
2158 2164 b'safe-mismatch.source-not-safe.warn',
2159 2165 default=True,
2160 2166 )
2161 2167 coreconfigitem(
2162 2168 b'share',
2163 2169 b'safe-mismatch.source-safe.warn',
2164 2170 default=True,
2165 2171 )
2166 2172 coreconfigitem(
2167 2173 b'shelve',
2168 2174 b'maxbackups',
2169 2175 default=10,
2170 2176 )
2171 2177 coreconfigitem(
2172 2178 b'smtp',
2173 2179 b'host',
2174 2180 default=None,
2175 2181 )
2176 2182 coreconfigitem(
2177 2183 b'smtp',
2178 2184 b'local_hostname',
2179 2185 default=None,
2180 2186 )
2181 2187 coreconfigitem(
2182 2188 b'smtp',
2183 2189 b'password',
2184 2190 default=None,
2185 2191 )
2186 2192 coreconfigitem(
2187 2193 b'smtp',
2188 2194 b'port',
2189 2195 default=dynamicdefault,
2190 2196 )
2191 2197 coreconfigitem(
2192 2198 b'smtp',
2193 2199 b'tls',
2194 2200 default=b'none',
2195 2201 )
2196 2202 coreconfigitem(
2197 2203 b'smtp',
2198 2204 b'username',
2199 2205 default=None,
2200 2206 )
2201 2207 coreconfigitem(
2202 2208 b'sparse',
2203 2209 b'missingwarning',
2204 2210 default=True,
2205 2211 experimental=True,
2206 2212 )
2207 2213 coreconfigitem(
2208 2214 b'subrepos',
2209 2215 b'allowed',
2210 2216 default=dynamicdefault, # to make backporting simpler
2211 2217 )
2212 2218 coreconfigitem(
2213 2219 b'subrepos',
2214 2220 b'hg:allowed',
2215 2221 default=dynamicdefault,
2216 2222 )
2217 2223 coreconfigitem(
2218 2224 b'subrepos',
2219 2225 b'git:allowed',
2220 2226 default=dynamicdefault,
2221 2227 )
2222 2228 coreconfigitem(
2223 2229 b'subrepos',
2224 2230 b'svn:allowed',
2225 2231 default=dynamicdefault,
2226 2232 )
2227 2233 coreconfigitem(
2228 2234 b'templates',
2229 2235 b'.*',
2230 2236 default=None,
2231 2237 generic=True,
2232 2238 )
2233 2239 coreconfigitem(
2234 2240 b'templateconfig',
2235 2241 b'.*',
2236 2242 default=dynamicdefault,
2237 2243 generic=True,
2238 2244 )
2239 2245 coreconfigitem(
2240 2246 b'trusted',
2241 2247 b'groups',
2242 2248 default=list,
2243 2249 )
2244 2250 coreconfigitem(
2245 2251 b'trusted',
2246 2252 b'users',
2247 2253 default=list,
2248 2254 )
2249 2255 coreconfigitem(
2250 2256 b'ui',
2251 2257 b'_usedassubrepo',
2252 2258 default=False,
2253 2259 )
2254 2260 coreconfigitem(
2255 2261 b'ui',
2256 2262 b'allowemptycommit',
2257 2263 default=False,
2258 2264 )
2259 2265 coreconfigitem(
2260 2266 b'ui',
2261 2267 b'archivemeta',
2262 2268 default=True,
2263 2269 )
2264 2270 coreconfigitem(
2265 2271 b'ui',
2266 2272 b'askusername',
2267 2273 default=False,
2268 2274 )
2269 2275 coreconfigitem(
2270 2276 b'ui',
2271 2277 b'available-memory',
2272 2278 default=None,
2273 2279 )
2274 2280
2275 2281 coreconfigitem(
2276 2282 b'ui',
2277 2283 b'clonebundlefallback',
2278 2284 default=False,
2279 2285 )
2280 2286 coreconfigitem(
2281 2287 b'ui',
2282 2288 b'clonebundleprefers',
2283 2289 default=list,
2284 2290 )
2285 2291 coreconfigitem(
2286 2292 b'ui',
2287 2293 b'clonebundles',
2288 2294 default=True,
2289 2295 )
2290 2296 coreconfigitem(
2291 2297 b'ui',
2292 2298 b'color',
2293 2299 default=b'auto',
2294 2300 )
2295 2301 coreconfigitem(
2296 2302 b'ui',
2297 2303 b'commitsubrepos',
2298 2304 default=False,
2299 2305 )
2300 2306 coreconfigitem(
2301 2307 b'ui',
2302 2308 b'debug',
2303 2309 default=False,
2304 2310 )
2305 2311 coreconfigitem(
2306 2312 b'ui',
2307 2313 b'debugger',
2308 2314 default=None,
2309 2315 )
2310 2316 coreconfigitem(
2311 2317 b'ui',
2312 2318 b'editor',
2313 2319 default=dynamicdefault,
2314 2320 )
2315 2321 coreconfigitem(
2316 2322 b'ui',
2317 2323 b'detailed-exit-code',
2318 2324 default=False,
2319 2325 experimental=True,
2320 2326 )
2321 2327 coreconfigitem(
2322 2328 b'ui',
2323 2329 b'fallbackencoding',
2324 2330 default=None,
2325 2331 )
2326 2332 coreconfigitem(
2327 2333 b'ui',
2328 2334 b'forcecwd',
2329 2335 default=None,
2330 2336 )
2331 2337 coreconfigitem(
2332 2338 b'ui',
2333 2339 b'forcemerge',
2334 2340 default=None,
2335 2341 )
2336 2342 coreconfigitem(
2337 2343 b'ui',
2338 2344 b'formatdebug',
2339 2345 default=False,
2340 2346 )
2341 2347 coreconfigitem(
2342 2348 b'ui',
2343 2349 b'formatjson',
2344 2350 default=False,
2345 2351 )
2346 2352 coreconfigitem(
2347 2353 b'ui',
2348 2354 b'formatted',
2349 2355 default=None,
2350 2356 )
2351 2357 coreconfigitem(
2352 2358 b'ui',
2353 2359 b'interactive',
2354 2360 default=None,
2355 2361 )
2356 2362 coreconfigitem(
2357 2363 b'ui',
2358 2364 b'interface',
2359 2365 default=None,
2360 2366 )
2361 2367 coreconfigitem(
2362 2368 b'ui',
2363 2369 b'interface.chunkselector',
2364 2370 default=None,
2365 2371 )
2366 2372 coreconfigitem(
2367 2373 b'ui',
2368 2374 b'large-file-limit',
2369 2375 default=10 * (2 ** 20),
2370 2376 )
2371 2377 coreconfigitem(
2372 2378 b'ui',
2373 2379 b'logblockedtimes',
2374 2380 default=False,
2375 2381 )
2376 2382 coreconfigitem(
2377 2383 b'ui',
2378 2384 b'merge',
2379 2385 default=None,
2380 2386 )
2381 2387 coreconfigitem(
2382 2388 b'ui',
2383 2389 b'mergemarkers',
2384 2390 default=b'basic',
2385 2391 )
2386 2392 coreconfigitem(
2387 2393 b'ui',
2388 2394 b'message-output',
2389 2395 default=b'stdio',
2390 2396 )
2391 2397 coreconfigitem(
2392 2398 b'ui',
2393 2399 b'nontty',
2394 2400 default=False,
2395 2401 )
2396 2402 coreconfigitem(
2397 2403 b'ui',
2398 2404 b'origbackuppath',
2399 2405 default=None,
2400 2406 )
2401 2407 coreconfigitem(
2402 2408 b'ui',
2403 2409 b'paginate',
2404 2410 default=True,
2405 2411 )
2406 2412 coreconfigitem(
2407 2413 b'ui',
2408 2414 b'patch',
2409 2415 default=None,
2410 2416 )
2411 2417 coreconfigitem(
2412 2418 b'ui',
2413 2419 b'portablefilenames',
2414 2420 default=b'warn',
2415 2421 )
2416 2422 coreconfigitem(
2417 2423 b'ui',
2418 2424 b'promptecho',
2419 2425 default=False,
2420 2426 )
2421 2427 coreconfigitem(
2422 2428 b'ui',
2423 2429 b'quiet',
2424 2430 default=False,
2425 2431 )
2426 2432 coreconfigitem(
2427 2433 b'ui',
2428 2434 b'quietbookmarkmove',
2429 2435 default=False,
2430 2436 )
2431 2437 coreconfigitem(
2432 2438 b'ui',
2433 2439 b'relative-paths',
2434 2440 default=b'legacy',
2435 2441 )
2436 2442 coreconfigitem(
2437 2443 b'ui',
2438 2444 b'remotecmd',
2439 2445 default=b'hg',
2440 2446 )
2441 2447 coreconfigitem(
2442 2448 b'ui',
2443 2449 b'report_untrusted',
2444 2450 default=True,
2445 2451 )
2446 2452 coreconfigitem(
2447 2453 b'ui',
2448 2454 b'rollback',
2449 2455 default=True,
2450 2456 )
2451 2457 coreconfigitem(
2452 2458 b'ui',
2453 2459 b'signal-safe-lock',
2454 2460 default=True,
2455 2461 )
2456 2462 coreconfigitem(
2457 2463 b'ui',
2458 2464 b'slash',
2459 2465 default=False,
2460 2466 )
2461 2467 coreconfigitem(
2462 2468 b'ui',
2463 2469 b'ssh',
2464 2470 default=b'ssh',
2465 2471 )
2466 2472 coreconfigitem(
2467 2473 b'ui',
2468 2474 b'ssherrorhint',
2469 2475 default=None,
2470 2476 )
2471 2477 coreconfigitem(
2472 2478 b'ui',
2473 2479 b'statuscopies',
2474 2480 default=False,
2475 2481 )
2476 2482 coreconfigitem(
2477 2483 b'ui',
2478 2484 b'strict',
2479 2485 default=False,
2480 2486 )
2481 2487 coreconfigitem(
2482 2488 b'ui',
2483 2489 b'style',
2484 2490 default=b'',
2485 2491 )
2486 2492 coreconfigitem(
2487 2493 b'ui',
2488 2494 b'supportcontact',
2489 2495 default=None,
2490 2496 )
2491 2497 coreconfigitem(
2492 2498 b'ui',
2493 2499 b'textwidth',
2494 2500 default=78,
2495 2501 )
2496 2502 coreconfigitem(
2497 2503 b'ui',
2498 2504 b'timeout',
2499 2505 default=b'600',
2500 2506 )
2501 2507 coreconfigitem(
2502 2508 b'ui',
2503 2509 b'timeout.warn',
2504 2510 default=0,
2505 2511 )
2506 2512 coreconfigitem(
2507 2513 b'ui',
2508 2514 b'timestamp-output',
2509 2515 default=False,
2510 2516 )
2511 2517 coreconfigitem(
2512 2518 b'ui',
2513 2519 b'traceback',
2514 2520 default=False,
2515 2521 )
2516 2522 coreconfigitem(
2517 2523 b'ui',
2518 2524 b'tweakdefaults',
2519 2525 default=False,
2520 2526 )
2521 2527 coreconfigitem(b'ui', b'username', alias=[(b'ui', b'user')])
2522 2528 coreconfigitem(
2523 2529 b'ui',
2524 2530 b'verbose',
2525 2531 default=False,
2526 2532 )
2527 2533 coreconfigitem(
2528 2534 b'verify',
2529 2535 b'skipflags',
2530 2536 default=None,
2531 2537 )
2532 2538 coreconfigitem(
2533 2539 b'web',
2534 2540 b'allowbz2',
2535 2541 default=False,
2536 2542 )
2537 2543 coreconfigitem(
2538 2544 b'web',
2539 2545 b'allowgz',
2540 2546 default=False,
2541 2547 )
2542 2548 coreconfigitem(
2543 2549 b'web',
2544 2550 b'allow-pull',
2545 2551 alias=[(b'web', b'allowpull')],
2546 2552 default=True,
2547 2553 )
2548 2554 coreconfigitem(
2549 2555 b'web',
2550 2556 b'allow-push',
2551 2557 alias=[(b'web', b'allow_push')],
2552 2558 default=list,
2553 2559 )
2554 2560 coreconfigitem(
2555 2561 b'web',
2556 2562 b'allowzip',
2557 2563 default=False,
2558 2564 )
2559 2565 coreconfigitem(
2560 2566 b'web',
2561 2567 b'archivesubrepos',
2562 2568 default=False,
2563 2569 )
2564 2570 coreconfigitem(
2565 2571 b'web',
2566 2572 b'cache',
2567 2573 default=True,
2568 2574 )
2569 2575 coreconfigitem(
2570 2576 b'web',
2571 2577 b'comparisoncontext',
2572 2578 default=5,
2573 2579 )
2574 2580 coreconfigitem(
2575 2581 b'web',
2576 2582 b'contact',
2577 2583 default=None,
2578 2584 )
2579 2585 coreconfigitem(
2580 2586 b'web',
2581 2587 b'deny_push',
2582 2588 default=list,
2583 2589 )
2584 2590 coreconfigitem(
2585 2591 b'web',
2586 2592 b'guessmime',
2587 2593 default=False,
2588 2594 )
2589 2595 coreconfigitem(
2590 2596 b'web',
2591 2597 b'hidden',
2592 2598 default=False,
2593 2599 )
2594 2600 coreconfigitem(
2595 2601 b'web',
2596 2602 b'labels',
2597 2603 default=list,
2598 2604 )
2599 2605 coreconfigitem(
2600 2606 b'web',
2601 2607 b'logoimg',
2602 2608 default=b'hglogo.png',
2603 2609 )
2604 2610 coreconfigitem(
2605 2611 b'web',
2606 2612 b'logourl',
2607 2613 default=b'https://mercurial-scm.org/',
2608 2614 )
2609 2615 coreconfigitem(
2610 2616 b'web',
2611 2617 b'accesslog',
2612 2618 default=b'-',
2613 2619 )
2614 2620 coreconfigitem(
2615 2621 b'web',
2616 2622 b'address',
2617 2623 default=b'',
2618 2624 )
2619 2625 coreconfigitem(
2620 2626 b'web',
2621 2627 b'allow-archive',
2622 2628 alias=[(b'web', b'allow_archive')],
2623 2629 default=list,
2624 2630 )
2625 2631 coreconfigitem(
2626 2632 b'web',
2627 2633 b'allow_read',
2628 2634 default=list,
2629 2635 )
2630 2636 coreconfigitem(
2631 2637 b'web',
2632 2638 b'baseurl',
2633 2639 default=None,
2634 2640 )
2635 2641 coreconfigitem(
2636 2642 b'web',
2637 2643 b'cacerts',
2638 2644 default=None,
2639 2645 )
2640 2646 coreconfigitem(
2641 2647 b'web',
2642 2648 b'certificate',
2643 2649 default=None,
2644 2650 )
2645 2651 coreconfigitem(
2646 2652 b'web',
2647 2653 b'collapse',
2648 2654 default=False,
2649 2655 )
2650 2656 coreconfigitem(
2651 2657 b'web',
2652 2658 b'csp',
2653 2659 default=None,
2654 2660 )
2655 2661 coreconfigitem(
2656 2662 b'web',
2657 2663 b'deny_read',
2658 2664 default=list,
2659 2665 )
2660 2666 coreconfigitem(
2661 2667 b'web',
2662 2668 b'descend',
2663 2669 default=True,
2664 2670 )
2665 2671 coreconfigitem(
2666 2672 b'web',
2667 2673 b'description',
2668 2674 default=b"",
2669 2675 )
2670 2676 coreconfigitem(
2671 2677 b'web',
2672 2678 b'encoding',
2673 2679 default=lambda: encoding.encoding,
2674 2680 )
2675 2681 coreconfigitem(
2676 2682 b'web',
2677 2683 b'errorlog',
2678 2684 default=b'-',
2679 2685 )
2680 2686 coreconfigitem(
2681 2687 b'web',
2682 2688 b'ipv6',
2683 2689 default=False,
2684 2690 )
2685 2691 coreconfigitem(
2686 2692 b'web',
2687 2693 b'maxchanges',
2688 2694 default=10,
2689 2695 )
2690 2696 coreconfigitem(
2691 2697 b'web',
2692 2698 b'maxfiles',
2693 2699 default=10,
2694 2700 )
2695 2701 coreconfigitem(
2696 2702 b'web',
2697 2703 b'maxshortchanges',
2698 2704 default=60,
2699 2705 )
2700 2706 coreconfigitem(
2701 2707 b'web',
2702 2708 b'motd',
2703 2709 default=b'',
2704 2710 )
2705 2711 coreconfigitem(
2706 2712 b'web',
2707 2713 b'name',
2708 2714 default=dynamicdefault,
2709 2715 )
2710 2716 coreconfigitem(
2711 2717 b'web',
2712 2718 b'port',
2713 2719 default=8000,
2714 2720 )
2715 2721 coreconfigitem(
2716 2722 b'web',
2717 2723 b'prefix',
2718 2724 default=b'',
2719 2725 )
2720 2726 coreconfigitem(
2721 2727 b'web',
2722 2728 b'push_ssl',
2723 2729 default=True,
2724 2730 )
2725 2731 coreconfigitem(
2726 2732 b'web',
2727 2733 b'refreshinterval',
2728 2734 default=20,
2729 2735 )
2730 2736 coreconfigitem(
2731 2737 b'web',
2732 2738 b'server-header',
2733 2739 default=None,
2734 2740 )
2735 2741 coreconfigitem(
2736 2742 b'web',
2737 2743 b'static',
2738 2744 default=None,
2739 2745 )
2740 2746 coreconfigitem(
2741 2747 b'web',
2742 2748 b'staticurl',
2743 2749 default=None,
2744 2750 )
2745 2751 coreconfigitem(
2746 2752 b'web',
2747 2753 b'stripes',
2748 2754 default=1,
2749 2755 )
2750 2756 coreconfigitem(
2751 2757 b'web',
2752 2758 b'style',
2753 2759 default=b'paper',
2754 2760 )
2755 2761 coreconfigitem(
2756 2762 b'web',
2757 2763 b'templates',
2758 2764 default=None,
2759 2765 )
2760 2766 coreconfigitem(
2761 2767 b'web',
2762 2768 b'view',
2763 2769 default=b'served',
2764 2770 experimental=True,
2765 2771 )
2766 2772 coreconfigitem(
2767 2773 b'worker',
2768 2774 b'backgroundclose',
2769 2775 default=dynamicdefault,
2770 2776 )
2771 2777 # Windows defaults to a limit of 512 open files. A buffer of 128
2772 2778 # should give us enough headway.
2773 2779 coreconfigitem(
2774 2780 b'worker',
2775 2781 b'backgroundclosemaxqueue',
2776 2782 default=384,
2777 2783 )
2778 2784 coreconfigitem(
2779 2785 b'worker',
2780 2786 b'backgroundcloseminfilecount',
2781 2787 default=2048,
2782 2788 )
2783 2789 coreconfigitem(
2784 2790 b'worker',
2785 2791 b'backgroundclosethreadcount',
2786 2792 default=4,
2787 2793 )
2788 2794 coreconfigitem(
2789 2795 b'worker',
2790 2796 b'enabled',
2791 2797 default=True,
2792 2798 )
2793 2799 coreconfigitem(
2794 2800 b'worker',
2795 2801 b'numcpus',
2796 2802 default=None,
2797 2803 )
2798 2804
2799 2805 # Rebase related configuration moved to core because other extension are doing
2800 2806 # strange things. For example, shelve import the extensions to reuse some bit
2801 2807 # without formally loading it.
2802 2808 coreconfigitem(
2803 2809 b'commands',
2804 2810 b'rebase.requiredest',
2805 2811 default=False,
2806 2812 )
2807 2813 coreconfigitem(
2808 2814 b'experimental',
2809 2815 b'rebaseskipobsolete',
2810 2816 default=True,
2811 2817 )
2812 2818 coreconfigitem(
2813 2819 b'rebase',
2814 2820 b'singletransaction',
2815 2821 default=False,
2816 2822 )
2817 2823 coreconfigitem(
2818 2824 b'rebase',
2819 2825 b'experimental.inmemory',
2820 2826 default=False,
2821 2827 )
@@ -1,3277 +1,3281
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 ``cmdserver``
422 422 -------------
423 423
424 424 Controls command server settings. (ADVANCED)
425 425
426 426 ``message-encodings``
427 427 List of encodings for the ``m`` (message) channel. The first encoding
428 428 supported by the server will be selected and advertised in the hello
429 429 message. This is useful only when ``ui.message-output`` is set to
430 430 ``channel``. Supported encodings are ``cbor``.
431 431
432 432 ``shutdown-on-interrupt``
433 433 If set to false, the server's main loop will continue running after
434 434 SIGINT received. ``runcommand`` requests can still be interrupted by
435 435 SIGINT. Close the write end of the pipe to shut down the server
436 436 process gracefully.
437 437 (default: True)
438 438
439 439 ``color``
440 440 ---------
441 441
442 442 Configure the Mercurial color mode. For details about how to define your custom
443 443 effect and style see :hg:`help color`.
444 444
445 445 ``mode``
446 446 String: control the method used to output color. One of ``auto``, ``ansi``,
447 447 ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
448 448 use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a
449 449 terminal. Any invalid value will disable color.
450 450
451 451 ``pagermode``
452 452 String: optional override of ``color.mode`` used with pager.
453 453
454 454 On some systems, terminfo mode may cause problems when using
455 455 color with ``less -R`` as a pager program. less with the -R option
456 456 will only display ECMA-48 color codes, and terminfo mode may sometimes
457 457 emit codes that less doesn't understand. You can work around this by
458 458 either using ansi mode (or auto mode), or by using less -r (which will
459 459 pass through all terminal control codes, not just color control
460 460 codes).
461 461
462 462 On some systems (such as MSYS in Windows), the terminal may support
463 463 a different color mode than the pager program.
464 464
465 465 ``commands``
466 466 ------------
467 467
468 468 ``commit.post-status``
469 469 Show status of files in the working directory after successful commit.
470 470 (default: False)
471 471
472 472 ``merge.require-rev``
473 473 Require that the revision to merge the current commit with be specified on
474 474 the command line. If this is enabled and a revision is not specified, the
475 475 command aborts.
476 476 (default: False)
477 477
478 478 ``push.require-revs``
479 479 Require revisions to push be specified using one or more mechanisms such as
480 480 specifying them positionally on the command line, using ``-r``, ``-b``,
481 481 and/or ``-B`` on the command line, or using ``paths.<path>:pushrev`` in the
482 482 configuration. If this is enabled and revisions are not specified, the
483 483 command aborts.
484 484 (default: False)
485 485
486 486 ``resolve.confirm``
487 487 Confirm before performing action if no filename is passed.
488 488 (default: False)
489 489
490 490 ``resolve.explicit-re-merge``
491 491 Require uses of ``hg resolve`` to specify which action it should perform,
492 492 instead of re-merging files by default.
493 493 (default: False)
494 494
495 495 ``resolve.mark-check``
496 496 Determines what level of checking :hg:`resolve --mark` will perform before
497 497 marking files as resolved. Valid values are ``none`, ``warn``, and
498 498 ``abort``. ``warn`` will output a warning listing the file(s) that still
499 499 have conflict markers in them, but will still mark everything resolved.
500 500 ``abort`` will output the same warning but will not mark things as resolved.
501 501 If --all is passed and this is set to ``abort``, only a warning will be
502 502 shown (an error will not be raised).
503 503 (default: ``none``)
504 504
505 505 ``status.relative``
506 506 Make paths in :hg:`status` output relative to the current directory.
507 507 (default: False)
508 508
509 509 ``status.terse``
510 510 Default value for the --terse flag, which condenses status output.
511 511 (default: empty)
512 512
513 513 ``update.check``
514 514 Determines what level of checking :hg:`update` will perform before moving
515 515 to a destination revision. Valid values are ``abort``, ``none``,
516 516 ``linear``, and ``noconflict``.
517 517
518 518 - ``abort`` always fails if the working directory has uncommitted changes.
519 519
520 520 - ``none`` performs no checking, and may result in a merge with uncommitted changes.
521 521
522 522 - ``linear`` allows any update as long as it follows a straight line in the
523 523 revision history, and may trigger a merge with uncommitted changes.
524 524
525 525 - ``noconflict`` will allow any update which would not trigger a merge with
526 526 uncommitted changes, if any are present.
527 527
528 528 (default: ``linear``)
529 529
530 530 ``update.requiredest``
531 531 Require that the user pass a destination when running :hg:`update`.
532 532 For example, :hg:`update .::` will be allowed, but a plain :hg:`update`
533 533 will be disallowed.
534 534 (default: False)
535 535
536 536 ``committemplate``
537 537 ------------------
538 538
539 539 ``changeset``
540 540 String: configuration in this section is used as the template to
541 541 customize the text shown in the editor when committing.
542 542
543 543 In addition to pre-defined template keywords, commit log specific one
544 544 below can be used for customization:
545 545
546 546 ``extramsg``
547 547 String: Extra message (typically 'Leave message empty to abort
548 548 commit.'). This may be changed by some commands or extensions.
549 549
550 550 For example, the template configuration below shows as same text as
551 551 one shown by default::
552 552
553 553 [committemplate]
554 554 changeset = {desc}\n\n
555 555 HG: Enter commit message. Lines beginning with 'HG:' are removed.
556 556 HG: {extramsg}
557 557 HG: --
558 558 HG: user: {author}\n{ifeq(p2rev, "-1", "",
559 559 "HG: branch merge\n")
560 560 }HG: branch '{branch}'\n{if(activebookmark,
561 561 "HG: bookmark '{activebookmark}'\n") }{subrepos %
562 562 "HG: subrepo {subrepo}\n" }{file_adds %
563 563 "HG: added {file}\n" }{file_mods %
564 564 "HG: changed {file}\n" }{file_dels %
565 565 "HG: removed {file}\n" }{if(files, "",
566 566 "HG: no files changed\n")}
567 567
568 568 ``diff()``
569 569 String: show the diff (see :hg:`help templates` for detail)
570 570
571 571 Sometimes it is helpful to show the diff of the changeset in the editor without
572 572 having to prefix 'HG: ' to each line so that highlighting works correctly. For
573 573 this, Mercurial provides a special string which will ignore everything below
574 574 it::
575 575
576 576 HG: ------------------------ >8 ------------------------
577 577
578 578 For example, the template configuration below will show the diff below the
579 579 extra message::
580 580
581 581 [committemplate]
582 582 changeset = {desc}\n\n
583 583 HG: Enter commit message. Lines beginning with 'HG:' are removed.
584 584 HG: {extramsg}
585 585 HG: ------------------------ >8 ------------------------
586 586 HG: Do not touch the line above.
587 587 HG: Everything below will be removed.
588 588 {diff()}
589 589
590 590 .. note::
591 591
592 592 For some problematic encodings (see :hg:`help win32mbcs` for
593 593 detail), this customization should be configured carefully, to
594 594 avoid showing broken characters.
595 595
596 596 For example, if a multibyte character ending with backslash (0x5c) is
597 597 followed by the ASCII character 'n' in the customized template,
598 598 the sequence of backslash and 'n' is treated as line-feed unexpectedly
599 599 (and the multibyte character is broken, too).
600 600
601 601 Customized template is used for commands below (``--edit`` may be
602 602 required):
603 603
604 604 - :hg:`backout`
605 605 - :hg:`commit`
606 606 - :hg:`fetch` (for merge commit only)
607 607 - :hg:`graft`
608 608 - :hg:`histedit`
609 609 - :hg:`import`
610 610 - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
611 611 - :hg:`rebase`
612 612 - :hg:`shelve`
613 613 - :hg:`sign`
614 614 - :hg:`tag`
615 615 - :hg:`transplant`
616 616
617 617 Configuring items below instead of ``changeset`` allows showing
618 618 customized message only for specific actions, or showing different
619 619 messages for each action.
620 620
621 621 - ``changeset.backout`` for :hg:`backout`
622 622 - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
623 623 - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
624 624 - ``changeset.commit.normal.merge`` for :hg:`commit` on merges
625 625 - ``changeset.commit.normal.normal`` for :hg:`commit` on other
626 626 - ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
627 627 - ``changeset.gpg.sign`` for :hg:`sign`
628 628 - ``changeset.graft`` for :hg:`graft`
629 629 - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
630 630 - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
631 631 - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
632 632 - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
633 633 - ``changeset.import.bypass`` for :hg:`import --bypass`
634 634 - ``changeset.import.normal.merge`` for :hg:`import` on merges
635 635 - ``changeset.import.normal.normal`` for :hg:`import` on other
636 636 - ``changeset.mq.qnew`` for :hg:`qnew`
637 637 - ``changeset.mq.qfold`` for :hg:`qfold`
638 638 - ``changeset.mq.qrefresh`` for :hg:`qrefresh`
639 639 - ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
640 640 - ``changeset.rebase.merge`` for :hg:`rebase` on merges
641 641 - ``changeset.rebase.normal`` for :hg:`rebase` on other
642 642 - ``changeset.shelve.shelve`` for :hg:`shelve`
643 643 - ``changeset.tag.add`` for :hg:`tag` without ``--remove``
644 644 - ``changeset.tag.remove`` for :hg:`tag --remove`
645 645 - ``changeset.transplant.merge`` for :hg:`transplant` on merges
646 646 - ``changeset.transplant.normal`` for :hg:`transplant` on other
647 647
648 648 These dot-separated lists of names are treated as hierarchical ones.
649 649 For example, ``changeset.tag.remove`` customizes the commit message
650 650 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
651 651 commit message for :hg:`tag` regardless of ``--remove`` option.
652 652
653 653 When the external editor is invoked for a commit, the corresponding
654 654 dot-separated list of names without the ``changeset.`` prefix
655 655 (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment
656 656 variable.
657 657
658 658 In this section, items other than ``changeset`` can be referred from
659 659 others. For example, the configuration to list committed files up
660 660 below can be referred as ``{listupfiles}``::
661 661
662 662 [committemplate]
663 663 listupfiles = {file_adds %
664 664 "HG: added {file}\n" }{file_mods %
665 665 "HG: changed {file}\n" }{file_dels %
666 666 "HG: removed {file}\n" }{if(files, "",
667 667 "HG: no files changed\n")}
668 668
669 669 ``decode/encode``
670 670 -----------------
671 671
672 672 Filters for transforming files on checkout/checkin. This would
673 673 typically be used for newline processing or other
674 674 localization/canonicalization of files.
675 675
676 676 Filters consist of a filter pattern followed by a filter command.
677 677 Filter patterns are globs by default, rooted at the repository root.
678 678 For example, to match any file ending in ``.txt`` in the root
679 679 directory only, use the pattern ``*.txt``. To match any file ending
680 680 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
681 681 For each file only the first matching filter applies.
682 682
683 683 The filter command can start with a specifier, either ``pipe:`` or
684 684 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
685 685
686 686 A ``pipe:`` command must accept data on stdin and return the transformed
687 687 data on stdout.
688 688
689 689 Pipe example::
690 690
691 691 [encode]
692 692 # uncompress gzip files on checkin to improve delta compression
693 693 # note: not necessarily a good idea, just an example
694 694 *.gz = pipe: gunzip
695 695
696 696 [decode]
697 697 # recompress gzip files when writing them to the working dir (we
698 698 # can safely omit "pipe:", because it's the default)
699 699 *.gz = gzip
700 700
701 701 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
702 702 with the name of a temporary file that contains the data to be
703 703 filtered by the command. The string ``OUTFILE`` is replaced with the name
704 704 of an empty temporary file, where the filtered data must be written by
705 705 the command.
706 706
707 707 .. container:: windows
708 708
709 709 .. note::
710 710
711 711 The tempfile mechanism is recommended for Windows systems,
712 712 where the standard shell I/O redirection operators often have
713 713 strange effects and may corrupt the contents of your files.
714 714
715 715 This filter mechanism is used internally by the ``eol`` extension to
716 716 translate line ending characters between Windows (CRLF) and Unix (LF)
717 717 format. We suggest you use the ``eol`` extension for convenience.
718 718
719 719
720 720 ``defaults``
721 721 ------------
722 722
723 723 (defaults are deprecated. Don't use them. Use aliases instead.)
724 724
725 725 Use the ``[defaults]`` section to define command defaults, i.e. the
726 726 default options/arguments to pass to the specified commands.
727 727
728 728 The following example makes :hg:`log` run in verbose mode, and
729 729 :hg:`status` show only the modified files, by default::
730 730
731 731 [defaults]
732 732 log = -v
733 733 status = -m
734 734
735 735 The actual commands, instead of their aliases, must be used when
736 736 defining command defaults. The command defaults will also be applied
737 737 to the aliases of the commands defined.
738 738
739 739
740 740 ``diff``
741 741 --------
742 742
743 743 Settings used when displaying diffs. Everything except for ``unified``
744 744 is a Boolean and defaults to False. See :hg:`help config.annotate`
745 745 for related options for the annotate command.
746 746
747 747 ``git``
748 748 Use git extended diff format.
749 749
750 750 ``nobinary``
751 751 Omit git binary patches.
752 752
753 753 ``nodates``
754 754 Don't include dates in diff headers.
755 755
756 756 ``noprefix``
757 757 Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
758 758
759 759 ``showfunc``
760 760 Show which function each change is in.
761 761
762 762 ``ignorews``
763 763 Ignore white space when comparing lines.
764 764
765 765 ``ignorewsamount``
766 766 Ignore changes in the amount of white space.
767 767
768 768 ``ignoreblanklines``
769 769 Ignore changes whose lines are all blank.
770 770
771 771 ``unified``
772 772 Number of lines of context to show.
773 773
774 774 ``word-diff``
775 775 Highlight changed words.
776 776
777 777 ``email``
778 778 ---------
779 779
780 780 Settings for extensions that send email messages.
781 781
782 782 ``from``
783 783 Optional. Email address to use in "From" header and SMTP envelope
784 784 of outgoing messages.
785 785
786 786 ``to``
787 787 Optional. Comma-separated list of recipients' email addresses.
788 788
789 789 ``cc``
790 790 Optional. Comma-separated list of carbon copy recipients'
791 791 email addresses.
792 792
793 793 ``bcc``
794 794 Optional. Comma-separated list of blind carbon copy recipients'
795 795 email addresses.
796 796
797 797 ``method``
798 798 Optional. Method to use to send email messages. If value is ``smtp``
799 799 (default), use SMTP (see the ``[smtp]`` section for configuration).
800 800 Otherwise, use as name of program to run that acts like sendmail
801 801 (takes ``-f`` option for sender, list of recipients on command line,
802 802 message on stdin). Normally, setting this to ``sendmail`` or
803 803 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
804 804
805 805 ``charsets``
806 806 Optional. Comma-separated list of character sets considered
807 807 convenient for recipients. Addresses, headers, and parts not
808 808 containing patches of outgoing messages will be encoded in the
809 809 first character set to which conversion from local encoding
810 810 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
811 811 conversion fails, the text in question is sent as is.
812 812 (default: '')
813 813
814 814 Order of outgoing email character sets:
815 815
816 816 1. ``us-ascii``: always first, regardless of settings
817 817 2. ``email.charsets``: in order given by user
818 818 3. ``ui.fallbackencoding``: if not in email.charsets
819 819 4. ``$HGENCODING``: if not in email.charsets
820 820 5. ``utf-8``: always last, regardless of settings
821 821
822 822 Email example::
823 823
824 824 [email]
825 825 from = Joseph User <joe.user@example.com>
826 826 method = /usr/sbin/sendmail
827 827 # charsets for western Europeans
828 828 # us-ascii, utf-8 omitted, as they are tried first and last
829 829 charsets = iso-8859-1, iso-8859-15, windows-1252
830 830
831 831
832 832 ``extensions``
833 833 --------------
834 834
835 835 Mercurial has an extension mechanism for adding new features. To
836 836 enable an extension, create an entry for it in this section.
837 837
838 838 If you know that the extension is already in Python's search path,
839 839 you can give the name of the module, followed by ``=``, with nothing
840 840 after the ``=``.
841 841
842 842 Otherwise, give a name that you choose, followed by ``=``, followed by
843 843 the path to the ``.py`` file (including the file name extension) that
844 844 defines the extension.
845 845
846 846 To explicitly disable an extension that is enabled in an hgrc of
847 847 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
848 848 or ``foo = !`` when path is not supplied.
849 849
850 850 Example for ``~/.hgrc``::
851 851
852 852 [extensions]
853 853 # (the churn extension will get loaded from Mercurial's path)
854 854 churn =
855 855 # (this extension will get loaded from the file specified)
856 856 myfeature = ~/.hgext/myfeature.py
857 857
858 858 If an extension fails to load, a warning will be issued, and Mercurial will
859 859 proceed. To enforce that an extension must be loaded, one can set the `required`
860 860 suboption in the config::
861 861
862 862 [extensions]
863 863 myfeature = ~/.hgext/myfeature.py
864 864 myfeature:required = yes
865 865
866 866 To debug extension loading issue, one can add `--traceback` to their mercurial
867 867 invocation.
868 868
869 869 A default setting can we set using the special `*` extension key::
870 870
871 871 [extensions]
872 872 *:required = yes
873 873 myfeature = ~/.hgext/myfeature.py
874 874 rebase=
875 875
876 876
877 877 ``format``
878 878 ----------
879 879
880 880 Configuration that controls the repository format. Newer format options are more
881 881 powerful, but incompatible with some older versions of Mercurial. Format options
882 882 are considered at repository initialization only. You need to make a new clone
883 883 for config changes to be taken into account.
884 884
885 885 For more details about repository format and version compatibility, see
886 886 https://www.mercurial-scm.org/wiki/MissingRequirement
887 887
888 888 ``usegeneraldelta``
889 889 Enable or disable the "generaldelta" repository format which improves
890 890 repository compression by allowing "revlog" to store deltas against
891 891 arbitrary revisions instead of the previously stored one. This provides
892 892 significant improvement for repositories with branches.
893 893
894 894 Repositories with this on-disk format require Mercurial version 1.9.
895 895
896 896 Enabled by default.
897 897
898 898 ``dotencode``
899 899 Enable or disable the "dotencode" repository format which enhances
900 900 the "fncache" repository format (which has to be enabled to use
901 901 dotencode) to avoid issues with filenames starting with "._" on
902 902 Mac OS X and spaces on Windows.
903 903
904 904 Repositories with this on-disk format require Mercurial version 1.7.
905 905
906 906 Enabled by default.
907 907
908 908 ``usefncache``
909 909 Enable or disable the "fncache" repository format which enhances
910 910 the "store" repository format (which has to be enabled to use
911 911 fncache) to allow longer filenames and avoids using Windows
912 912 reserved names, e.g. "nul".
913 913
914 914 Repositories with this on-disk format require Mercurial version 1.1.
915 915
916 916 Enabled by default.
917 917
918 918 ``use-dirstate-v2``
919 919 Enable or disable the experimental "dirstate-v2" feature. The dirstate
920 920 functionality is shared by all commands interacting with the working copy.
921 921 The new version is more robust, faster and stores more information.
922 922
923 923 The performance-improving version of this feature is currently only
924 924 implemented in Rust (see :hg:`help rust`), so people not using a version of
925 925 Mercurial compiled with the Rust parts might actually suffer some slowdown.
926 926 For this reason, such versions will by default refuse to access repositories
927 927 with "dirstate-v2" enabled.
928 928
929 929 This behavior can be adjusted via configuration: check
930 930 :hg:`help config.storage.dirstate-v2.slow-path` for details.
931 931
932 932 Repositories with this on-disk format require Mercurial 6.0 or above.
933 933
934 934 By default this format variant is disabled if the fast implementation is not
935 935 available, and enabled by default if the fast implementation is available.
936 936
937 937 To accomodate installations of Mercurial without the fast implementation,
938 938 you can downgrade your repository. To do so run the following command:
939 939
940 940 $ hg debugupgraderepo \
941 941 --run \
942 942 --config format.use-dirstate-v2=False \
943 943 --config storage.dirstate-v2.slow-path=allow
944 944
945 945 For a more comprehensive guide, see :hg:`help internals.dirstate-v2`.
946 946
947 947 ``use-dirstate-v2.automatic-upgrade-of-mismatching-repositories``
948 948 When enabled, an automatic upgrade will be triggered when a repository format
949 949 does not match its `use-dirstate-v2` config.
950 950
951 951 This is an advanced behavior that most users will not need. We recommend you
952 952 don't use this unless you are a seasoned administrator of a Mercurial install
953 953 base.
954 954
955 955 Automatic upgrade means that any process accessing the repository will
956 956 upgrade the repository format to use `dirstate-v2`. This only triggers if a
957 957 change is needed. This also applies to operations that would have been
958 958 read-only (like hg status).
959 959
960 960 If the repository cannot be locked, the automatic-upgrade operation will be
961 961 skipped. The next operation will attempt it again.
962 962
963 963 This configuration will apply for moves in any direction, either adding the
964 964 `dirstate-v2` format if `format.use-dirstate-v2=yes` or removing the
965 965 `dirstate-v2` requirement if `format.use-dirstate-v2=no`. So we recommend
966 966 setting both this value and `format.use-dirstate-v2` at the same time.
967 967
968 968 ``use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet``
969 969 Hide message when performing such automatic upgrade.
970 970
971 971 ``use-dirstate-tracked-hint``
972 972 Enable or disable the writing of "tracked key" file alongside the dirstate.
973 973 (default to disabled)
974 974
975 975 That "tracked-hint" can help external automations to detect changes to the
976 976 set of tracked files. (i.e the result of `hg files` or `hg status -macd`)
977 977
978 978 The tracked-hint is written in a new `.hg/dirstate-tracked-hint`. That file
979 979 contains two lines:
980 980 - the first line is the file version (currently: 1),
981 981 - the second line contains the "tracked-hint".
982 982 That file is written right after the dirstate is written.
983 983
984 984 The tracked-hint changes whenever the set of file tracked in the dirstate
985 985 changes. The general idea is:
986 986 - if the hint is identical, the set of tracked file SHOULD be identical,
987 987 - if the hint is different, the set of tracked file MIGHT be different.
988 988
989 989 The "hint is identical" case uses `SHOULD` as the dirstate and the hint file
990 990 are two distinct files and therefore that cannot be read or written to in an
991 991 atomic way. If the key is identical, nothing garantees that the dirstate is
992 992 not updated right after the hint file. This is considered a negligible
993 993 limitation for the intended usecase. It is actually possible to prevent this
994 994 race by taking the repository lock during read operations.
995 995
996 996 They are two "ways" to use this feature:
997 997
998 998 1) monitoring changes to the `.hg/dirstate-tracked-hint`, if the file
999 999 changes, the tracked set might have changed.
1000 1000
1001 1001 2) storing the value and comparing it to a later value.
1002 1002
1003 1003
1004 1004 ``use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories``
1005 1005 When enabled, an automatic upgrade will be triggered when a repository format
1006 1006 does not match its `use-dirstate-tracked-hint` config.
1007 1007
1008 1008 This is an advanced behavior that most users will not need. We recommend you
1009 1009 don't use this unless you are a seasoned administrator of a Mercurial install
1010 1010 base.
1011 1011
1012 1012 Automatic upgrade means that any process accessing the repository will
1013 1013 upgrade the repository format to use `dirstate-tracked-hint`. This only
1014 1014 triggers if a change is needed. This also applies to operations that would
1015 1015 have been read-only (like hg status).
1016 1016
1017 1017 If the repository cannot be locked, the automatic-upgrade operation will be
1018 1018 skipped. The next operation will attempt it again.
1019 1019
1020 1020 This configuration will apply for moves in any direction, either adding the
1021 1021 `dirstate-tracked-hint` format if `format.use-dirstate-tracked-hint=yes` or
1022 1022 removing the `dirstate-tracked-hint` requirement if
1023 1023 `format.use-dirstate-tracked-hint=no`. So we recommend setting both this
1024 1024 value and `format.use-dirstate-tracked-hint` at the same time.
1025 1025
1026 1026
1027 ``use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet``
1028 Hide message when performing such automatic upgrade.
1029
1030
1027 1031 ``use-persistent-nodemap``
1028 1032 Enable or disable the "persistent-nodemap" feature which improves
1029 1033 performance if the Rust extensions are available.
1030 1034
1031 1035 The "persistent-nodemap" persist the "node -> rev" on disk removing the
1032 1036 need to dynamically build that mapping for each Mercurial invocation. This
1033 1037 significantly reduces the startup cost of various local and server-side
1034 1038 operation for larger repositories.
1035 1039
1036 1040 The performance-improving version of this feature is currently only
1037 1041 implemented in Rust (see :hg:`help rust`), so people not using a version of
1038 1042 Mercurial compiled with the Rust parts might actually suffer some slowdown.
1039 1043 For this reason, such versions will by default refuse to access repositories
1040 1044 with "persistent-nodemap".
1041 1045
1042 1046 This behavior can be adjusted via configuration: check
1043 1047 :hg:`help config.storage.revlog.persistent-nodemap.slow-path` for details.
1044 1048
1045 1049 Repositories with this on-disk format require Mercurial 5.4 or above.
1046 1050
1047 1051 By default this format variant is disabled if the fast implementation is not
1048 1052 available, and enabled by default if the fast implementation is available.
1049 1053
1050 1054 To accomodate installations of Mercurial without the fast implementation,
1051 1055 you can downgrade your repository. To do so run the following command:
1052 1056
1053 1057 $ hg debugupgraderepo \
1054 1058 --run \
1055 1059 --config format.use-persistent-nodemap=False \
1056 1060 --config storage.revlog.persistent-nodemap.slow-path=allow
1057 1061
1058 1062 ``use-share-safe``
1059 1063 Enforce "safe" behaviors for all "shares" that access this repository.
1060 1064
1061 1065 With this feature, "shares" using this repository as a source will:
1062 1066
1063 1067 * read the source repository's configuration (`<source>/.hg/hgrc`).
1064 1068 * read and use the source repository's "requirements"
1065 1069 (except the working copy specific one).
1066 1070
1067 1071 Without this feature, "shares" using this repository as a source will:
1068 1072
1069 1073 * keep tracking the repository "requirements" in the share only, ignoring
1070 1074 the source "requirements", possibly diverging from them.
1071 1075 * ignore source repository config. This can create problems, like silently
1072 1076 ignoring important hooks.
1073 1077
1074 1078 Beware that existing shares will not be upgraded/downgraded, and by
1075 1079 default, Mercurial will refuse to interact with them until the mismatch
1076 1080 is resolved. See :hg:`help config.share.safe-mismatch.source-safe` and
1077 1081 :hg:`help config.share.safe-mismatch.source-not-safe` for details.
1078 1082
1079 1083 Introduced in Mercurial 5.7.
1080 1084
1081 1085 Enabled by default in Mercurial 6.1.
1082 1086
1083 1087 ``use-share-safe.automatic-upgrade-of-mismatching-repositories``
1084 1088 When enabled, an automatic upgrade will be triggered when a repository format
1085 1089 does not match its `use-share-safe` config.
1086 1090
1087 1091 This is an advanced behavior that most users will not need. We recommend you
1088 1092 don't use this unless you are a seasoned administrator of a Mercurial install
1089 1093 base.
1090 1094
1091 1095 Automatic upgrade means that any process accessing the repository will
1092 1096 upgrade the repository format to use `share-safe`. This only triggers if a
1093 1097 change is needed. This also applies to operation that would have been
1094 1098 read-only (like hg status).
1095 1099
1096 1100 If the repository cannot be locked, the automatic-upgrade operation will be
1097 1101 skipped. The next operation will attempt it again.
1098 1102
1099 1103 This configuration will apply for moves in any direction, either adding the
1100 1104 `share-safe` format if `format.use-share-safe=yes` or removing the
1101 1105 `share-safe` requirement if `format.use-share-safe=no`. So we recommend
1102 1106 setting both this value and `format.use-share-safe` at the same time.
1103 1107
1104 1108 ``use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet``
1105 1109 Hide message when performing such automatic upgrade.
1106 1110
1107 1111 ``usestore``
1108 1112 Enable or disable the "store" repository format which improves
1109 1113 compatibility with systems that fold case or otherwise mangle
1110 1114 filenames. Disabling this option will allow you to store longer filenames
1111 1115 in some situations at the expense of compatibility.
1112 1116
1113 1117 Repositories with this on-disk format require Mercurial version 0.9.4.
1114 1118
1115 1119 Enabled by default.
1116 1120
1117 1121 ``sparse-revlog``
1118 1122 Enable or disable the ``sparse-revlog`` delta strategy. This format improves
1119 1123 delta re-use inside revlog. For very branchy repositories, it results in a
1120 1124 smaller store. For repositories with many revisions, it also helps
1121 1125 performance (by using shortened delta chains.)
1122 1126
1123 1127 Repositories with this on-disk format require Mercurial version 4.7
1124 1128
1125 1129 Enabled by default.
1126 1130
1127 1131 ``revlog-compression``
1128 1132 Compression algorithm used by revlog. Supported values are `zlib` and
1129 1133 `zstd`. The `zlib` engine is the historical default of Mercurial. `zstd` is
1130 1134 a newer format that is usually a net win over `zlib`, operating faster at
1131 1135 better compression rates. Use `zstd` to reduce CPU usage. Multiple values
1132 1136 can be specified, the first available one will be used.
1133 1137
1134 1138 On some systems, the Mercurial installation may lack `zstd` support.
1135 1139
1136 1140 Default is `zstd` if available, `zlib` otherwise.
1137 1141
1138 1142 ``bookmarks-in-store``
1139 1143 Store bookmarks in .hg/store/. This means that bookmarks are shared when
1140 1144 using `hg share` regardless of the `-B` option.
1141 1145
1142 1146 Repositories with this on-disk format require Mercurial version 5.1.
1143 1147
1144 1148 Disabled by default.
1145 1149
1146 1150
1147 1151 ``graph``
1148 1152 ---------
1149 1153
1150 1154 Web graph view configuration. This section let you change graph
1151 1155 elements display properties by branches, for instance to make the
1152 1156 ``default`` branch stand out.
1153 1157
1154 1158 Each line has the following format::
1155 1159
1156 1160 <branch>.<argument> = <value>
1157 1161
1158 1162 where ``<branch>`` is the name of the branch being
1159 1163 customized. Example::
1160 1164
1161 1165 [graph]
1162 1166 # 2px width
1163 1167 default.width = 2
1164 1168 # red color
1165 1169 default.color = FF0000
1166 1170
1167 1171 Supported arguments:
1168 1172
1169 1173 ``width``
1170 1174 Set branch edges width in pixels.
1171 1175
1172 1176 ``color``
1173 1177 Set branch edges color in hexadecimal RGB notation.
1174 1178
1175 1179 ``hooks``
1176 1180 ---------
1177 1181
1178 1182 Commands or Python functions that get automatically executed by
1179 1183 various actions such as starting or finishing a commit. Multiple
1180 1184 hooks can be run for the same action by appending a suffix to the
1181 1185 action. Overriding a site-wide hook can be done by changing its
1182 1186 value or setting it to an empty string. Hooks can be prioritized
1183 1187 by adding a prefix of ``priority.`` to the hook name on a new line
1184 1188 and setting the priority. The default priority is 0.
1185 1189
1186 1190 Example ``.hg/hgrc``::
1187 1191
1188 1192 [hooks]
1189 1193 # update working directory after adding changesets
1190 1194 changegroup.update = hg update
1191 1195 # do not use the site-wide hook
1192 1196 incoming =
1193 1197 incoming.email = /my/email/hook
1194 1198 incoming.autobuild = /my/build/hook
1195 1199 # force autobuild hook to run before other incoming hooks
1196 1200 priority.incoming.autobuild = 1
1197 1201 ### control HGPLAIN setting when running autobuild hook
1198 1202 # HGPLAIN always set (default from Mercurial 5.7)
1199 1203 incoming.autobuild:run-with-plain = yes
1200 1204 # HGPLAIN never set
1201 1205 incoming.autobuild:run-with-plain = no
1202 1206 # HGPLAIN inherited from environment (default before Mercurial 5.7)
1203 1207 incoming.autobuild:run-with-plain = auto
1204 1208
1205 1209 Most hooks are run with environment variables set that give useful
1206 1210 additional information. For each hook below, the environment variables
1207 1211 it is passed are listed with names in the form ``$HG_foo``. The
1208 1212 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
1209 1213 They contain the type of hook which triggered the run and the full name
1210 1214 of the hook in the config, respectively. In the example above, this will
1211 1215 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
1212 1216
1213 1217 .. container:: windows
1214 1218
1215 1219 Some basic Unix syntax can be enabled for portability, including ``$VAR``
1216 1220 and ``${VAR}`` style variables. A ``~`` followed by ``\`` or ``/`` will
1217 1221 be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion
1218 1222 on Unix. To use a literal ``$`` or ``~``, it must be escaped with a back
1219 1223 slash or inside of a strong quote. Strong quotes will be replaced by
1220 1224 double quotes after processing.
1221 1225
1222 1226 This feature is enabled by adding a prefix of ``tonative.`` to the hook
1223 1227 name on a new line, and setting it to ``True``. For example::
1224 1228
1225 1229 [hooks]
1226 1230 incoming.autobuild = /my/build/hook
1227 1231 # enable translation to cmd.exe syntax for autobuild hook
1228 1232 tonative.incoming.autobuild = True
1229 1233
1230 1234 ``changegroup``
1231 1235 Run after a changegroup has been added via push, pull or unbundle. The ID of
1232 1236 the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
1233 1237 The URL from which changes came is in ``$HG_URL``.
1234 1238
1235 1239 ``commit``
1236 1240 Run after a changeset has been created in the local repository. The ID
1237 1241 of the newly created changeset is in ``$HG_NODE``. Parent changeset
1238 1242 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1239 1243
1240 1244 ``incoming``
1241 1245 Run after a changeset has been pulled, pushed, or unbundled into
1242 1246 the local repository. The ID of the newly arrived changeset is in
1243 1247 ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
1244 1248
1245 1249 ``outgoing``
1246 1250 Run after sending changes from the local repository to another. The ID of
1247 1251 first changeset sent is in ``$HG_NODE``. The source of operation is in
1248 1252 ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
1249 1253
1250 1254 ``post-<command>``
1251 1255 Run after successful invocations of the associated command. The
1252 1256 contents of the command line are passed as ``$HG_ARGS`` and the result
1253 1257 code in ``$HG_RESULT``. Parsed command line arguments are passed as
1254 1258 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
1255 1259 the python data internally passed to <command>. ``$HG_OPTS`` is a
1256 1260 dictionary of options (with unspecified options set to their defaults).
1257 1261 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
1258 1262
1259 1263 ``fail-<command>``
1260 1264 Run after a failed invocation of an associated command. The contents
1261 1265 of the command line are passed as ``$HG_ARGS``. Parsed command line
1262 1266 arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
1263 1267 string representations of the python data internally passed to
1264 1268 <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
1265 1269 options set to their defaults). ``$HG_PATS`` is a list of arguments.
1266 1270 Hook failure is ignored.
1267 1271
1268 1272 ``pre-<command>``
1269 1273 Run before executing the associated command. The contents of the
1270 1274 command line are passed as ``$HG_ARGS``. Parsed command line arguments
1271 1275 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
1272 1276 representations of the data internally passed to <command>. ``$HG_OPTS``
1273 1277 is a dictionary of options (with unspecified options set to their
1274 1278 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
1275 1279 failure, the command doesn't execute and Mercurial returns the failure
1276 1280 code.
1277 1281
1278 1282 ``prechangegroup``
1279 1283 Run before a changegroup is added via push, pull or unbundle. Exit
1280 1284 status 0 allows the changegroup to proceed. A non-zero status will
1281 1285 cause the push, pull or unbundle to fail. The URL from which changes
1282 1286 will come is in ``$HG_URL``.
1283 1287
1284 1288 ``precommit``
1285 1289 Run before starting a local commit. Exit status 0 allows the
1286 1290 commit to proceed. A non-zero status will cause the commit to fail.
1287 1291 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1288 1292
1289 1293 ``prelistkeys``
1290 1294 Run before listing pushkeys (like bookmarks) in the
1291 1295 repository. A non-zero status will cause failure. The key namespace is
1292 1296 in ``$HG_NAMESPACE``.
1293 1297
1294 1298 ``preoutgoing``
1295 1299 Run before collecting changes to send from the local repository to
1296 1300 another. A non-zero status will cause failure. This lets you prevent
1297 1301 pull over HTTP or SSH. It can also prevent propagating commits (via
1298 1302 local pull, push (outbound) or bundle commands), but not completely,
1299 1303 since you can just copy files instead. The source of operation is in
1300 1304 ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
1301 1305 SSH or HTTP repository. If "push", "pull" or "bundle", the operation
1302 1306 is happening on behalf of a repository on same system.
1303 1307
1304 1308 ``prepushkey``
1305 1309 Run before a pushkey (like a bookmark) is added to the
1306 1310 repository. A non-zero status will cause the key to be rejected. The
1307 1311 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
1308 1312 the old value (if any) is in ``$HG_OLD``, and the new value is in
1309 1313 ``$HG_NEW``.
1310 1314
1311 1315 ``pretag``
1312 1316 Run before creating a tag. Exit status 0 allows the tag to be
1313 1317 created. A non-zero status will cause the tag to fail. The ID of the
1314 1318 changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
1315 1319 tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
1316 1320
1317 1321 ``pretxnopen``
1318 1322 Run before any new repository transaction is open. The reason for the
1319 1323 transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
1320 1324 transaction will be in ``$HG_TXNID``. A non-zero status will prevent the
1321 1325 transaction from being opened.
1322 1326
1323 1327 ``pretxnclose``
1324 1328 Run right before the transaction is actually finalized. Any repository change
1325 1329 will be visible to the hook program. This lets you validate the transaction
1326 1330 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1327 1331 status will cause the transaction to be rolled back. The reason for the
1328 1332 transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
1329 1333 the transaction will be in ``$HG_TXNID``. The rest of the available data will
1330 1334 vary according the transaction type. Changes unbundled to the repository will
1331 1335 add ``$HG_URL`` and ``$HG_SOURCE``. New changesets will add ``$HG_NODE`` (the
1332 1336 ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last added
1333 1337 changeset). Bookmark and phase changes will set ``$HG_BOOKMARK_MOVED`` and
1334 1338 ``$HG_PHASES_MOVED`` to ``1`` respectively. The number of new obsmarkers, if
1335 1339 any, will be in ``$HG_NEW_OBSMARKERS``, etc.
1336 1340
1337 1341 ``pretxnclose-bookmark``
1338 1342 Run right before a bookmark change is actually finalized. Any repository
1339 1343 change will be visible to the hook program. This lets you validate the
1340 1344 transaction content or change it. Exit status 0 allows the commit to
1341 1345 proceed. A non-zero status will cause the transaction to be rolled back.
1342 1346 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
1343 1347 bookmark location will be available in ``$HG_NODE`` while the previous
1344 1348 location will be available in ``$HG_OLDNODE``. In case of a bookmark
1345 1349 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1346 1350 will be empty.
1347 1351 In addition, the reason for the transaction opening will be in
1348 1352 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1349 1353 ``$HG_TXNID``.
1350 1354
1351 1355 ``pretxnclose-phase``
1352 1356 Run right before a phase change is actually finalized. Any repository change
1353 1357 will be visible to the hook program. This lets you validate the transaction
1354 1358 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1355 1359 status will cause the transaction to be rolled back. The hook is called
1356 1360 multiple times, once for each revision affected by a phase change.
1357 1361 The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
1358 1362 while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
1359 1363 will be empty. In addition, the reason for the transaction opening will be in
1360 1364 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1361 1365 ``$HG_TXNID``. The hook is also run for newly added revisions. In this case
1362 1366 the ``$HG_OLDPHASE`` entry will be empty.
1363 1367
1364 1368 ``txnclose``
1365 1369 Run after any repository transaction has been committed. At this
1366 1370 point, the transaction can no longer be rolled back. The hook will run
1367 1371 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
1368 1372 details about available variables.
1369 1373
1370 1374 ``txnclose-bookmark``
1371 1375 Run after any bookmark change has been committed. At this point, the
1372 1376 transaction can no longer be rolled back. The hook will run after the lock
1373 1377 is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
1374 1378 about available variables.
1375 1379
1376 1380 ``txnclose-phase``
1377 1381 Run after any phase change has been committed. At this point, the
1378 1382 transaction can no longer be rolled back. The hook will run after the lock
1379 1383 is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
1380 1384 available variables.
1381 1385
1382 1386 ``txnabort``
1383 1387 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
1384 1388 for details about available variables.
1385 1389
1386 1390 ``pretxnchangegroup``
1387 1391 Run after a changegroup has been added via push, pull or unbundle, but before
1388 1392 the transaction has been committed. The changegroup is visible to the hook
1389 1393 program. This allows validation of incoming changes before accepting them.
1390 1394 The ID of the first new changeset is in ``$HG_NODE`` and last is in
1391 1395 ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
1392 1396 status will cause the transaction to be rolled back, and the push, pull or
1393 1397 unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
1394 1398
1395 1399 ``pretxncommit``
1396 1400 Run after a changeset has been created, but before the transaction is
1397 1401 committed. The changeset is visible to the hook program. This allows
1398 1402 validation of the commit message and changes. Exit status 0 allows the
1399 1403 commit to proceed. A non-zero status will cause the transaction to
1400 1404 be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
1401 1405 changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1402 1406
1403 1407 ``preupdate``
1404 1408 Run before updating the working directory. Exit status 0 allows
1405 1409 the update to proceed. A non-zero status will prevent the update.
1406 1410 The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
1407 1411 merge, the ID of second new parent is in ``$HG_PARENT2``.
1408 1412
1409 1413 ``listkeys``
1410 1414 Run after listing pushkeys (like bookmarks) in the repository. The
1411 1415 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
1412 1416 dictionary containing the keys and values.
1413 1417
1414 1418 ``pushkey``
1415 1419 Run after a pushkey (like a bookmark) is added to the
1416 1420 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
1417 1421 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
1418 1422 value is in ``$HG_NEW``.
1419 1423
1420 1424 ``tag``
1421 1425 Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
1422 1426 The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
1423 1427 the repository if ``$HG_LOCAL=0``.
1424 1428
1425 1429 ``update``
1426 1430 Run after updating the working directory. The changeset ID of first
1427 1431 new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
1428 1432 parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1429 1433 update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
1430 1434
1431 1435 .. note::
1432 1436
1433 1437 It is generally better to use standard hooks rather than the
1434 1438 generic pre- and post- command hooks, as they are guaranteed to be
1435 1439 called in the appropriate contexts for influencing transactions.
1436 1440 Also, hooks like "commit" will be called in all contexts that
1437 1441 generate a commit (e.g. tag) and not just the commit command.
1438 1442
1439 1443 .. note::
1440 1444
1441 1445 Environment variables with empty values may not be passed to
1442 1446 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
1443 1447 will have an empty value under Unix-like platforms for non-merge
1444 1448 changesets, while it will not be available at all under Windows.
1445 1449
1446 1450 The syntax for Python hooks is as follows::
1447 1451
1448 1452 hookname = python:modulename.submodule.callable
1449 1453 hookname = python:/path/to/python/module.py:callable
1450 1454
1451 1455 Python hooks are run within the Mercurial process. Each hook is
1452 1456 called with at least three keyword arguments: a ui object (keyword
1453 1457 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
1454 1458 keyword that tells what kind of hook is used. Arguments listed as
1455 1459 environment variables above are passed as keyword arguments, with no
1456 1460 ``HG_`` prefix, and names in lower case.
1457 1461
1458 1462 If a Python hook returns a "true" value or raises an exception, this
1459 1463 is treated as a failure.
1460 1464
1461 1465
1462 1466 ``hostfingerprints``
1463 1467 --------------------
1464 1468
1465 1469 (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
1466 1470
1467 1471 Fingerprints of the certificates of known HTTPS servers.
1468 1472
1469 1473 A HTTPS connection to a server with a fingerprint configured here will
1470 1474 only succeed if the servers certificate matches the fingerprint.
1471 1475 This is very similar to how ssh known hosts works.
1472 1476
1473 1477 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
1474 1478 Multiple values can be specified (separated by spaces or commas). This can
1475 1479 be used to define both old and new fingerprints while a host transitions
1476 1480 to a new certificate.
1477 1481
1478 1482 The CA chain and web.cacerts is not used for servers with a fingerprint.
1479 1483
1480 1484 For example::
1481 1485
1482 1486 [hostfingerprints]
1483 1487 hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1484 1488 hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1485 1489
1486 1490 ``hostsecurity``
1487 1491 ----------------
1488 1492
1489 1493 Used to specify global and per-host security settings for connecting to
1490 1494 other machines.
1491 1495
1492 1496 The following options control default behavior for all hosts.
1493 1497
1494 1498 ``ciphers``
1495 1499 Defines the cryptographic ciphers to use for connections.
1496 1500
1497 1501 Value must be a valid OpenSSL Cipher List Format as documented at
1498 1502 https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
1499 1503
1500 1504 This setting is for advanced users only. Setting to incorrect values
1501 1505 can significantly lower connection security or decrease performance.
1502 1506 You have been warned.
1503 1507
1504 1508 This option requires Python 2.7.
1505 1509
1506 1510 ``minimumprotocol``
1507 1511 Defines the minimum channel encryption protocol to use.
1508 1512
1509 1513 By default, the highest version of TLS supported by both client and server
1510 1514 is used.
1511 1515
1512 1516 Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
1513 1517
1514 1518 When running on an old Python version, only ``tls1.0`` is allowed since
1515 1519 old versions of Python only support up to TLS 1.0.
1516 1520
1517 1521 When running a Python that supports modern TLS versions, the default is
1518 1522 ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
1519 1523 weakens security and should only be used as a feature of last resort if
1520 1524 a server does not support TLS 1.1+.
1521 1525
1522 1526 Options in the ``[hostsecurity]`` section can have the form
1523 1527 ``hostname``:``setting``. This allows multiple settings to be defined on a
1524 1528 per-host basis.
1525 1529
1526 1530 The following per-host settings can be defined.
1527 1531
1528 1532 ``ciphers``
1529 1533 This behaves like ``ciphers`` as described above except it only applies
1530 1534 to the host on which it is defined.
1531 1535
1532 1536 ``fingerprints``
1533 1537 A list of hashes of the DER encoded peer/remote certificate. Values have
1534 1538 the form ``algorithm``:``fingerprint``. e.g.
1535 1539 ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
1536 1540 In addition, colons (``:``) can appear in the fingerprint part.
1537 1541
1538 1542 The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
1539 1543 ``sha512``.
1540 1544
1541 1545 Use of ``sha256`` or ``sha512`` is preferred.
1542 1546
1543 1547 If a fingerprint is specified, the CA chain is not validated for this
1544 1548 host and Mercurial will require the remote certificate to match one
1545 1549 of the fingerprints specified. This means if the server updates its
1546 1550 certificate, Mercurial will abort until a new fingerprint is defined.
1547 1551 This can provide stronger security than traditional CA-based validation
1548 1552 at the expense of convenience.
1549 1553
1550 1554 This option takes precedence over ``verifycertsfile``.
1551 1555
1552 1556 ``minimumprotocol``
1553 1557 This behaves like ``minimumprotocol`` as described above except it
1554 1558 only applies to the host on which it is defined.
1555 1559
1556 1560 ``verifycertsfile``
1557 1561 Path to file a containing a list of PEM encoded certificates used to
1558 1562 verify the server certificate. Environment variables and ``~user``
1559 1563 constructs are expanded in the filename.
1560 1564
1561 1565 The server certificate or the certificate's certificate authority (CA)
1562 1566 must match a certificate from this file or certificate verification
1563 1567 will fail and connections to the server will be refused.
1564 1568
1565 1569 If defined, only certificates provided by this file will be used:
1566 1570 ``web.cacerts`` and any system/default certificates will not be
1567 1571 used.
1568 1572
1569 1573 This option has no effect if the per-host ``fingerprints`` option
1570 1574 is set.
1571 1575
1572 1576 The format of the file is as follows::
1573 1577
1574 1578 -----BEGIN CERTIFICATE-----
1575 1579 ... (certificate in base64 PEM encoding) ...
1576 1580 -----END CERTIFICATE-----
1577 1581 -----BEGIN CERTIFICATE-----
1578 1582 ... (certificate in base64 PEM encoding) ...
1579 1583 -----END CERTIFICATE-----
1580 1584
1581 1585 For example::
1582 1586
1583 1587 [hostsecurity]
1584 1588 hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
1585 1589 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
1586 1590 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
1587 1591 foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
1588 1592
1589 1593 To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
1590 1594 when connecting to ``hg.example.com``::
1591 1595
1592 1596 [hostsecurity]
1593 1597 minimumprotocol = tls1.2
1594 1598 hg.example.com:minimumprotocol = tls1.1
1595 1599
1596 1600 ``http_proxy``
1597 1601 --------------
1598 1602
1599 1603 Used to access web-based Mercurial repositories through a HTTP
1600 1604 proxy.
1601 1605
1602 1606 ``host``
1603 1607 Host name and (optional) port of the proxy server, for example
1604 1608 "myproxy:8000".
1605 1609
1606 1610 ``no``
1607 1611 Optional. Comma-separated list of host names that should bypass
1608 1612 the proxy.
1609 1613
1610 1614 ``passwd``
1611 1615 Optional. Password to authenticate with at the proxy server.
1612 1616
1613 1617 ``user``
1614 1618 Optional. User name to authenticate with at the proxy server.
1615 1619
1616 1620 ``always``
1617 1621 Optional. Always use the proxy, even for localhost and any entries
1618 1622 in ``http_proxy.no``. (default: False)
1619 1623
1620 1624 ``http``
1621 1625 ----------
1622 1626
1623 1627 Used to configure access to Mercurial repositories via HTTP.
1624 1628
1625 1629 ``timeout``
1626 1630 If set, blocking operations will timeout after that many seconds.
1627 1631 (default: None)
1628 1632
1629 1633 ``merge``
1630 1634 ---------
1631 1635
1632 1636 This section specifies behavior during merges and updates.
1633 1637
1634 1638 ``checkignored``
1635 1639 Controls behavior when an ignored file on disk has the same name as a tracked
1636 1640 file in the changeset being merged or updated to, and has different
1637 1641 contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
1638 1642 abort on such files. With ``warn``, warn on such files and back them up as
1639 1643 ``.orig``. With ``ignore``, don't print a warning and back them up as
1640 1644 ``.orig``. (default: ``abort``)
1641 1645
1642 1646 ``checkunknown``
1643 1647 Controls behavior when an unknown file that isn't ignored has the same name
1644 1648 as a tracked file in the changeset being merged or updated to, and has
1645 1649 different contents. Similar to ``merge.checkignored``, except for files that
1646 1650 are not ignored. (default: ``abort``)
1647 1651
1648 1652 ``on-failure``
1649 1653 When set to ``continue`` (the default), the merge process attempts to
1650 1654 merge all unresolved files using the merge chosen tool, regardless of
1651 1655 whether previous file merge attempts during the process succeeded or not.
1652 1656 Setting this to ``prompt`` will prompt after any merge failure continue
1653 1657 or halt the merge process. Setting this to ``halt`` will automatically
1654 1658 halt the merge process on any merge tool failure. The merge process
1655 1659 can be restarted by using the ``resolve`` command. When a merge is
1656 1660 halted, the repository is left in a normal ``unresolved`` merge state.
1657 1661 (default: ``continue``)
1658 1662
1659 1663 ``strict-capability-check``
1660 1664 Whether capabilities of internal merge tools are checked strictly
1661 1665 or not, while examining rules to decide merge tool to be used.
1662 1666 (default: False)
1663 1667
1664 1668 ``merge-patterns``
1665 1669 ------------------
1666 1670
1667 1671 This section specifies merge tools to associate with particular file
1668 1672 patterns. Tools matched here will take precedence over the default
1669 1673 merge tool. Patterns are globs by default, rooted at the repository
1670 1674 root.
1671 1675
1672 1676 Example::
1673 1677
1674 1678 [merge-patterns]
1675 1679 **.c = kdiff3
1676 1680 **.jpg = myimgmerge
1677 1681
1678 1682 ``merge-tools``
1679 1683 ---------------
1680 1684
1681 1685 This section configures external merge tools to use for file-level
1682 1686 merges. This section has likely been preconfigured at install time.
1683 1687 Use :hg:`config merge-tools` to check the existing configuration.
1684 1688 Also see :hg:`help merge-tools` for more details.
1685 1689
1686 1690 Example ``~/.hgrc``::
1687 1691
1688 1692 [merge-tools]
1689 1693 # Override stock tool location
1690 1694 kdiff3.executable = ~/bin/kdiff3
1691 1695 # Specify command line
1692 1696 kdiff3.args = $base $local $other -o $output
1693 1697 # Give higher priority
1694 1698 kdiff3.priority = 1
1695 1699
1696 1700 # Changing the priority of preconfigured tool
1697 1701 meld.priority = 0
1698 1702
1699 1703 # Disable a preconfigured tool
1700 1704 vimdiff.disabled = yes
1701 1705
1702 1706 # Define new tool
1703 1707 myHtmlTool.args = -m $local $other $base $output
1704 1708 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
1705 1709 myHtmlTool.priority = 1
1706 1710
1707 1711 Supported arguments:
1708 1712
1709 1713 ``priority``
1710 1714 The priority in which to evaluate this tool.
1711 1715 (default: 0)
1712 1716
1713 1717 ``executable``
1714 1718 Either just the name of the executable or its pathname.
1715 1719
1716 1720 .. container:: windows
1717 1721
1718 1722 On Windows, the path can use environment variables with ${ProgramFiles}
1719 1723 syntax.
1720 1724
1721 1725 (default: the tool name)
1722 1726
1723 1727 ``args``
1724 1728 The arguments to pass to the tool executable. You can refer to the
1725 1729 files being merged as well as the output file through these
1726 1730 variables: ``$base``, ``$local``, ``$other``, ``$output``.
1727 1731
1728 1732 The meaning of ``$local`` and ``$other`` can vary depending on which action is
1729 1733 being performed. During an update or merge, ``$local`` represents the original
1730 1734 state of the file, while ``$other`` represents the commit you are updating to or
1731 1735 the commit you are merging with. During a rebase, ``$local`` represents the
1732 1736 destination of the rebase, and ``$other`` represents the commit being rebased.
1733 1737
1734 1738 Some operations define custom labels to assist with identifying the revisions,
1735 1739 accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
1736 1740 labels are not available, these will be ``local``, ``other``, and ``base``,
1737 1741 respectively.
1738 1742 (default: ``$local $base $other``)
1739 1743
1740 1744 ``premerge``
1741 1745 Attempt to run internal non-interactive 3-way merge tool before
1742 1746 launching external tool. Options are ``true``, ``false``, ``keep``,
1743 1747 ``keep-merge3``, or ``keep-mergediff`` (experimental). The ``keep`` option
1744 1748 will leave markers in the file if the premerge fails. The ``keep-merge3``
1745 1749 will do the same but include information about the base of the merge in the
1746 1750 marker (see internal :merge3 in :hg:`help merge-tools`). The
1747 1751 ``keep-mergediff`` option is similar but uses a different marker style
1748 1752 (see internal :merge3 in :hg:`help merge-tools`). (default: True)
1749 1753
1750 1754 ``binary``
1751 1755 This tool can merge binary files. (default: False, unless tool
1752 1756 was selected by file pattern match)
1753 1757
1754 1758 ``symlink``
1755 1759 This tool can merge symlinks. (default: False)
1756 1760
1757 1761 ``check``
1758 1762 A list of merge success-checking options:
1759 1763
1760 1764 ``changed``
1761 1765 Ask whether merge was successful when the merged file shows no changes.
1762 1766 ``conflicts``
1763 1767 Check whether there are conflicts even though the tool reported success.
1764 1768 ``prompt``
1765 1769 Always prompt for merge success, regardless of success reported by tool.
1766 1770
1767 1771 ``fixeol``
1768 1772 Attempt to fix up EOL changes caused by the merge tool.
1769 1773 (default: False)
1770 1774
1771 1775 ``gui``
1772 1776 This tool requires a graphical interface to run. (default: False)
1773 1777
1774 1778 ``mergemarkers``
1775 1779 Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
1776 1780 ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
1777 1781 ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
1778 1782 markers generated during premerge will be ``detailed`` if either this option or
1779 1783 the corresponding option in the ``[ui]`` section is ``detailed``.
1780 1784 (default: ``basic``)
1781 1785
1782 1786 ``mergemarkertemplate``
1783 1787 This setting can be used to override ``mergemarker`` from the
1784 1788 ``[command-templates]`` section on a per-tool basis; this applies to the
1785 1789 ``$label``-prefixed variables and to the conflict markers that are generated
1786 1790 if ``premerge`` is ``keep` or ``keep-merge3``. See the corresponding variable
1787 1791 in ``[ui]`` for more information.
1788 1792
1789 1793 .. container:: windows
1790 1794
1791 1795 ``regkey``
1792 1796 Windows registry key which describes install location of this
1793 1797 tool. Mercurial will search for this key first under
1794 1798 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1795 1799 (default: None)
1796 1800
1797 1801 ``regkeyalt``
1798 1802 An alternate Windows registry key to try if the first key is not
1799 1803 found. The alternate key uses the same ``regname`` and ``regappend``
1800 1804 semantics of the primary key. The most common use for this key
1801 1805 is to search for 32bit applications on 64bit operating systems.
1802 1806 (default: None)
1803 1807
1804 1808 ``regname``
1805 1809 Name of value to read from specified registry key.
1806 1810 (default: the unnamed (default) value)
1807 1811
1808 1812 ``regappend``
1809 1813 String to append to the value read from the registry, typically
1810 1814 the executable name of the tool.
1811 1815 (default: None)
1812 1816
1813 1817 ``pager``
1814 1818 ---------
1815 1819
1816 1820 Setting used to control when to paginate and with what external tool. See
1817 1821 :hg:`help pager` for details.
1818 1822
1819 1823 ``pager``
1820 1824 Define the external tool used as pager.
1821 1825
1822 1826 If no pager is set, Mercurial uses the environment variable $PAGER.
1823 1827 If neither pager.pager, nor $PAGER is set, a default pager will be
1824 1828 used, typically `less` on Unix and `more` on Windows. Example::
1825 1829
1826 1830 [pager]
1827 1831 pager = less -FRX
1828 1832
1829 1833 ``ignore``
1830 1834 List of commands to disable the pager for. Example::
1831 1835
1832 1836 [pager]
1833 1837 ignore = version, help, update
1834 1838
1835 1839 ``patch``
1836 1840 ---------
1837 1841
1838 1842 Settings used when applying patches, for instance through the 'import'
1839 1843 command or with Mercurial Queues extension.
1840 1844
1841 1845 ``eol``
1842 1846 When set to 'strict' patch content and patched files end of lines
1843 1847 are preserved. When set to ``lf`` or ``crlf``, both files end of
1844 1848 lines are ignored when patching and the result line endings are
1845 1849 normalized to either LF (Unix) or CRLF (Windows). When set to
1846 1850 ``auto``, end of lines are again ignored while patching but line
1847 1851 endings in patched files are normalized to their original setting
1848 1852 on a per-file basis. If target file does not exist or has no end
1849 1853 of line, patch line endings are preserved.
1850 1854 (default: strict)
1851 1855
1852 1856 ``fuzz``
1853 1857 The number of lines of 'fuzz' to allow when applying patches. This
1854 1858 controls how much context the patcher is allowed to ignore when
1855 1859 trying to apply a patch.
1856 1860 (default: 2)
1857 1861
1858 1862 ``paths``
1859 1863 ---------
1860 1864
1861 1865 Assigns symbolic names and behavior to repositories.
1862 1866
1863 1867 Options are symbolic names defining the URL or directory that is the
1864 1868 location of the repository. Example::
1865 1869
1866 1870 [paths]
1867 1871 my_server = https://example.com/my_repo
1868 1872 local_path = /home/me/repo
1869 1873
1870 1874 These symbolic names can be used from the command line. To pull
1871 1875 from ``my_server``: :hg:`pull my_server`. To push to ``local_path``:
1872 1876 :hg:`push local_path`. You can check :hg:`help urls` for details about
1873 1877 valid URLs.
1874 1878
1875 1879 Options containing colons (``:``) denote sub-options that can influence
1876 1880 behavior for that specific path. Example::
1877 1881
1878 1882 [paths]
1879 1883 my_server = https://example.com/my_path
1880 1884 my_server:pushurl = ssh://example.com/my_path
1881 1885
1882 1886 Paths using the `path://otherpath` scheme will inherit the sub-options value from
1883 1887 the path they point to.
1884 1888
1885 1889 The following sub-options can be defined:
1886 1890
1887 1891 ``multi-urls``
1888 1892 A boolean option. When enabled the value of the `[paths]` entry will be
1889 1893 parsed as a list and the alias will resolve to multiple destination. If some
1890 1894 of the list entry use the `path://` syntax, the suboption will be inherited
1891 1895 individually.
1892 1896
1893 1897 ``pushurl``
1894 1898 The URL to use for push operations. If not defined, the location
1895 1899 defined by the path's main entry is used.
1896 1900
1897 1901 ``pushrev``
1898 1902 A revset defining which revisions to push by default.
1899 1903
1900 1904 When :hg:`push` is executed without a ``-r`` argument, the revset
1901 1905 defined by this sub-option is evaluated to determine what to push.
1902 1906
1903 1907 For example, a value of ``.`` will push the working directory's
1904 1908 revision by default.
1905 1909
1906 1910 Revsets specifying bookmarks will not result in the bookmark being
1907 1911 pushed.
1908 1912
1909 1913 ``bookmarks.mode``
1910 1914 How bookmark will be dealt during the exchange. It support the following value
1911 1915
1912 1916 - ``default``: the default behavior, local and remote bookmarks are "merged"
1913 1917 on push/pull.
1914 1918
1915 1919 - ``mirror``: when pulling, replace local bookmarks by remote bookmarks. This
1916 1920 is useful to replicate a repository, or as an optimization.
1917 1921
1918 1922 - ``ignore``: ignore bookmarks during exchange.
1919 1923 (This currently only affect pulling)
1920 1924
1921 1925 The following special named paths exist:
1922 1926
1923 1927 ``default``
1924 1928 The URL or directory to use when no source or remote is specified.
1925 1929
1926 1930 :hg:`clone` will automatically define this path to the location the
1927 1931 repository was cloned from.
1928 1932
1929 1933 ``default-push``
1930 1934 (deprecated) The URL or directory for the default :hg:`push` location.
1931 1935 ``default:pushurl`` should be used instead.
1932 1936
1933 1937 ``phases``
1934 1938 ----------
1935 1939
1936 1940 Specifies default handling of phases. See :hg:`help phases` for more
1937 1941 information about working with phases.
1938 1942
1939 1943 ``publish``
1940 1944 Controls draft phase behavior when working as a server. When true,
1941 1945 pushed changesets are set to public in both client and server and
1942 1946 pulled or cloned changesets are set to public in the client.
1943 1947 (default: True)
1944 1948
1945 1949 ``new-commit``
1946 1950 Phase of newly-created commits.
1947 1951 (default: draft)
1948 1952
1949 1953 ``checksubrepos``
1950 1954 Check the phase of the current revision of each subrepository. Allowed
1951 1955 values are "ignore", "follow" and "abort". For settings other than
1952 1956 "ignore", the phase of the current revision of each subrepository is
1953 1957 checked before committing the parent repository. If any of those phases is
1954 1958 greater than the phase of the parent repository (e.g. if a subrepo is in a
1955 1959 "secret" phase while the parent repo is in "draft" phase), the commit is
1956 1960 either aborted (if checksubrepos is set to "abort") or the higher phase is
1957 1961 used for the parent repository commit (if set to "follow").
1958 1962 (default: follow)
1959 1963
1960 1964
1961 1965 ``profiling``
1962 1966 -------------
1963 1967
1964 1968 Specifies profiling type, format, and file output. Two profilers are
1965 1969 supported: an instrumenting profiler (named ``ls``), and a sampling
1966 1970 profiler (named ``stat``).
1967 1971
1968 1972 In this section description, 'profiling data' stands for the raw data
1969 1973 collected during profiling, while 'profiling report' stands for a
1970 1974 statistical text report generated from the profiling data.
1971 1975
1972 1976 ``enabled``
1973 1977 Enable the profiler.
1974 1978 (default: false)
1975 1979
1976 1980 This is equivalent to passing ``--profile`` on the command line.
1977 1981
1978 1982 ``type``
1979 1983 The type of profiler to use.
1980 1984 (default: stat)
1981 1985
1982 1986 ``ls``
1983 1987 Use Python's built-in instrumenting profiler. This profiler
1984 1988 works on all platforms, but each line number it reports is the
1985 1989 first line of a function. This restriction makes it difficult to
1986 1990 identify the expensive parts of a non-trivial function.
1987 1991 ``stat``
1988 1992 Use a statistical profiler, statprof. This profiler is most
1989 1993 useful for profiling commands that run for longer than about 0.1
1990 1994 seconds.
1991 1995
1992 1996 ``format``
1993 1997 Profiling format. Specific to the ``ls`` instrumenting profiler.
1994 1998 (default: text)
1995 1999
1996 2000 ``text``
1997 2001 Generate a profiling report. When saving to a file, it should be
1998 2002 noted that only the report is saved, and the profiling data is
1999 2003 not kept.
2000 2004 ``kcachegrind``
2001 2005 Format profiling data for kcachegrind use: when saving to a
2002 2006 file, the generated file can directly be loaded into
2003 2007 kcachegrind.
2004 2008
2005 2009 ``statformat``
2006 2010 Profiling format for the ``stat`` profiler.
2007 2011 (default: hotpath)
2008 2012
2009 2013 ``hotpath``
2010 2014 Show a tree-based display containing the hot path of execution (where
2011 2015 most time was spent).
2012 2016 ``bymethod``
2013 2017 Show a table of methods ordered by how frequently they are active.
2014 2018 ``byline``
2015 2019 Show a table of lines in files ordered by how frequently they are active.
2016 2020 ``json``
2017 2021 Render profiling data as JSON.
2018 2022
2019 2023 ``freq``
2020 2024 Sampling frequency. Specific to the ``stat`` sampling profiler.
2021 2025 (default: 1000)
2022 2026
2023 2027 ``output``
2024 2028 File path where profiling data or report should be saved. If the
2025 2029 file exists, it is replaced. (default: None, data is printed on
2026 2030 stderr)
2027 2031
2028 2032 ``sort``
2029 2033 Sort field. Specific to the ``ls`` instrumenting profiler.
2030 2034 One of ``callcount``, ``reccallcount``, ``totaltime`` and
2031 2035 ``inlinetime``.
2032 2036 (default: inlinetime)
2033 2037
2034 2038 ``time-track``
2035 2039 Control if the stat profiler track ``cpu`` or ``real`` time.
2036 2040 (default: ``cpu`` on Windows, otherwise ``real``)
2037 2041
2038 2042 ``limit``
2039 2043 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
2040 2044 (default: 30)
2041 2045
2042 2046 ``nested``
2043 2047 Show at most this number of lines of drill-down info after each main entry.
2044 2048 This can help explain the difference between Total and Inline.
2045 2049 Specific to the ``ls`` instrumenting profiler.
2046 2050 (default: 0)
2047 2051
2048 2052 ``showmin``
2049 2053 Minimum fraction of samples an entry must have for it to be displayed.
2050 2054 Can be specified as a float between ``0.0`` and ``1.0`` or can have a
2051 2055 ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
2052 2056
2053 2057 Only used by the ``stat`` profiler.
2054 2058
2055 2059 For the ``hotpath`` format, default is ``0.05``.
2056 2060 For the ``chrome`` format, default is ``0.005``.
2057 2061
2058 2062 The option is unused on other formats.
2059 2063
2060 2064 ``showmax``
2061 2065 Maximum fraction of samples an entry can have before it is ignored in
2062 2066 display. Values format is the same as ``showmin``.
2063 2067
2064 2068 Only used by the ``stat`` profiler.
2065 2069
2066 2070 For the ``chrome`` format, default is ``0.999``.
2067 2071
2068 2072 The option is unused on other formats.
2069 2073
2070 2074 ``showtime``
2071 2075 Show time taken as absolute durations, in addition to percentages.
2072 2076 Only used by the ``hotpath`` format.
2073 2077 (default: true)
2074 2078
2075 2079 ``progress``
2076 2080 ------------
2077 2081
2078 2082 Mercurial commands can draw progress bars that are as informative as
2079 2083 possible. Some progress bars only offer indeterminate information, while others
2080 2084 have a definite end point.
2081 2085
2082 2086 ``debug``
2083 2087 Whether to print debug info when updating the progress bar. (default: False)
2084 2088
2085 2089 ``delay``
2086 2090 Number of seconds (float) before showing the progress bar. (default: 3)
2087 2091
2088 2092 ``changedelay``
2089 2093 Minimum delay before showing a new topic. When set to less than 3 * refresh,
2090 2094 that value will be used instead. (default: 1)
2091 2095
2092 2096 ``estimateinterval``
2093 2097 Maximum sampling interval in seconds for speed and estimated time
2094 2098 calculation. (default: 60)
2095 2099
2096 2100 ``refresh``
2097 2101 Time in seconds between refreshes of the progress bar. (default: 0.1)
2098 2102
2099 2103 ``format``
2100 2104 Format of the progress bar.
2101 2105
2102 2106 Valid entries for the format field are ``topic``, ``bar``, ``number``,
2103 2107 ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
2104 2108 last 20 characters of the item, but this can be changed by adding either
2105 2109 ``-<num>`` which would take the last num characters, or ``+<num>`` for the
2106 2110 first num characters.
2107 2111
2108 2112 (default: topic bar number estimate)
2109 2113
2110 2114 ``width``
2111 2115 If set, the maximum width of the progress information (that is, min(width,
2112 2116 term width) will be used).
2113 2117
2114 2118 ``clear-complete``
2115 2119 Clear the progress bar after it's done. (default: True)
2116 2120
2117 2121 ``disable``
2118 2122 If true, don't show a progress bar.
2119 2123
2120 2124 ``assume-tty``
2121 2125 If true, ALWAYS show a progress bar, unless disable is given.
2122 2126
2123 2127 ``rebase``
2124 2128 ----------
2125 2129
2126 2130 ``evolution.allowdivergence``
2127 2131 Default to False, when True allow creating divergence when performing
2128 2132 rebase of obsolete changesets.
2129 2133
2130 2134 ``revsetalias``
2131 2135 ---------------
2132 2136
2133 2137 Alias definitions for revsets. See :hg:`help revsets` for details.
2134 2138
2135 2139 ``rewrite``
2136 2140 -----------
2137 2141
2138 2142 ``backup-bundle``
2139 2143 Whether to save stripped changesets to a bundle file. (default: True)
2140 2144
2141 2145 ``update-timestamp``
2142 2146 If true, updates the date and time of the changeset to current. It is only
2143 2147 applicable for `hg amend`, `hg commit --amend` and `hg uncommit` in the
2144 2148 current version.
2145 2149
2146 2150 ``empty-successor``
2147 2151
2148 2152 Control what happens with empty successors that are the result of rewrite
2149 2153 operations. If set to ``skip``, the successor is not created. If set to
2150 2154 ``keep``, the empty successor is created and kept.
2151 2155
2152 2156 Currently, only the rebase and absorb commands consider this configuration.
2153 2157 (EXPERIMENTAL)
2154 2158
2155 2159 ``share``
2156 2160 ---------
2157 2161
2158 2162 ``safe-mismatch.source-safe``
2159 2163 Controls what happens when the shared repository does not use the
2160 2164 share-safe mechanism but its source repository does.
2161 2165
2162 2166 Possible values are `abort` (default), `allow`, `upgrade-abort` and
2163 2167 `upgrade-allow`.
2164 2168
2165 2169 ``abort``
2166 2170 Disallows running any command and aborts
2167 2171 ``allow``
2168 2172 Respects the feature presence in the share source
2169 2173 ``upgrade-abort``
2170 2174 tries to upgrade the share to use share-safe; if it fails, aborts
2171 2175 ``upgrade-allow``
2172 2176 tries to upgrade the share; if it fails, continue by
2173 2177 respecting the share source setting
2174 2178
2175 2179 Check :hg:`help config.format.use-share-safe` for details about the
2176 2180 share-safe feature.
2177 2181
2178 2182 ``safe-mismatch.source-safe.warn``
2179 2183 Shows a warning on operations if the shared repository does not use
2180 2184 share-safe, but the source repository does.
2181 2185 (default: True)
2182 2186
2183 2187 ``safe-mismatch.source-not-safe``
2184 2188 Controls what happens when the shared repository uses the share-safe
2185 2189 mechanism but its source does not.
2186 2190
2187 2191 Possible values are `abort` (default), `allow`, `downgrade-abort` and
2188 2192 `downgrade-allow`.
2189 2193
2190 2194 ``abort``
2191 2195 Disallows running any command and aborts
2192 2196 ``allow``
2193 2197 Respects the feature presence in the share source
2194 2198 ``downgrade-abort``
2195 2199 tries to downgrade the share to not use share-safe; if it fails, aborts
2196 2200 ``downgrade-allow``
2197 2201 tries to downgrade the share to not use share-safe;
2198 2202 if it fails, continue by respecting the shared source setting
2199 2203
2200 2204 Check :hg:`help config.format.use-share-safe` for details about the
2201 2205 share-safe feature.
2202 2206
2203 2207 ``safe-mismatch.source-not-safe.warn``
2204 2208 Shows a warning on operations if the shared repository uses share-safe,
2205 2209 but the source repository does not.
2206 2210 (default: True)
2207 2211
2208 2212 ``storage``
2209 2213 -----------
2210 2214
2211 2215 Control the strategy Mercurial uses internally to store history. Options in this
2212 2216 category impact performance and repository size.
2213 2217
2214 2218 ``revlog.issue6528.fix-incoming``
2215 2219 Version 5.8 of Mercurial had a bug leading to altering the parent of file
2216 2220 revision with copy information (or any other metadata) on exchange. This
2217 2221 leads to the copy metadata to be overlooked by various internal logic. The
2218 2222 issue was fixed in Mercurial 5.8.1.
2219 2223 (See https://bz.mercurial-scm.org/show_bug.cgi?id=6528 for details)
2220 2224
2221 2225 As a result Mercurial is now checking and fixing incoming file revisions to
2222 2226 make sure there parents are in the right order. This behavior can be
2223 2227 disabled by setting this option to `no`. This apply to revisions added
2224 2228 through push, pull, clone and unbundle.
2225 2229
2226 2230 To fix affected revisions that already exist within the repository, one can
2227 2231 use :hg:`debug-repair-issue-6528`.
2228 2232
2229 2233 ``revlog.optimize-delta-parent-choice``
2230 2234 When storing a merge revision, both parents will be equally considered as
2231 2235 a possible delta base. This results in better delta selection and improved
2232 2236 revlog compression. This option is enabled by default.
2233 2237
2234 2238 Turning this option off can result in large increase of repository size for
2235 2239 repository with many merges.
2236 2240
2237 2241 ``revlog.persistent-nodemap.mmap``
2238 2242 Whether to use the Operating System "memory mapping" feature (when
2239 2243 possible) to access the persistent nodemap data. This improve performance
2240 2244 and reduce memory pressure.
2241 2245
2242 2246 Default to True.
2243 2247
2244 2248 For details on the "persistent-nodemap" feature, see:
2245 2249 :hg:`help config.format.use-persistent-nodemap`.
2246 2250
2247 2251 ``revlog.persistent-nodemap.slow-path``
2248 2252 Control the behavior of Merucrial when using a repository with "persistent"
2249 2253 nodemap with an installation of Mercurial without a fast implementation for
2250 2254 the feature:
2251 2255
2252 2256 ``allow``: Silently use the slower implementation to access the repository.
2253 2257 ``warn``: Warn, but use the slower implementation to access the repository.
2254 2258 ``abort``: Prevent access to such repositories. (This is the default)
2255 2259
2256 2260 For details on the "persistent-nodemap" feature, see:
2257 2261 :hg:`help config.format.use-persistent-nodemap`.
2258 2262
2259 2263 ``revlog.reuse-external-delta-parent``
2260 2264 Control the order in which delta parents are considered when adding new
2261 2265 revisions from an external source.
2262 2266 (typically: apply bundle from `hg pull` or `hg push`).
2263 2267
2264 2268 New revisions are usually provided as a delta against other revisions. By
2265 2269 default, Mercurial will try to reuse this delta first, therefore using the
2266 2270 same "delta parent" as the source. Directly using delta's from the source
2267 2271 reduces CPU usage and usually speeds up operation. However, in some case,
2268 2272 the source might have sub-optimal delta bases and forcing their reevaluation
2269 2273 is useful. For example, pushes from an old client could have sub-optimal
2270 2274 delta's parent that the server want to optimize. (lack of general delta, bad
2271 2275 parents, choice, lack of sparse-revlog, etc).
2272 2276
2273 2277 This option is enabled by default. Turning it off will ensure bad delta
2274 2278 parent choices from older client do not propagate to this repository, at
2275 2279 the cost of a small increase in CPU consumption.
2276 2280
2277 2281 Note: this option only control the order in which delta parents are
2278 2282 considered. Even when disabled, the existing delta from the source will be
2279 2283 reused if the same delta parent is selected.
2280 2284
2281 2285 ``revlog.reuse-external-delta``
2282 2286 Control the reuse of delta from external source.
2283 2287 (typically: apply bundle from `hg pull` or `hg push`).
2284 2288
2285 2289 New revisions are usually provided as a delta against another revision. By
2286 2290 default, Mercurial will not recompute the same delta again, trusting
2287 2291 externally provided deltas. There have been rare cases of small adjustment
2288 2292 to the diffing algorithm in the past. So in some rare case, recomputing
2289 2293 delta provided by ancient clients can provides better results. Disabling
2290 2294 this option means going through a full delta recomputation for all incoming
2291 2295 revisions. It means a large increase in CPU usage and will slow operations
2292 2296 down.
2293 2297
2294 2298 This option is enabled by default. When disabled, it also disables the
2295 2299 related ``storage.revlog.reuse-external-delta-parent`` option.
2296 2300
2297 2301 ``revlog.zlib.level``
2298 2302 Zlib compression level used when storing data into the repository. Accepted
2299 2303 Value range from 1 (lowest compression) to 9 (highest compression). Zlib
2300 2304 default value is 6.
2301 2305
2302 2306
2303 2307 ``revlog.zstd.level``
2304 2308 zstd compression level used when storing data into the repository. Accepted
2305 2309 Value range from 1 (lowest compression) to 22 (highest compression).
2306 2310 (default 3)
2307 2311
2308 2312 ``server``
2309 2313 ----------
2310 2314
2311 2315 Controls generic server settings.
2312 2316
2313 2317 ``bookmarks-pushkey-compat``
2314 2318 Trigger pushkey hook when being pushed bookmark updates. This config exist
2315 2319 for compatibility purpose (default to True)
2316 2320
2317 2321 If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
2318 2322 movement we recommend you migrate them to ``txnclose-bookmark`` and
2319 2323 ``pretxnclose-bookmark``.
2320 2324
2321 2325 ``compressionengines``
2322 2326 List of compression engines and their relative priority to advertise
2323 2327 to clients.
2324 2328
2325 2329 The order of compression engines determines their priority, the first
2326 2330 having the highest priority. If a compression engine is not listed
2327 2331 here, it won't be advertised to clients.
2328 2332
2329 2333 If not set (the default), built-in defaults are used. Run
2330 2334 :hg:`debuginstall` to list available compression engines and their
2331 2335 default wire protocol priority.
2332 2336
2333 2337 Older Mercurial clients only support zlib compression and this setting
2334 2338 has no effect for legacy clients.
2335 2339
2336 2340 ``uncompressed``
2337 2341 Whether to allow clients to clone a repository using the
2338 2342 uncompressed streaming protocol. This transfers about 40% more
2339 2343 data than a regular clone, but uses less memory and CPU on both
2340 2344 server and client. Over a LAN (100 Mbps or better) or a very fast
2341 2345 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
2342 2346 regular clone. Over most WAN connections (anything slower than
2343 2347 about 6 Mbps), uncompressed streaming is slower, because of the
2344 2348 extra data transfer overhead. This mode will also temporarily hold
2345 2349 the write lock while determining what data to transfer.
2346 2350 (default: True)
2347 2351
2348 2352 ``uncompressedallowsecret``
2349 2353 Whether to allow stream clones when the repository contains secret
2350 2354 changesets. (default: False)
2351 2355
2352 2356 ``preferuncompressed``
2353 2357 When set, clients will try to use the uncompressed streaming
2354 2358 protocol. (default: False)
2355 2359
2356 2360 ``disablefullbundle``
2357 2361 When set, servers will refuse attempts to do pull-based clones.
2358 2362 If this option is set, ``preferuncompressed`` and/or clone bundles
2359 2363 are highly recommended. Partial clones will still be allowed.
2360 2364 (default: False)
2361 2365
2362 2366 ``streamunbundle``
2363 2367 When set, servers will apply data sent from the client directly,
2364 2368 otherwise it will be written to a temporary file first. This option
2365 2369 effectively prevents concurrent pushes.
2366 2370
2367 2371 ``pullbundle``
2368 2372 When set, the server will check pullbundles.manifest for bundles
2369 2373 covering the requested heads and common nodes. The first matching
2370 2374 entry will be streamed to the client.
2371 2375
2372 2376 For HTTP transport, the stream will still use zlib compression
2373 2377 for older clients.
2374 2378
2375 2379 ``concurrent-push-mode``
2376 2380 Level of allowed race condition between two pushing clients.
2377 2381
2378 2382 - 'strict': push is abort if another client touched the repository
2379 2383 while the push was preparing.
2380 2384 - 'check-related': push is only aborted if it affects head that got also
2381 2385 affected while the push was preparing. (default since 5.4)
2382 2386
2383 2387 'check-related' only takes effect for compatible clients (version
2384 2388 4.3 and later). Older clients will use 'strict'.
2385 2389
2386 2390 ``validate``
2387 2391 Whether to validate the completeness of pushed changesets by
2388 2392 checking that all new file revisions specified in manifests are
2389 2393 present. (default: False)
2390 2394
2391 2395 ``maxhttpheaderlen``
2392 2396 Instruct HTTP clients not to send request headers longer than this
2393 2397 many bytes. (default: 1024)
2394 2398
2395 2399 ``bundle1``
2396 2400 Whether to allow clients to push and pull using the legacy bundle1
2397 2401 exchange format. (default: True)
2398 2402
2399 2403 ``bundle1gd``
2400 2404 Like ``bundle1`` but only used if the repository is using the
2401 2405 *generaldelta* storage format. (default: True)
2402 2406
2403 2407 ``bundle1.push``
2404 2408 Whether to allow clients to push using the legacy bundle1 exchange
2405 2409 format. (default: True)
2406 2410
2407 2411 ``bundle1gd.push``
2408 2412 Like ``bundle1.push`` but only used if the repository is using the
2409 2413 *generaldelta* storage format. (default: True)
2410 2414
2411 2415 ``bundle1.pull``
2412 2416 Whether to allow clients to pull using the legacy bundle1 exchange
2413 2417 format. (default: True)
2414 2418
2415 2419 ``bundle1gd.pull``
2416 2420 Like ``bundle1.pull`` but only used if the repository is using the
2417 2421 *generaldelta* storage format. (default: True)
2418 2422
2419 2423 Large repositories using the *generaldelta* storage format should
2420 2424 consider setting this option because converting *generaldelta*
2421 2425 repositories to the exchange format required by the bundle1 data
2422 2426 format can consume a lot of CPU.
2423 2427
2424 2428 ``bundle2.stream``
2425 2429 Whether to allow clients to pull using the bundle2 streaming protocol.
2426 2430 (default: True)
2427 2431
2428 2432 ``zliblevel``
2429 2433 Integer between ``-1`` and ``9`` that controls the zlib compression level
2430 2434 for wire protocol commands that send zlib compressed output (notably the
2431 2435 commands that send repository history data).
2432 2436
2433 2437 The default (``-1``) uses the default zlib compression level, which is
2434 2438 likely equivalent to ``6``. ``0`` means no compression. ``9`` means
2435 2439 maximum compression.
2436 2440
2437 2441 Setting this option allows server operators to make trade-offs between
2438 2442 bandwidth and CPU used. Lowering the compression lowers CPU utilization
2439 2443 but sends more bytes to clients.
2440 2444
2441 2445 This option only impacts the HTTP server.
2442 2446
2443 2447 ``zstdlevel``
2444 2448 Integer between ``1`` and ``22`` that controls the zstd compression level
2445 2449 for wire protocol commands. ``1`` is the minimal amount of compression and
2446 2450 ``22`` is the highest amount of compression.
2447 2451
2448 2452 The default (``3``) should be significantly faster than zlib while likely
2449 2453 delivering better compression ratios.
2450 2454
2451 2455 This option only impacts the HTTP server.
2452 2456
2453 2457 See also ``server.zliblevel``.
2454 2458
2455 2459 ``view``
2456 2460 Repository filter used when exchanging revisions with the peer.
2457 2461
2458 2462 The default view (``served``) excludes secret and hidden changesets.
2459 2463 Another useful value is ``immutable`` (no draft, secret or hidden
2460 2464 changesets). (EXPERIMENTAL)
2461 2465
2462 2466 ``smtp``
2463 2467 --------
2464 2468
2465 2469 Configuration for extensions that need to send email messages.
2466 2470
2467 2471 ``host``
2468 2472 Host name of mail server, e.g. "mail.example.com".
2469 2473
2470 2474 ``port``
2471 2475 Optional. Port to connect to on mail server. (default: 465 if
2472 2476 ``tls`` is smtps; 25 otherwise)
2473 2477
2474 2478 ``tls``
2475 2479 Optional. Method to enable TLS when connecting to mail server: starttls,
2476 2480 smtps or none. (default: none)
2477 2481
2478 2482 ``username``
2479 2483 Optional. User name for authenticating with the SMTP server.
2480 2484 (default: None)
2481 2485
2482 2486 ``password``
2483 2487 Optional. Password for authenticating with the SMTP server. If not
2484 2488 specified, interactive sessions will prompt the user for a
2485 2489 password; non-interactive sessions will fail. (default: None)
2486 2490
2487 2491 ``local_hostname``
2488 2492 Optional. The hostname that the sender can use to identify
2489 2493 itself to the MTA.
2490 2494
2491 2495
2492 2496 ``subpaths``
2493 2497 ------------
2494 2498
2495 2499 Subrepository source URLs can go stale if a remote server changes name
2496 2500 or becomes temporarily unavailable. This section lets you define
2497 2501 rewrite rules of the form::
2498 2502
2499 2503 <pattern> = <replacement>
2500 2504
2501 2505 where ``pattern`` is a regular expression matching a subrepository
2502 2506 source URL and ``replacement`` is the replacement string used to
2503 2507 rewrite it. Groups can be matched in ``pattern`` and referenced in
2504 2508 ``replacements``. For instance::
2505 2509
2506 2510 http://server/(.*)-hg/ = http://hg.server/\1/
2507 2511
2508 2512 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
2509 2513
2510 2514 Relative subrepository paths are first made absolute, and the
2511 2515 rewrite rules are then applied on the full (absolute) path. If ``pattern``
2512 2516 doesn't match the full path, an attempt is made to apply it on the
2513 2517 relative path alone. The rules are applied in definition order.
2514 2518
2515 2519 ``subrepos``
2516 2520 ------------
2517 2521
2518 2522 This section contains options that control the behavior of the
2519 2523 subrepositories feature. See also :hg:`help subrepos`.
2520 2524
2521 2525 Security note: auditing in Mercurial is known to be insufficient to
2522 2526 prevent clone-time code execution with carefully constructed Git
2523 2527 subrepos. It is unknown if a similar detect is present in Subversion
2524 2528 subrepos. Both Git and Subversion subrepos are disabled by default
2525 2529 out of security concerns. These subrepo types can be enabled using
2526 2530 the respective options below.
2527 2531
2528 2532 ``allowed``
2529 2533 Whether subrepositories are allowed in the working directory.
2530 2534
2531 2535 When false, commands involving subrepositories (like :hg:`update`)
2532 2536 will fail for all subrepository types.
2533 2537 (default: true)
2534 2538
2535 2539 ``hg:allowed``
2536 2540 Whether Mercurial subrepositories are allowed in the working
2537 2541 directory. This option only has an effect if ``subrepos.allowed``
2538 2542 is true.
2539 2543 (default: true)
2540 2544
2541 2545 ``git:allowed``
2542 2546 Whether Git subrepositories are allowed in the working directory.
2543 2547 This option only has an effect if ``subrepos.allowed`` is true.
2544 2548
2545 2549 See the security note above before enabling Git subrepos.
2546 2550 (default: false)
2547 2551
2548 2552 ``svn:allowed``
2549 2553 Whether Subversion subrepositories are allowed in the working
2550 2554 directory. This option only has an effect if ``subrepos.allowed``
2551 2555 is true.
2552 2556
2553 2557 See the security note above before enabling Subversion subrepos.
2554 2558 (default: false)
2555 2559
2556 2560 ``templatealias``
2557 2561 -----------------
2558 2562
2559 2563 Alias definitions for templates. See :hg:`help templates` for details.
2560 2564
2561 2565 ``templates``
2562 2566 -------------
2563 2567
2564 2568 Use the ``[templates]`` section to define template strings.
2565 2569 See :hg:`help templates` for details.
2566 2570
2567 2571 ``trusted``
2568 2572 -----------
2569 2573
2570 2574 Mercurial will not use the settings in the
2571 2575 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
2572 2576 user or to a trusted group, as various hgrc features allow arbitrary
2573 2577 commands to be run. This issue is often encountered when configuring
2574 2578 hooks or extensions for shared repositories or servers. However,
2575 2579 the web interface will use some safe settings from the ``[web]``
2576 2580 section.
2577 2581
2578 2582 This section specifies what users and groups are trusted. The
2579 2583 current user is always trusted. To trust everybody, list a user or a
2580 2584 group with name ``*``. These settings must be placed in an
2581 2585 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
2582 2586 user or service running Mercurial.
2583 2587
2584 2588 ``users``
2585 2589 Comma-separated list of trusted users.
2586 2590
2587 2591 ``groups``
2588 2592 Comma-separated list of trusted groups.
2589 2593
2590 2594
2591 2595 ``ui``
2592 2596 ------
2593 2597
2594 2598 User interface controls.
2595 2599
2596 2600 ``archivemeta``
2597 2601 Whether to include the .hg_archival.txt file containing meta data
2598 2602 (hashes for the repository base and for tip) in archives created
2599 2603 by the :hg:`archive` command or downloaded via hgweb.
2600 2604 (default: True)
2601 2605
2602 2606 ``askusername``
2603 2607 Whether to prompt for a username when committing. If True, and
2604 2608 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
2605 2609 be prompted to enter a username. If no username is entered, the
2606 2610 default ``USER@HOST`` is used instead.
2607 2611 (default: False)
2608 2612
2609 2613 ``clonebundles``
2610 2614 Whether the "clone bundles" feature is enabled.
2611 2615
2612 2616 When enabled, :hg:`clone` may download and apply a server-advertised
2613 2617 bundle file from a URL instead of using the normal exchange mechanism.
2614 2618
2615 2619 This can likely result in faster and more reliable clones.
2616 2620
2617 2621 (default: True)
2618 2622
2619 2623 ``clonebundlefallback``
2620 2624 Whether failure to apply an advertised "clone bundle" from a server
2621 2625 should result in fallback to a regular clone.
2622 2626
2623 2627 This is disabled by default because servers advertising "clone
2624 2628 bundles" often do so to reduce server load. If advertised bundles
2625 2629 start mass failing and clients automatically fall back to a regular
2626 2630 clone, this would add significant and unexpected load to the server
2627 2631 since the server is expecting clone operations to be offloaded to
2628 2632 pre-generated bundles. Failing fast (the default behavior) ensures
2629 2633 clients don't overwhelm the server when "clone bundle" application
2630 2634 fails.
2631 2635
2632 2636 (default: False)
2633 2637
2634 2638 ``clonebundleprefers``
2635 2639 Defines preferences for which "clone bundles" to use.
2636 2640
2637 2641 Servers advertising "clone bundles" may advertise multiple available
2638 2642 bundles. Each bundle may have different attributes, such as the bundle
2639 2643 type and compression format. This option is used to prefer a particular
2640 2644 bundle over another.
2641 2645
2642 2646 The following keys are defined by Mercurial:
2643 2647
2644 2648 BUNDLESPEC
2645 2649 A bundle type specifier. These are strings passed to :hg:`bundle -t`.
2646 2650 e.g. ``gzip-v2`` or ``bzip2-v1``.
2647 2651
2648 2652 COMPRESSION
2649 2653 The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
2650 2654
2651 2655 Server operators may define custom keys.
2652 2656
2653 2657 Example values: ``COMPRESSION=bzip2``,
2654 2658 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
2655 2659
2656 2660 By default, the first bundle advertised by the server is used.
2657 2661
2658 2662 ``color``
2659 2663 When to colorize output. Possible value are Boolean ("yes" or "no"), or
2660 2664 "debug", or "always". (default: "yes"). "yes" will use color whenever it
2661 2665 seems possible. See :hg:`help color` for details.
2662 2666
2663 2667 ``commitsubrepos``
2664 2668 Whether to commit modified subrepositories when committing the
2665 2669 parent repository. If False and one subrepository has uncommitted
2666 2670 changes, abort the commit.
2667 2671 (default: False)
2668 2672
2669 2673 ``debug``
2670 2674 Print debugging information. (default: False)
2671 2675
2672 2676 ``editor``
2673 2677 The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
2674 2678
2675 2679 ``fallbackencoding``
2676 2680 Encoding to try if it's not possible to decode the changelog using
2677 2681 UTF-8. (default: ISO-8859-1)
2678 2682
2679 2683 ``graphnodetemplate``
2680 2684 (DEPRECATED) Use ``command-templates.graphnode`` instead.
2681 2685
2682 2686 ``ignore``
2683 2687 A file to read per-user ignore patterns from. This file should be
2684 2688 in the same format as a repository-wide .hgignore file. Filenames
2685 2689 are relative to the repository root. This option supports hook syntax,
2686 2690 so if you want to specify multiple ignore files, you can do so by
2687 2691 setting something like ``ignore.other = ~/.hgignore2``. For details
2688 2692 of the ignore file format, see the ``hgignore(5)`` man page.
2689 2693
2690 2694 ``interactive``
2691 2695 Allow to prompt the user. (default: True)
2692 2696
2693 2697 ``interface``
2694 2698 Select the default interface for interactive features (default: text).
2695 2699 Possible values are 'text' and 'curses'.
2696 2700
2697 2701 ``interface.chunkselector``
2698 2702 Select the interface for change recording (e.g. :hg:`commit -i`).
2699 2703 Possible values are 'text' and 'curses'.
2700 2704 This config overrides the interface specified by ui.interface.
2701 2705
2702 2706 ``large-file-limit``
2703 2707 Largest file size that gives no memory use warning.
2704 2708 Possible values are integers or 0 to disable the check.
2705 2709 Value is expressed in bytes by default, one can use standard units for
2706 2710 convenience (e.g. 10MB, 0.1GB, etc) (default: 10MB)
2707 2711
2708 2712 ``logtemplate``
2709 2713 (DEPRECATED) Use ``command-templates.log`` instead.
2710 2714
2711 2715 ``merge``
2712 2716 The conflict resolution program to use during a manual merge.
2713 2717 For more information on merge tools see :hg:`help merge-tools`.
2714 2718 For configuring merge tools see the ``[merge-tools]`` section.
2715 2719
2716 2720 ``mergemarkers``
2717 2721 Sets the merge conflict marker label styling. The ``detailed`` style
2718 2722 uses the ``command-templates.mergemarker`` setting to style the labels.
2719 2723 The ``basic`` style just uses 'local' and 'other' as the marker label.
2720 2724 One of ``basic`` or ``detailed``.
2721 2725 (default: ``basic``)
2722 2726
2723 2727 ``mergemarkertemplate``
2724 2728 (DEPRECATED) Use ``command-templates.mergemarker`` instead.
2725 2729
2726 2730 ``message-output``
2727 2731 Where to write status and error messages. (default: ``stdio``)
2728 2732
2729 2733 ``channel``
2730 2734 Use separate channel for structured output. (Command-server only)
2731 2735 ``stderr``
2732 2736 Everything to stderr.
2733 2737 ``stdio``
2734 2738 Status to stdout, and error to stderr.
2735 2739
2736 2740 ``origbackuppath``
2737 2741 The path to a directory used to store generated .orig files. If the path is
2738 2742 not a directory, one will be created. If set, files stored in this
2739 2743 directory have the same name as the original file and do not have a .orig
2740 2744 suffix.
2741 2745
2742 2746 ``paginate``
2743 2747 Control the pagination of command output (default: True). See :hg:`help pager`
2744 2748 for details.
2745 2749
2746 2750 ``patch``
2747 2751 An optional external tool that ``hg import`` and some extensions
2748 2752 will use for applying patches. By default Mercurial uses an
2749 2753 internal patch utility. The external tool must work as the common
2750 2754 Unix ``patch`` program. In particular, it must accept a ``-p``
2751 2755 argument to strip patch headers, a ``-d`` argument to specify the
2752 2756 current directory, a file name to patch, and a patch file to take
2753 2757 from stdin.
2754 2758
2755 2759 It is possible to specify a patch tool together with extra
2756 2760 arguments. For example, setting this option to ``patch --merge``
2757 2761 will use the ``patch`` program with its 2-way merge option.
2758 2762
2759 2763 ``portablefilenames``
2760 2764 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
2761 2765 (default: ``warn``)
2762 2766
2763 2767 ``warn``
2764 2768 Print a warning message on POSIX platforms, if a file with a non-portable
2765 2769 filename is added (e.g. a file with a name that can't be created on
2766 2770 Windows because it contains reserved parts like ``AUX``, reserved
2767 2771 characters like ``:``, or would cause a case collision with an existing
2768 2772 file).
2769 2773
2770 2774 ``ignore``
2771 2775 Don't print a warning.
2772 2776
2773 2777 ``abort``
2774 2778 The command is aborted.
2775 2779
2776 2780 ``true``
2777 2781 Alias for ``warn``.
2778 2782
2779 2783 ``false``
2780 2784 Alias for ``ignore``.
2781 2785
2782 2786 .. container:: windows
2783 2787
2784 2788 On Windows, this configuration option is ignored and the command aborted.
2785 2789
2786 2790 ``pre-merge-tool-output-template``
2787 2791 (DEPRECATED) Use ``command-template.pre-merge-tool-output`` instead.
2788 2792
2789 2793 ``quiet``
2790 2794 Reduce the amount of output printed.
2791 2795 (default: False)
2792 2796
2793 2797 ``relative-paths``
2794 2798 Prefer relative paths in the UI.
2795 2799
2796 2800 ``remotecmd``
2797 2801 Remote command to use for clone/push/pull operations.
2798 2802 (default: ``hg``)
2799 2803
2800 2804 ``report_untrusted``
2801 2805 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
2802 2806 trusted user or group.
2803 2807 (default: True)
2804 2808
2805 2809 ``slash``
2806 2810 (Deprecated. Use ``slashpath`` template filter instead.)
2807 2811
2808 2812 Display paths using a slash (``/``) as the path separator. This
2809 2813 only makes a difference on systems where the default path
2810 2814 separator is not the slash character (e.g. Windows uses the
2811 2815 backslash character (``\``)).
2812 2816 (default: False)
2813 2817
2814 2818 ``statuscopies``
2815 2819 Display copies in the status command.
2816 2820
2817 2821 ``ssh``
2818 2822 Command to use for SSH connections. (default: ``ssh``)
2819 2823
2820 2824 ``ssherrorhint``
2821 2825 A hint shown to the user in the case of SSH error (e.g.
2822 2826 ``Please see http://company/internalwiki/ssh.html``)
2823 2827
2824 2828 ``strict``
2825 2829 Require exact command names, instead of allowing unambiguous
2826 2830 abbreviations. (default: False)
2827 2831
2828 2832 ``style``
2829 2833 Name of style to use for command output.
2830 2834
2831 2835 ``supportcontact``
2832 2836 A URL where users should report a Mercurial traceback. Use this if you are a
2833 2837 large organisation with its own Mercurial deployment process and crash
2834 2838 reports should be addressed to your internal support.
2835 2839
2836 2840 ``textwidth``
2837 2841 Maximum width of help text. A longer line generated by ``hg help`` or
2838 2842 ``hg subcommand --help`` will be broken after white space to get this
2839 2843 width or the terminal width, whichever comes first.
2840 2844 A non-positive value will disable this and the terminal width will be
2841 2845 used. (default: 78)
2842 2846
2843 2847 ``timeout``
2844 2848 The timeout used when a lock is held (in seconds), a negative value
2845 2849 means no timeout. (default: 600)
2846 2850
2847 2851 ``timeout.warn``
2848 2852 Time (in seconds) before a warning is printed about held lock. A negative
2849 2853 value means no warning. (default: 0)
2850 2854
2851 2855 ``traceback``
2852 2856 Mercurial always prints a traceback when an unknown exception
2853 2857 occurs. Setting this to True will make Mercurial print a traceback
2854 2858 on all exceptions, even those recognized by Mercurial (such as
2855 2859 IOError or MemoryError). (default: False)
2856 2860
2857 2861 ``tweakdefaults``
2858 2862
2859 2863 By default Mercurial's behavior changes very little from release
2860 2864 to release, but over time the recommended config settings
2861 2865 shift. Enable this config to opt in to get automatic tweaks to
2862 2866 Mercurial's behavior over time. This config setting will have no
2863 2867 effect if ``HGPLAIN`` is set or ``HGPLAINEXCEPT`` is set and does
2864 2868 not include ``tweakdefaults``. (default: False)
2865 2869
2866 2870 It currently means::
2867 2871
2868 2872 .. tweakdefaultsmarker
2869 2873
2870 2874 ``username``
2871 2875 The committer of a changeset created when running "commit".
2872 2876 Typically a person's name and email address, e.g. ``Fred Widget
2873 2877 <fred@example.com>``. Environment variables in the
2874 2878 username are expanded.
2875 2879
2876 2880 (default: ``$EMAIL`` or ``username@hostname``. If the username in
2877 2881 hgrc is empty, e.g. if the system admin set ``username =`` in the
2878 2882 system hgrc, it has to be specified manually or in a different
2879 2883 hgrc file)
2880 2884
2881 2885 ``verbose``
2882 2886 Increase the amount of output printed. (default: False)
2883 2887
2884 2888
2885 2889 ``command-templates``
2886 2890 ---------------------
2887 2891
2888 2892 Templates used for customizing the output of commands.
2889 2893
2890 2894 ``graphnode``
2891 2895 The template used to print changeset nodes in an ASCII revision graph.
2892 2896 (default: ``{graphnode}``)
2893 2897
2894 2898 ``log``
2895 2899 Template string for commands that print changesets.
2896 2900
2897 2901 ``mergemarker``
2898 2902 The template used to print the commit description next to each conflict
2899 2903 marker during merge conflicts. See :hg:`help templates` for the template
2900 2904 format.
2901 2905
2902 2906 Defaults to showing the hash, tags, branches, bookmarks, author, and
2903 2907 the first line of the commit description.
2904 2908
2905 2909 If you use non-ASCII characters in names for tags, branches, bookmarks,
2906 2910 authors, and/or commit descriptions, you must pay attention to encodings of
2907 2911 managed files. At template expansion, non-ASCII characters use the encoding
2908 2912 specified by the ``--encoding`` global option, ``HGENCODING`` or other
2909 2913 environment variables that govern your locale. If the encoding of the merge
2910 2914 markers is different from the encoding of the merged files,
2911 2915 serious problems may occur.
2912 2916
2913 2917 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
2914 2918
2915 2919 ``oneline-summary``
2916 2920 A template used by `hg rebase` and other commands for showing a one-line
2917 2921 summary of a commit. If the template configured here is longer than one
2918 2922 line, then only the first line is used.
2919 2923
2920 2924 The template can be overridden per command by defining a template in
2921 2925 `oneline-summary.<command>`, where `<command>` can be e.g. "rebase".
2922 2926
2923 2927 ``pre-merge-tool-output``
2924 2928 A template that is printed before executing an external merge tool. This can
2925 2929 be used to print out additional context that might be useful to have during
2926 2930 the conflict resolution, such as the description of the various commits
2927 2931 involved or bookmarks/tags.
2928 2932
2929 2933 Additional information is available in the ``local`, ``base``, and ``other``
2930 2934 dicts. For example: ``{local.label}``, ``{base.name}``, or
2931 2935 ``{other.islink}``.
2932 2936
2933 2937
2934 2938 ``web``
2935 2939 -------
2936 2940
2937 2941 Web interface configuration. The settings in this section apply to
2938 2942 both the builtin webserver (started by :hg:`serve`) and the script you
2939 2943 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
2940 2944 and WSGI).
2941 2945
2942 2946 The Mercurial webserver does no authentication (it does not prompt for
2943 2947 usernames and passwords to validate *who* users are), but it does do
2944 2948 authorization (it grants or denies access for *authenticated users*
2945 2949 based on settings in this section). You must either configure your
2946 2950 webserver to do authentication for you, or disable the authorization
2947 2951 checks.
2948 2952
2949 2953 For a quick setup in a trusted environment, e.g., a private LAN, where
2950 2954 you want it to accept pushes from anybody, you can use the following
2951 2955 command line::
2952 2956
2953 2957 $ hg --config web.allow-push=* --config web.push_ssl=False serve
2954 2958
2955 2959 Note that this will allow anybody to push anything to the server and
2956 2960 that this should not be used for public servers.
2957 2961
2958 2962 The full set of options is:
2959 2963
2960 2964 ``accesslog``
2961 2965 Where to output the access log. (default: stdout)
2962 2966
2963 2967 ``address``
2964 2968 Interface address to bind to. (default: all)
2965 2969
2966 2970 ``allow-archive``
2967 2971 List of archive format (bz2, gz, zip) allowed for downloading.
2968 2972 (default: empty)
2969 2973
2970 2974 ``allowbz2``
2971 2975 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
2972 2976 revisions.
2973 2977 (default: False)
2974 2978
2975 2979 ``allowgz``
2976 2980 (DEPRECATED) Whether to allow .tar.gz downloading of repository
2977 2981 revisions.
2978 2982 (default: False)
2979 2983
2980 2984 ``allow-pull``
2981 2985 Whether to allow pulling from the repository. (default: True)
2982 2986
2983 2987 ``allow-push``
2984 2988 Whether to allow pushing to the repository. If empty or not set,
2985 2989 pushing is not allowed. If the special value ``*``, any remote
2986 2990 user can push, including unauthenticated users. Otherwise, the
2987 2991 remote user must have been authenticated, and the authenticated
2988 2992 user name must be present in this list. The contents of the
2989 2993 allow-push list are examined after the deny_push list.
2990 2994
2991 2995 ``allow_read``
2992 2996 If the user has not already been denied repository access due to
2993 2997 the contents of deny_read, this list determines whether to grant
2994 2998 repository access to the user. If this list is not empty, and the
2995 2999 user is unauthenticated or not present in the list, then access is
2996 3000 denied for the user. If the list is empty or not set, then access
2997 3001 is permitted to all users by default. Setting allow_read to the
2998 3002 special value ``*`` is equivalent to it not being set (i.e. access
2999 3003 is permitted to all users). The contents of the allow_read list are
3000 3004 examined after the deny_read list.
3001 3005
3002 3006 ``allowzip``
3003 3007 (DEPRECATED) Whether to allow .zip downloading of repository
3004 3008 revisions. This feature creates temporary files.
3005 3009 (default: False)
3006 3010
3007 3011 ``archivesubrepos``
3008 3012 Whether to recurse into subrepositories when archiving.
3009 3013 (default: False)
3010 3014
3011 3015 ``baseurl``
3012 3016 Base URL to use when publishing URLs in other locations, so
3013 3017 third-party tools like email notification hooks can construct
3014 3018 URLs. Example: ``http://hgserver/repos/``.
3015 3019
3016 3020 ``cacerts``
3017 3021 Path to file containing a list of PEM encoded certificate
3018 3022 authority certificates. Environment variables and ``~user``
3019 3023 constructs are expanded in the filename. If specified on the
3020 3024 client, then it will verify the identity of remote HTTPS servers
3021 3025 with these certificates.
3022 3026
3023 3027 To disable SSL verification temporarily, specify ``--insecure`` from
3024 3028 command line.
3025 3029
3026 3030 You can use OpenSSL's CA certificate file if your platform has
3027 3031 one. On most Linux systems this will be
3028 3032 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
3029 3033 generate this file manually. The form must be as follows::
3030 3034
3031 3035 -----BEGIN CERTIFICATE-----
3032 3036 ... (certificate in base64 PEM encoding) ...
3033 3037 -----END CERTIFICATE-----
3034 3038 -----BEGIN CERTIFICATE-----
3035 3039 ... (certificate in base64 PEM encoding) ...
3036 3040 -----END CERTIFICATE-----
3037 3041
3038 3042 ``cache``
3039 3043 Whether to support caching in hgweb. (default: True)
3040 3044
3041 3045 ``certificate``
3042 3046 Certificate to use when running :hg:`serve`.
3043 3047
3044 3048 ``collapse``
3045 3049 With ``descend`` enabled, repositories in subdirectories are shown at
3046 3050 a single level alongside repositories in the current path. With
3047 3051 ``collapse`` also enabled, repositories residing at a deeper level than
3048 3052 the current path are grouped behind navigable directory entries that
3049 3053 lead to the locations of these repositories. In effect, this setting
3050 3054 collapses each collection of repositories found within a subdirectory
3051 3055 into a single entry for that subdirectory. (default: False)
3052 3056
3053 3057 ``comparisoncontext``
3054 3058 Number of lines of context to show in side-by-side file comparison. If
3055 3059 negative or the value ``full``, whole files are shown. (default: 5)
3056 3060
3057 3061 This setting can be overridden by a ``context`` request parameter to the
3058 3062 ``comparison`` command, taking the same values.
3059 3063
3060 3064 ``contact``
3061 3065 Name or email address of the person in charge of the repository.
3062 3066 (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
3063 3067
3064 3068 ``csp``
3065 3069 Send a ``Content-Security-Policy`` HTTP header with this value.
3066 3070
3067 3071 The value may contain a special string ``%nonce%``, which will be replaced
3068 3072 by a randomly-generated one-time use value. If the value contains
3069 3073 ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
3070 3074 one-time property of the nonce. This nonce will also be inserted into
3071 3075 ``<script>`` elements containing inline JavaScript.
3072 3076
3073 3077 Note: lots of HTML content sent by the server is derived from repository
3074 3078 data. Please consider the potential for malicious repository data to
3075 3079 "inject" itself into generated HTML content as part of your security
3076 3080 threat model.
3077 3081
3078 3082 ``deny_push``
3079 3083 Whether to deny pushing to the repository. If empty or not set,
3080 3084 push is not denied. If the special value ``*``, all remote users are
3081 3085 denied push. Otherwise, unauthenticated users are all denied, and
3082 3086 any authenticated user name present in this list is also denied. The
3083 3087 contents of the deny_push list are examined before the allow-push list.
3084 3088
3085 3089 ``deny_read``
3086 3090 Whether to deny reading/viewing of the repository. If this list is
3087 3091 not empty, unauthenticated users are all denied, and any
3088 3092 authenticated user name present in this list is also denied access to
3089 3093 the repository. If set to the special value ``*``, all remote users
3090 3094 are denied access (rarely needed ;). If deny_read is empty or not set,
3091 3095 the determination of repository access depends on the presence and
3092 3096 content of the allow_read list (see description). If both
3093 3097 deny_read and allow_read are empty or not set, then access is
3094 3098 permitted to all users by default. If the repository is being
3095 3099 served via hgwebdir, denied users will not be able to see it in
3096 3100 the list of repositories. The contents of the deny_read list have
3097 3101 priority over (are examined before) the contents of the allow_read
3098 3102 list.
3099 3103
3100 3104 ``descend``
3101 3105 hgwebdir indexes will not descend into subdirectories. Only repositories
3102 3106 directly in the current path will be shown (other repositories are still
3103 3107 available from the index corresponding to their containing path).
3104 3108
3105 3109 ``description``
3106 3110 Textual description of the repository's purpose or contents.
3107 3111 (default: "unknown")
3108 3112
3109 3113 ``encoding``
3110 3114 Character encoding name. (default: the current locale charset)
3111 3115 Example: "UTF-8".
3112 3116
3113 3117 ``errorlog``
3114 3118 Where to output the error log. (default: stderr)
3115 3119
3116 3120 ``guessmime``
3117 3121 Control MIME types for raw download of file content.
3118 3122 Set to True to let hgweb guess the content type from the file
3119 3123 extension. This will serve HTML files as ``text/html`` and might
3120 3124 allow cross-site scripting attacks when serving untrusted
3121 3125 repositories. (default: False)
3122 3126
3123 3127 ``hidden``
3124 3128 Whether to hide the repository in the hgwebdir index.
3125 3129 (default: False)
3126 3130
3127 3131 ``ipv6``
3128 3132 Whether to use IPv6. (default: False)
3129 3133
3130 3134 ``labels``
3131 3135 List of string *labels* associated with the repository.
3132 3136
3133 3137 Labels are exposed as a template keyword and can be used to customize
3134 3138 output. e.g. the ``index`` template can group or filter repositories
3135 3139 by labels and the ``summary`` template can display additional content
3136 3140 if a specific label is present.
3137 3141
3138 3142 ``logoimg``
3139 3143 File name of the logo image that some templates display on each page.
3140 3144 The file name is relative to ``staticurl``. That is, the full path to
3141 3145 the logo image is "staticurl/logoimg".
3142 3146 If unset, ``hglogo.png`` will be used.
3143 3147
3144 3148 ``logourl``
3145 3149 Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
3146 3150 will be used.
3147 3151
3148 3152 ``maxchanges``
3149 3153 Maximum number of changes to list on the changelog. (default: 10)
3150 3154
3151 3155 ``maxfiles``
3152 3156 Maximum number of files to list per changeset. (default: 10)
3153 3157
3154 3158 ``maxshortchanges``
3155 3159 Maximum number of changes to list on the shortlog, graph or filelog
3156 3160 pages. (default: 60)
3157 3161
3158 3162 ``name``
3159 3163 Repository name to use in the web interface.
3160 3164 (default: current working directory)
3161 3165
3162 3166 ``port``
3163 3167 Port to listen on. (default: 8000)
3164 3168
3165 3169 ``prefix``
3166 3170 Prefix path to serve from. (default: '' (server root))
3167 3171
3168 3172 ``push_ssl``
3169 3173 Whether to require that inbound pushes be transported over SSL to
3170 3174 prevent password sniffing. (default: True)
3171 3175
3172 3176 ``refreshinterval``
3173 3177 How frequently directory listings re-scan the filesystem for new
3174 3178 repositories, in seconds. This is relevant when wildcards are used
3175 3179 to define paths. Depending on how much filesystem traversal is
3176 3180 required, refreshing may negatively impact performance.
3177 3181
3178 3182 Values less than or equal to 0 always refresh.
3179 3183 (default: 20)
3180 3184
3181 3185 ``server-header``
3182 3186 Value for HTTP ``Server`` response header.
3183 3187
3184 3188 ``static``
3185 3189 Directory where static files are served from.
3186 3190
3187 3191 ``staticurl``
3188 3192 Base URL to use for static files. If unset, static files (e.g. the
3189 3193 hgicon.png favicon) will be served by the CGI script itself. Use
3190 3194 this setting to serve them directly with the HTTP server.
3191 3195 Example: ``http://hgserver/static/``.
3192 3196
3193 3197 ``stripes``
3194 3198 How many lines a "zebra stripe" should span in multi-line output.
3195 3199 Set to 0 to disable. (default: 1)
3196 3200
3197 3201 ``style``
3198 3202 Which template map style to use. The available options are the names of
3199 3203 subdirectories in the HTML templates path. (default: ``paper``)
3200 3204 Example: ``monoblue``.
3201 3205
3202 3206 ``templates``
3203 3207 Where to find the HTML templates. The default path to the HTML templates
3204 3208 can be obtained from ``hg debuginstall``.
3205 3209
3206 3210 ``websub``
3207 3211 ----------
3208 3212
3209 3213 Web substitution filter definition. You can use this section to
3210 3214 define a set of regular expression substitution patterns which
3211 3215 let you automatically modify the hgweb server output.
3212 3216
3213 3217 The default hgweb templates only apply these substitution patterns
3214 3218 on the revision description fields. You can apply them anywhere
3215 3219 you want when you create your own templates by adding calls to the
3216 3220 "websub" filter (usually after calling the "escape" filter).
3217 3221
3218 3222 This can be used, for example, to convert issue references to links
3219 3223 to your issue tracker, or to convert "markdown-like" syntax into
3220 3224 HTML (see the examples below).
3221 3225
3222 3226 Each entry in this section names a substitution filter.
3223 3227 The value of each entry defines the substitution expression itself.
3224 3228 The websub expressions follow the old interhg extension syntax,
3225 3229 which in turn imitates the Unix sed replacement syntax::
3226 3230
3227 3231 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
3228 3232
3229 3233 You can use any separator other than "/". The final "i" is optional
3230 3234 and indicates that the search must be case insensitive.
3231 3235
3232 3236 Examples::
3233 3237
3234 3238 [websub]
3235 3239 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
3236 3240 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
3237 3241 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
3238 3242
3239 3243 ``worker``
3240 3244 ----------
3241 3245
3242 3246 Parallel master/worker configuration. We currently perform working
3243 3247 directory updates in parallel on Unix-like systems, which greatly
3244 3248 helps performance.
3245 3249
3246 3250 ``enabled``
3247 3251 Whether to enable workers code to be used.
3248 3252 (default: true)
3249 3253
3250 3254 ``numcpus``
3251 3255 Number of CPUs to use for parallel operations. A zero or
3252 3256 negative value is treated as ``use the default``.
3253 3257 (default: 4 or the number of CPUs on the system, whichever is larger)
3254 3258
3255 3259 ``backgroundclose``
3256 3260 Whether to enable closing file handles on background threads during certain
3257 3261 operations. Some platforms aren't very efficient at closing file
3258 3262 handles that have been written or appended to. By performing file closing
3259 3263 on background threads, file write rate can increase substantially.
3260 3264 (default: true on Windows, false elsewhere)
3261 3265
3262 3266 ``backgroundcloseminfilecount``
3263 3267 Minimum number of files required to trigger background file closing.
3264 3268 Operations not writing this many files won't start background close
3265 3269 threads.
3266 3270 (default: 2048)
3267 3271
3268 3272 ``backgroundclosemaxqueue``
3269 3273 The maximum number of opened file handles waiting to be closed in the
3270 3274 background. This option only has an effect if ``backgroundclose`` is
3271 3275 enabled.
3272 3276 (default: 384)
3273 3277
3274 3278 ``backgroundclosethreadcount``
3275 3279 Number of threads to process background file closes. Only relevant if
3276 3280 ``backgroundclose`` is enabled.
3277 3281 (default: 4)
@@ -1,250 +1,254
1 1 # upgrade.py - functions for automatic upgrade of Mercurial repository
2 2 #
3 3 # Copyright (c) 2022-present, Pierre-Yves David
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7 from ..i18n import _
8 8
9 9 from .. import (
10 10 error,
11 11 requirements as requirementsmod,
12 12 scmutil,
13 13 )
14 14
15 15 from . import (
16 16 actions,
17 17 engine,
18 18 )
19 19
20 20
21 21 class AutoUpgradeOperation(actions.BaseOperation):
22 22 """A limited Upgrade Operation used to run simple auto upgrade task
23 23
24 24 (Expand it as needed in the future)
25 25 """
26 26
27 27 def __init__(self, req):
28 28 super().__init__(
29 29 new_requirements=req,
30 30 backup_store=False,
31 31 )
32 32
33 33
34 34 def get_share_safe_action(repo):
35 35 """return an automatic-upgrade action for `share-safe` if applicable
36 36
37 37 If no action is needed, return None, otherwise return a callback to upgrade
38 38 or downgrade the repository according the configuration and repository
39 39 format.
40 40 """
41 41 ui = repo.ui
42 42 requirements = repo.requirements
43 43 auto_upgrade_share_source = ui.configbool(
44 44 b'format',
45 45 b'use-share-safe.automatic-upgrade-of-mismatching-repositories',
46 46 )
47 47 auto_upgrade_quiet = ui.configbool(
48 48 b'format',
49 49 b'use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet',
50 50 )
51 51
52 52 action = None
53 53
54 54 if (
55 55 auto_upgrade_share_source
56 56 and requirementsmod.SHARED_REQUIREMENT not in requirements
57 57 ):
58 58 sf_config = ui.configbool(b'format', b'use-share-safe')
59 59 sf_local = requirementsmod.SHARESAFE_REQUIREMENT in requirements
60 60 if sf_config and not sf_local:
61 61 msg = _(
62 62 b"automatically upgrading repository to the `share-safe`"
63 63 b" feature\n"
64 64 )
65 65 hint = b"(see `hg help config.format.use-share-safe` for details)\n"
66 66
67 67 def action():
68 68 if not (ui.quiet or auto_upgrade_quiet):
69 69 ui.write_err(msg)
70 70 ui.write_err(hint)
71 71 requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
72 72 scmutil.writereporequirements(repo, requirements)
73 73
74 74 elif sf_local and not sf_config:
75 75 msg = _(
76 76 b"automatically downgrading repository from the `share-safe`"
77 77 b" feature\n"
78 78 )
79 79 hint = b"(see `hg help config.format.use-share-safe` for details)\n"
80 80
81 81 def action():
82 82 if not (ui.quiet or auto_upgrade_quiet):
83 83 ui.write_err(msg)
84 84 ui.write_err(hint)
85 85 requirements.discard(requirementsmod.SHARESAFE_REQUIREMENT)
86 86 scmutil.writereporequirements(repo, requirements)
87 87
88 88 return action
89 89
90 90
91 91 def get_tracked_hint_action(repo):
92 92 """return an automatic-upgrade action for `tracked-hint` if applicable
93 93
94 94 If no action is needed, return None, otherwise return a callback to upgrade
95 95 or downgrade the repository according the configuration and repository
96 96 format.
97 97 """
98 98 ui = repo.ui
99 99 requirements = set(repo.requirements)
100 100 auto_upgrade_tracked_hint = ui.configbool(
101 101 b'format',
102 102 b'use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories',
103 103 )
104 auto_upgrade_quiet = ui.configbool(
105 b'format',
106 b'use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet',
107 )
104 108
105 109 action = None
106 110
107 111 if auto_upgrade_tracked_hint:
108 112 th_config = ui.configbool(b'format', b'use-dirstate-tracked-hint')
109 113 th_local = requirementsmod.DIRSTATE_TRACKED_HINT_V1 in requirements
110 114 if th_config and not th_local:
111 115 msg = _(
112 116 b"automatically upgrading repository to the `tracked-hint`"
113 117 b" feature\n"
114 118 )
115 119 hint = b"(see `hg help config.format.use-dirstate-tracked-hint` for details)\n"
116 120
117 121 def action():
118 if not ui.quiet:
122 if not (ui.quiet or auto_upgrade_quiet):
119 123 ui.write_err(msg)
120 124 ui.write_err(hint)
121 125 requirements.add(requirementsmod.DIRSTATE_TRACKED_HINT_V1)
122 126 op = AutoUpgradeOperation(requirements)
123 127 engine.upgrade_tracked_hint(ui, repo, op, add=True)
124 128
125 129 elif th_local and not th_config:
126 130 msg = _(
127 131 b"automatically downgrading repository from the `tracked-hint`"
128 132 b" feature\n"
129 133 )
130 134 hint = b"(see `hg help config.format.use-dirstate-tracked-hint` for details)\n"
131 135
132 136 def action():
133 if not ui.quiet:
137 if not (ui.quiet or auto_upgrade_quiet):
134 138 ui.write_err(msg)
135 139 ui.write_err(hint)
136 140 requirements.discard(requirementsmod.DIRSTATE_TRACKED_HINT_V1)
137 141 op = AutoUpgradeOperation(requirements)
138 142 engine.upgrade_tracked_hint(ui, repo, op, add=False)
139 143
140 144 return action
141 145
142 146
143 147 def get_dirstate_v2_action(repo):
144 148 """return an automatic-upgrade action for `dirstate-v2` if applicable
145 149
146 150 If no action is needed, return None, otherwise return a callback to upgrade
147 151 or downgrade the repository according the configuration and repository
148 152 format.
149 153 """
150 154 ui = repo.ui
151 155 requirements = set(repo.requirements)
152 156 auto_upgrade_dv2 = ui.configbool(
153 157 b'format',
154 158 b'use-dirstate-v2.automatic-upgrade-of-mismatching-repositories',
155 159 )
156 160 auto_upgrade_dv2_quiet = ui.configbool(
157 161 b'format',
158 162 b'use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet',
159 163 )
160 164
161 165 action = None
162 166
163 167 if auto_upgrade_dv2:
164 168 d2_config = ui.configbool(b'format', b'use-dirstate-v2')
165 169 d2_local = requirementsmod.DIRSTATE_V2_REQUIREMENT in requirements
166 170 if d2_config and not d2_local:
167 171 msg = _(
168 172 b"automatically upgrading repository to the `dirstate-v2`"
169 173 b" feature\n"
170 174 )
171 175 hint = (
172 176 b"(see `hg help config.format.use-dirstate-v2` for details)\n"
173 177 )
174 178
175 179 def action():
176 180 if not (ui.quiet or auto_upgrade_dv2_quiet):
177 181 ui.write_err(msg)
178 182 ui.write_err(hint)
179 183 requirements.add(requirementsmod.DIRSTATE_V2_REQUIREMENT)
180 184 fake_op = AutoUpgradeOperation(requirements)
181 185 engine.upgrade_dirstate(repo.ui, repo, fake_op, b'v1', b'v2')
182 186
183 187 elif d2_local and not d2_config:
184 188 msg = _(
185 189 b"automatically downgrading repository from the `dirstate-v2`"
186 190 b" feature\n"
187 191 )
188 192 hint = (
189 193 b"(see `hg help config.format.use-dirstate-v2` for details)\n"
190 194 )
191 195
192 196 def action():
193 197 if not (ui.quiet or auto_upgrade_dv2_quiet):
194 198 ui.write_err(msg)
195 199 ui.write_err(hint)
196 200 requirements.discard(requirementsmod.DIRSTATE_V2_REQUIREMENT)
197 201 fake_op = AutoUpgradeOperation(requirements)
198 202 engine.upgrade_dirstate(repo.ui, repo, fake_op, b'v2', b'v1')
199 203
200 204 return action
201 205
202 206
203 207 AUTO_UPGRADE_ACTIONS = [
204 208 get_dirstate_v2_action,
205 209 get_share_safe_action,
206 210 get_tracked_hint_action,
207 211 ]
208 212
209 213
210 214 def may_auto_upgrade(repo, maker_func):
211 215 """potentially perform auto-upgrade and return the final repository to use
212 216
213 217 Auto-upgrade are "quick" repository upgrade that might automatically be run
214 218 by "any" repository access. See `hg help config.format` for automatic
215 219 upgrade documentation.
216 220
217 221 note: each relevant upgrades are done one after the other for simplicity.
218 222 This avoid having repository is partially inconsistent state while
219 223 upgrading.
220 224
221 225 repo: the current repository instance
222 226 maker_func: a factory function that can recreate a repository after an upgrade
223 227 """
224 228 clear = False
225 229
226 230 loop = 0
227 231
228 232 try:
229 233 while not clear:
230 234 loop += 1
231 235 if loop > 100:
232 236 # XXX basic protection against infinite loop, make it better.
233 237 raise error.ProgrammingError("Too many auto upgrade loops")
234 238 clear = True
235 239 for get_action in AUTO_UPGRADE_ACTIONS:
236 240 action = get_action(repo)
237 241 if action is not None:
238 242 clear = False
239 243 with repo.wlock(wait=False), repo.lock(wait=False):
240 244 action = get_action(repo)
241 245 if action is not None:
242 246 action()
243 247 repo = maker_func()
244 248 except error.LockError:
245 249 # if we cannot get the lock, ignore the auto-upgrade attemps and
246 250 # proceed. We might want to make this behavior configurable in the
247 251 # future.
248 252 pass
249 253
250 254 return repo
@@ -1,4070 +1,4072
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 manifest output the current or given revision of the project manifest
133 133 recover roll back an interrupted transaction
134 134 verify verify the integrity of the repository
135 135
136 136 Help:
137 137
138 138 config show combined config settings from all hgrc files
139 139 help show help for a given topic or a help overview
140 140 version output version and copyright information
141 141
142 142 additional help topics:
143 143
144 144 Mercurial identifiers:
145 145
146 146 filesets Specifying File Sets
147 147 hgignore Syntax for Mercurial Ignore Files
148 148 patterns File Name Patterns
149 149 revisions Specifying Revisions
150 150 urls URL Paths
151 151
152 152 Mercurial output:
153 153
154 154 color Colorizing Outputs
155 155 dates Date Formats
156 156 diffs Diff Formats
157 157 templating Template Usage
158 158
159 159 Mercurial configuration:
160 160
161 161 config Configuration Files
162 162 environment Environment Variables
163 163 extensions Using Additional Features
164 164 flags Command-line flags
165 165 hgweb Configuring hgweb
166 166 merge-tools Merge Tools
167 167 pager Pager Support
168 168 rust Rust in Mercurial
169 169
170 170 Concepts:
171 171
172 172 bundlespec Bundle File Formats
173 173 evolution Safely rewriting history (EXPERIMENTAL)
174 174 glossary Glossary
175 175 phases Working with Phases
176 176 subrepos Subrepositories
177 177
178 178 Miscellaneous:
179 179
180 180 deprecated Deprecated Features
181 181 internals Technical implementation topics
182 182 scripting Using Mercurial from scripts and automation
183 183
184 184 (use 'hg help -v' to show built-in aliases and global options)
185 185
186 186 $ hg -q help
187 187 Repository creation:
188 188
189 189 clone make a copy of an existing repository
190 190 init create a new repository in the given directory
191 191
192 192 Remote repository management:
193 193
194 194 incoming show new changesets found in source
195 195 outgoing show changesets not found in the destination
196 196 paths show aliases for remote repositories
197 197 pull pull changes from the specified source
198 198 push push changes to the specified destination
199 199 serve start stand-alone webserver
200 200
201 201 Change creation:
202 202
203 203 commit commit the specified files or all outstanding changes
204 204
205 205 Change manipulation:
206 206
207 207 backout reverse effect of earlier changeset
208 208 graft copy changes from other branches onto the current branch
209 209 merge merge another revision into working directory
210 210
211 211 Change organization:
212 212
213 213 bookmarks create a new bookmark or list existing bookmarks
214 214 branch set or show the current branch name
215 215 branches list repository named branches
216 216 phase set or show the current phase name
217 217 tag add one or more tags for the current or given revision
218 218 tags list repository tags
219 219
220 220 File content management:
221 221
222 222 annotate show changeset information by line for each file
223 223 cat output the current or given revision of files
224 224 copy mark files as copied for the next commit
225 225 diff diff repository (or selected files)
226 226 grep search for a pattern in specified files
227 227
228 228 Change navigation:
229 229
230 230 bisect subdivision search of changesets
231 231 heads show branch heads
232 232 identify identify the working directory or specified revision
233 233 log show revision history of entire repository or files
234 234
235 235 Working directory management:
236 236
237 237 add add the specified files on the next commit
238 238 addremove add all new files, delete all missing files
239 239 files list tracked files
240 240 forget forget the specified files on the next commit
241 241 purge removes files not tracked by Mercurial
242 242 remove remove the specified files on the next commit
243 243 rename rename files; equivalent of copy + remove
244 244 resolve redo merges or set/view the merge status of files
245 245 revert restore files to their checkout state
246 246 root print the root (top) of the current working directory
247 247 shelve save and set aside changes from the working directory
248 248 status show changed files in the working directory
249 249 summary summarize working directory state
250 250 unshelve restore a shelved change to the working directory
251 251 update update working directory (or switch revisions)
252 252
253 253 Change import/export:
254 254
255 255 archive create an unversioned archive of a repository revision
256 256 bundle create a bundle file
257 257 export dump the header and diffs for one or more changesets
258 258 import import an ordered set of patches
259 259 unbundle apply one or more bundle files
260 260
261 261 Repository maintenance:
262 262
263 263 manifest output the current or given revision of the project manifest
264 264 recover roll back an interrupted transaction
265 265 verify verify the integrity of the repository
266 266
267 267 Help:
268 268
269 269 config show combined config settings from all hgrc files
270 270 help show help for a given topic or a help overview
271 271 version output version and copyright information
272 272
273 273 additional help topics:
274 274
275 275 Mercurial identifiers:
276 276
277 277 filesets Specifying File Sets
278 278 hgignore Syntax for Mercurial Ignore Files
279 279 patterns File Name Patterns
280 280 revisions Specifying Revisions
281 281 urls URL Paths
282 282
283 283 Mercurial output:
284 284
285 285 color Colorizing Outputs
286 286 dates Date Formats
287 287 diffs Diff Formats
288 288 templating Template Usage
289 289
290 290 Mercurial configuration:
291 291
292 292 config Configuration Files
293 293 environment Environment Variables
294 294 extensions Using Additional Features
295 295 flags Command-line flags
296 296 hgweb Configuring hgweb
297 297 merge-tools Merge Tools
298 298 pager Pager Support
299 299 rust Rust in Mercurial
300 300
301 301 Concepts:
302 302
303 303 bundlespec Bundle File Formats
304 304 evolution Safely rewriting history (EXPERIMENTAL)
305 305 glossary Glossary
306 306 phases Working with Phases
307 307 subrepos Subrepositories
308 308
309 309 Miscellaneous:
310 310
311 311 deprecated Deprecated Features
312 312 internals Technical implementation topics
313 313 scripting Using Mercurial from scripts and automation
314 314
315 315 Test extension help:
316 316 $ hg help extensions --config extensions.rebase= --config extensions.children=
317 317 Using Additional Features
318 318 """""""""""""""""""""""""
319 319
320 320 Mercurial has the ability to add new features through the use of
321 321 extensions. Extensions may add new commands, add options to existing
322 322 commands, change the default behavior of commands, or implement hooks.
323 323
324 324 To enable the "foo" extension, either shipped with Mercurial or in the
325 325 Python search path, create an entry for it in your configuration file,
326 326 like this:
327 327
328 328 [extensions]
329 329 foo =
330 330
331 331 You may also specify the full path to an extension:
332 332
333 333 [extensions]
334 334 myfeature = ~/.hgext/myfeature.py
335 335
336 336 See 'hg help config' for more information on configuration files.
337 337
338 338 Extensions are not loaded by default for a variety of reasons: they can
339 339 increase startup overhead; they may be meant for advanced usage only; they
340 340 may provide potentially dangerous abilities (such as letting you destroy
341 341 or modify history); they might not be ready for prime time; or they may
342 342 alter some usual behaviors of stock Mercurial. It is thus up to the user
343 343 to activate extensions as needed.
344 344
345 345 To explicitly disable an extension enabled in a configuration file of
346 346 broader scope, prepend its path with !:
347 347
348 348 [extensions]
349 349 # disabling extension bar residing in /path/to/extension/bar.py
350 350 bar = !/path/to/extension/bar.py
351 351 # ditto, but no path was supplied for extension baz
352 352 baz = !
353 353
354 354 enabled extensions:
355 355
356 356 children command to display child changesets (DEPRECATED)
357 357 rebase command to move sets of revisions to a different ancestor
358 358
359 359 disabled extensions:
360 360
361 361 acl hooks for controlling repository access
362 362 blackbox log repository events to a blackbox for debugging
363 363 bugzilla hooks for integrating with the Bugzilla bug tracker
364 364 censor erase file content at a given revision
365 365 churn command to display statistics about repository history
366 366 clonebundles advertise pre-generated bundles to seed clones
367 367 closehead close arbitrary heads without checking them out first
368 368 convert import revisions from foreign VCS repositories into
369 369 Mercurial
370 370 eol automatically manage newlines in repository files
371 371 extdiff command to allow external programs to compare revisions
372 372 factotum http authentication with factotum
373 373 fastexport export repositories as git fast-import stream
374 374 githelp try mapping git commands to Mercurial commands
375 375 gpg commands to sign and verify changesets
376 376 hgk browse the repository in a graphical way
377 377 highlight syntax highlighting for hgweb (requires Pygments)
378 378 histedit interactive history editing
379 379 keyword expand keywords in tracked files
380 380 largefiles track large binary files
381 381 mq manage a stack of patches
382 382 notify hooks for sending email push notifications
383 383 patchbomb command to send changesets as (a series of) patch emails
384 384 relink recreates hardlinks between repository clones
385 385 schemes extend schemes with shortcuts to repository swarms
386 386 share share a common history between several working directories
387 387 transplant command to transplant changesets from another branch
388 388 win32mbcs allow the use of MBCS paths with problematic encodings
389 389 zeroconf discover and advertise repositories on the local network
390 390
391 391 #endif
392 392
393 393 Verify that deprecated extensions are included if --verbose:
394 394
395 395 $ hg -v help extensions | grep children
396 396 children command to display child changesets (DEPRECATED)
397 397
398 398 Verify that extension keywords appear in help templates
399 399
400 400 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
401 401
402 402 Test short command list with verbose option
403 403
404 404 $ hg -v help shortlist
405 405 Mercurial Distributed SCM
406 406
407 407 basic commands:
408 408
409 409 abort abort an unfinished operation (EXPERIMENTAL)
410 410 add add the specified files on the next commit
411 411 annotate, blame
412 412 show changeset information by line for each file
413 413 clone make a copy of an existing repository
414 414 commit, ci commit the specified files or all outstanding changes
415 415 continue resumes an interrupted operation (EXPERIMENTAL)
416 416 diff diff repository (or selected files)
417 417 export dump the header and diffs for one or more changesets
418 418 forget forget the specified files on the next commit
419 419 init create a new repository in the given directory
420 420 log, history show revision history of entire repository or files
421 421 merge merge another revision into working directory
422 422 pull pull changes from the specified source
423 423 push push changes to the specified destination
424 424 remove, rm remove the specified files on the next commit
425 425 serve start stand-alone webserver
426 426 status, st show changed files in the working directory
427 427 summary, sum summarize working directory state
428 428 update, up, checkout, co
429 429 update working directory (or switch revisions)
430 430
431 431 global options ([+] can be repeated):
432 432
433 433 -R --repository REPO repository root directory or name of overlay bundle
434 434 file
435 435 --cwd DIR change working directory
436 436 -y --noninteractive do not prompt, automatically pick the first choice for
437 437 all prompts
438 438 -q --quiet suppress output
439 439 -v --verbose enable additional output
440 440 --color TYPE when to colorize (boolean, always, auto, never, or
441 441 debug)
442 442 --config CONFIG [+] set/override config option (use 'section.name=value')
443 443 --debug enable debugging output
444 444 --debugger start debugger
445 445 --encoding ENCODE set the charset encoding (default: ascii)
446 446 --encodingmode MODE set the charset encoding mode (default: strict)
447 447 --traceback always print a traceback on exception
448 448 --time time how long the command takes
449 449 --profile print command execution profile
450 450 --version output version information and exit
451 451 -h --help display help and exit
452 452 --hidden consider hidden changesets
453 453 --pager TYPE when to paginate (boolean, always, auto, or never)
454 454 (default: auto)
455 455
456 456 (use 'hg help' for the full list of commands)
457 457
458 458 $ hg add -h
459 459 hg add [OPTION]... [FILE]...
460 460
461 461 add the specified files on the next commit
462 462
463 463 Schedule files to be version controlled and added to the repository.
464 464
465 465 The files will be added to the repository at the next commit. To undo an
466 466 add before that, see 'hg forget'.
467 467
468 468 If no names are given, add all files to the repository (except files
469 469 matching ".hgignore").
470 470
471 471 Returns 0 if all files are successfully added.
472 472
473 473 options ([+] can be repeated):
474 474
475 475 -I --include PATTERN [+] include names matching the given patterns
476 476 -X --exclude PATTERN [+] exclude names matching the given patterns
477 477 -S --subrepos recurse into subrepositories
478 478 -n --dry-run do not perform actions, just print output
479 479
480 480 (some details hidden, use --verbose to show complete help)
481 481
482 482 Verbose help for add
483 483
484 484 $ hg add -hv
485 485 hg add [OPTION]... [FILE]...
486 486
487 487 add the specified files on the next commit
488 488
489 489 Schedule files to be version controlled and added to the repository.
490 490
491 491 The files will be added to the repository at the next commit. To undo an
492 492 add before that, see 'hg forget'.
493 493
494 494 If no names are given, add all files to the repository (except files
495 495 matching ".hgignore").
496 496
497 497 Examples:
498 498
499 499 - New (unknown) files are added automatically by 'hg add':
500 500
501 501 $ ls
502 502 foo.c
503 503 $ hg status
504 504 ? foo.c
505 505 $ hg add
506 506 adding foo.c
507 507 $ hg status
508 508 A foo.c
509 509
510 510 - Specific files to be added can be specified:
511 511
512 512 $ ls
513 513 bar.c foo.c
514 514 $ hg status
515 515 ? bar.c
516 516 ? foo.c
517 517 $ hg add bar.c
518 518 $ hg status
519 519 A bar.c
520 520 ? foo.c
521 521
522 522 Returns 0 if all files are successfully added.
523 523
524 524 options ([+] can be repeated):
525 525
526 526 -I --include PATTERN [+] include names matching the given patterns
527 527 -X --exclude PATTERN [+] exclude names matching the given patterns
528 528 -S --subrepos recurse into subrepositories
529 529 -n --dry-run do not perform actions, just print output
530 530
531 531 global options ([+] can be repeated):
532 532
533 533 -R --repository REPO repository root directory or name of overlay bundle
534 534 file
535 535 --cwd DIR change working directory
536 536 -y --noninteractive do not prompt, automatically pick the first choice for
537 537 all prompts
538 538 -q --quiet suppress output
539 539 -v --verbose enable additional output
540 540 --color TYPE when to colorize (boolean, always, auto, never, or
541 541 debug)
542 542 --config CONFIG [+] set/override config option (use 'section.name=value')
543 543 --debug enable debugging output
544 544 --debugger start debugger
545 545 --encoding ENCODE set the charset encoding (default: ascii)
546 546 --encodingmode MODE set the charset encoding mode (default: strict)
547 547 --traceback always print a traceback on exception
548 548 --time time how long the command takes
549 549 --profile print command execution profile
550 550 --version output version information and exit
551 551 -h --help display help and exit
552 552 --hidden consider hidden changesets
553 553 --pager TYPE when to paginate (boolean, always, auto, or never)
554 554 (default: auto)
555 555
556 556 Test the textwidth config option
557 557
558 558 $ hg root -h --config ui.textwidth=50
559 559 hg root
560 560
561 561 print the root (top) of the current working
562 562 directory
563 563
564 564 Print the root directory of the current
565 565 repository.
566 566
567 567 Returns 0 on success.
568 568
569 569 options:
570 570
571 571 -T --template TEMPLATE display with template
572 572
573 573 (some details hidden, use --verbose to show
574 574 complete help)
575 575
576 576 Test help option with version option
577 577
578 578 $ hg add -h --version
579 579 Mercurial Distributed SCM (version *) (glob)
580 580 (see https://mercurial-scm.org for more information)
581 581
582 582 Copyright (C) 2005-* Olivia Mackall and others (glob)
583 583 This is free software; see the source for copying conditions. There is NO
584 584 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
585 585
586 586 $ hg add --skjdfks
587 587 hg add: option --skjdfks not recognized
588 588 hg add [OPTION]... [FILE]...
589 589
590 590 add the specified files on the next commit
591 591
592 592 options ([+] can be repeated):
593 593
594 594 -I --include PATTERN [+] include names matching the given patterns
595 595 -X --exclude PATTERN [+] exclude names matching the given patterns
596 596 -S --subrepos recurse into subrepositories
597 597 -n --dry-run do not perform actions, just print output
598 598
599 599 (use 'hg add -h' to show more help)
600 600 [10]
601 601
602 602 Test ambiguous command help
603 603
604 604 $ hg help ad
605 605 list of commands:
606 606
607 607 add add the specified files on the next commit
608 608 addremove add all new files, delete all missing files
609 609
610 610 (use 'hg help -v ad' to show built-in aliases and global options)
611 611
612 612 Test command without options
613 613
614 614 $ hg help verify
615 615 hg verify
616 616
617 617 verify the integrity of the repository
618 618
619 619 Verify the integrity of the current repository.
620 620
621 621 This will perform an extensive check of the repository's integrity,
622 622 validating the hashes and checksums of each entry in the changelog,
623 623 manifest, and tracked files, as well as the integrity of their crosslinks
624 624 and indices.
625 625
626 626 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
627 627 information about recovery from corruption of the repository.
628 628
629 629 Returns 0 on success, 1 if errors are encountered.
630 630
631 631 options:
632 632
633 633 (some details hidden, use --verbose to show complete help)
634 634
635 635 $ hg help diff
636 636 hg diff [OPTION]... ([-c REV] | [--from REV1] [--to REV2]) [FILE]...
637 637
638 638 diff repository (or selected files)
639 639
640 640 Show differences between revisions for the specified files.
641 641
642 642 Differences between files are shown using the unified diff format.
643 643
644 644 Note:
645 645 'hg diff' may generate unexpected results for merges, as it will
646 646 default to comparing against the working directory's first parent
647 647 changeset if no revisions are specified. To diff against the conflict
648 648 regions, you can use '--config diff.merge=yes'.
649 649
650 650 By default, the working directory files are compared to its first parent.
651 651 To see the differences from another revision, use --from. To see the
652 652 difference to another revision, use --to. For example, 'hg diff --from .^'
653 653 will show the differences from the working copy's grandparent to the
654 654 working copy, 'hg diff --to .' will show the diff from the working copy to
655 655 its parent (i.e. the reverse of the default), and 'hg diff --from 1.0 --to
656 656 1.2' will show the diff between those two revisions.
657 657
658 658 Alternatively you can specify -c/--change with a revision to see the
659 659 changes in that changeset relative to its first parent (i.e. 'hg diff -c
660 660 42' is equivalent to 'hg diff --from 42^ --to 42')
661 661
662 662 Without the -a/--text option, diff will avoid generating diffs of files it
663 663 detects as binary. With -a, diff will generate a diff anyway, probably
664 664 with undesirable results.
665 665
666 666 Use the -g/--git option to generate diffs in the git extended diff format.
667 667 For more information, read 'hg help diffs'.
668 668
669 669 Returns 0 on success.
670 670
671 671 options ([+] can be repeated):
672 672
673 673 --from REV1 revision to diff from
674 674 --to REV2 revision to diff to
675 675 -c --change REV change made by revision
676 676 -a --text treat all files as text
677 677 -g --git use git extended diff format
678 678 --binary generate binary diffs in git mode (default)
679 679 --nodates omit dates from diff headers
680 680 --noprefix omit a/ and b/ prefixes from filenames
681 681 -p --show-function show which function each change is in
682 682 --reverse produce a diff that undoes the changes
683 683 -w --ignore-all-space ignore white space when comparing lines
684 684 -b --ignore-space-change ignore changes in the amount of white space
685 685 -B --ignore-blank-lines ignore changes whose lines are all blank
686 686 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
687 687 -U --unified NUM number of lines of context to show
688 688 --stat output diffstat-style summary of changes
689 689 --root DIR produce diffs relative to subdirectory
690 690 -I --include PATTERN [+] include names matching the given patterns
691 691 -X --exclude PATTERN [+] exclude names matching the given patterns
692 692 -S --subrepos recurse into subrepositories
693 693
694 694 (some details hidden, use --verbose to show complete help)
695 695
696 696 $ hg help status
697 697 hg status [OPTION]... [FILE]...
698 698
699 699 aliases: st
700 700
701 701 show changed files in the working directory
702 702
703 703 Show status of files in the repository. If names are given, only files
704 704 that match are shown. Files that are clean or ignored or the source of a
705 705 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
706 706 -C/--copies or -A/--all are given. Unless options described with "show
707 707 only ..." are given, the options -mardu are used.
708 708
709 709 Option -q/--quiet hides untracked (unknown and ignored) files unless
710 710 explicitly requested with -u/--unknown or -i/--ignored.
711 711
712 712 Note:
713 713 'hg status' may appear to disagree with diff if permissions have
714 714 changed or a merge has occurred. The standard diff format does not
715 715 report permission changes and diff only reports changes relative to one
716 716 merge parent.
717 717
718 718 If one revision is given, it is used as the base revision. If two
719 719 revisions are given, the differences between them are shown. The --change
720 720 option can also be used as a shortcut to list the changed files of a
721 721 revision from its first parent.
722 722
723 723 The codes used to show the status of files are:
724 724
725 725 M = modified
726 726 A = added
727 727 R = removed
728 728 C = clean
729 729 ! = missing (deleted by non-hg command, but still tracked)
730 730 ? = not tracked
731 731 I = ignored
732 732 = origin of the previous file (with --copies)
733 733
734 734 Returns 0 on success.
735 735
736 736 options ([+] can be repeated):
737 737
738 738 -A --all show status of all files
739 739 -m --modified show only modified files
740 740 -a --added show only added files
741 741 -r --removed show only removed files
742 742 -d --deleted show only missing files
743 743 -c --clean show only files without changes
744 744 -u --unknown show only unknown (not tracked) files
745 745 -i --ignored show only ignored files
746 746 -n --no-status hide status prefix
747 747 -C --copies show source of copied files
748 748 -0 --print0 end filenames with NUL, for use with xargs
749 749 --rev REV [+] show difference from revision
750 750 --change REV list the changed files of a revision
751 751 -I --include PATTERN [+] include names matching the given patterns
752 752 -X --exclude PATTERN [+] exclude names matching the given patterns
753 753 -S --subrepos recurse into subrepositories
754 754 -T --template TEMPLATE display with template
755 755
756 756 (some details hidden, use --verbose to show complete help)
757 757
758 758 $ hg -q help status
759 759 hg status [OPTION]... [FILE]...
760 760
761 761 show changed files in the working directory
762 762
763 763 $ hg help foo
764 764 abort: no such help topic: foo
765 765 (try 'hg help --keyword foo')
766 766 [10]
767 767
768 768 $ hg skjdfks
769 769 hg: unknown command 'skjdfks'
770 770 (use 'hg help' for a list of commands)
771 771 [10]
772 772
773 773 Typoed command gives suggestion
774 774 $ hg puls
775 775 hg: unknown command 'puls'
776 776 (did you mean one of pull, push?)
777 777 [10]
778 778
779 779 Not enabled extension gets suggested
780 780
781 781 $ hg rebase
782 782 hg: unknown command 'rebase'
783 783 'rebase' is provided by the following extension:
784 784
785 785 rebase command to move sets of revisions to a different ancestor
786 786
787 787 (use 'hg help extensions' for information on enabling extensions)
788 788 [10]
789 789
790 790 Disabled extension gets suggested
791 791 $ hg --config extensions.rebase=! rebase
792 792 hg: unknown command 'rebase'
793 793 'rebase' is provided by the following extension:
794 794
795 795 rebase command to move sets of revisions to a different ancestor
796 796
797 797 (use 'hg help extensions' for information on enabling extensions)
798 798 [10]
799 799
800 800 Checking that help adapts based on the config:
801 801
802 802 $ hg help diff --config ui.tweakdefaults=true | egrep -e '^ *(-g|config)'
803 803 -g --[no-]git use git extended diff format (default: on from
804 804 config)
805 805
806 806 Make sure that we don't run afoul of the help system thinking that
807 807 this is a section and erroring out weirdly.
808 808
809 809 $ hg .log
810 810 hg: unknown command '.log'
811 811 (did you mean log?)
812 812 [10]
813 813
814 814 $ hg log.
815 815 hg: unknown command 'log.'
816 816 (did you mean log?)
817 817 [10]
818 818 $ hg pu.lh
819 819 hg: unknown command 'pu.lh'
820 820 (did you mean one of pull, push?)
821 821 [10]
822 822
823 823 $ cat > helpext.py <<EOF
824 824 > import os
825 825 > from mercurial import commands, fancyopts, registrar
826 826 >
827 827 > def func(arg):
828 828 > return '%sfoo' % arg
829 829 > class customopt(fancyopts.customopt):
830 830 > def newstate(self, oldstate, newparam, abort):
831 831 > return '%sbar' % oldstate
832 832 > cmdtable = {}
833 833 > command = registrar.command(cmdtable)
834 834 >
835 835 > @command(b'nohelp',
836 836 > [(b'', b'longdesc', 3, b'x'*67),
837 837 > (b'n', b'', None, b'normal desc'),
838 838 > (b'', b'newline', b'', b'line1\nline2'),
839 839 > (b'', b'default-off', False, b'enable X'),
840 840 > (b'', b'default-on', True, b'enable Y'),
841 841 > (b'', b'callableopt', func, b'adds foo'),
842 842 > (b'', b'customopt', customopt(''), b'adds bar'),
843 843 > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')],
844 844 > b'hg nohelp',
845 845 > norepo=True)
846 846 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
847 847 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
848 848 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
849 849 > def nohelp(ui, *args, **kwargs):
850 850 > pass
851 851 >
852 852 > @command(b'hashelp', [], b'hg hashelp', norepo=True)
853 853 > def hashelp(ui, *args, **kwargs):
854 854 > """Extension command's help"""
855 855 >
856 856 > def uisetup(ui):
857 857 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
858 858 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
859 859 > ui.setconfig(b'alias', b'hgalias:doc', b'My doc', b'helpext')
860 860 > ui.setconfig(b'alias', b'hgalias:category', b'navigation', b'helpext')
861 861 > ui.setconfig(b'alias', b'hgaliasnodoc', b'summary', b'helpext')
862 862 >
863 863 > EOF
864 864 $ echo '[extensions]' >> $HGRCPATH
865 865 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
866 866
867 867 Test for aliases
868 868
869 869 $ hg help | grep hgalias
870 870 hgalias My doc
871 871
872 872 $ hg help hgalias
873 873 hg hgalias [--remote]
874 874
875 875 alias for: hg summary
876 876
877 877 My doc
878 878
879 879 defined by: helpext
880 880
881 881 options:
882 882
883 883 --remote check for push and pull
884 884
885 885 (some details hidden, use --verbose to show complete help)
886 886 $ hg help hgaliasnodoc
887 887 hg hgaliasnodoc [--remote]
888 888
889 889 alias for: hg summary
890 890
891 891 summarize working directory state
892 892
893 893 This generates a brief summary of the working directory state, including
894 894 parents, branch, commit status, phase and available updates.
895 895
896 896 With the --remote option, this will check the default paths for incoming
897 897 and outgoing changes. This can be time-consuming.
898 898
899 899 Returns 0 on success.
900 900
901 901 defined by: helpext
902 902
903 903 options:
904 904
905 905 --remote check for push and pull
906 906
907 907 (some details hidden, use --verbose to show complete help)
908 908
909 909 $ hg help shellalias
910 910 hg shellalias
911 911
912 912 shell alias for: echo hi
913 913
914 914 (no help text available)
915 915
916 916 defined by: helpext
917 917
918 918 (some details hidden, use --verbose to show complete help)
919 919
920 920 Test command with no help text
921 921
922 922 $ hg help nohelp
923 923 hg nohelp
924 924
925 925 (no help text available)
926 926
927 927 options:
928 928
929 929 --longdesc VALUE
930 930 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
931 931 xxxxxxxxxxxxxxxxxxxxxxx (default: 3)
932 932 -n -- normal desc
933 933 --newline VALUE line1 line2
934 934 --default-off enable X
935 935 --[no-]default-on enable Y (default: on)
936 936 --callableopt VALUE adds foo
937 937 --customopt VALUE adds bar
938 938 --customopt-withdefault VALUE adds bar (default: foo)
939 939
940 940 (some details hidden, use --verbose to show complete help)
941 941
942 942 Test that default list of commands includes extension commands that have help,
943 943 but not those that don't, except in verbose mode, when a keyword is passed, or
944 944 when help about the extension is requested.
945 945
946 946 #if no-extraextensions
947 947
948 948 $ hg help | grep hashelp
949 949 hashelp Extension command's help
950 950 $ hg help | grep nohelp
951 951 [1]
952 952 $ hg help -v | grep nohelp
953 953 nohelp (no help text available)
954 954
955 955 $ hg help -k nohelp
956 956 Commands:
957 957
958 958 nohelp hg nohelp
959 959
960 960 Extension Commands:
961 961
962 962 nohelp (no help text available)
963 963
964 964 $ hg help helpext
965 965 helpext extension - no help text available
966 966
967 967 list of commands:
968 968
969 969 hashelp Extension command's help
970 970 nohelp (no help text available)
971 971
972 972 (use 'hg help -v helpext' to show built-in aliases and global options)
973 973
974 974 #endif
975 975
976 976 Test list of internal help commands
977 977
978 978 $ hg help debug
979 979 debug commands (internal and unsupported):
980 980
981 981 debug-delta-find
982 982 display the computation to get to a valid delta for storing REV
983 983 debug-repair-issue6528
984 984 find affected revisions and repair them. See issue6528 for more
985 985 details.
986 986 debug-revlog-index
987 987 dump index data for a revlog
988 988 debugancestor
989 989 find the ancestor revision of two revisions in a given index
990 990 debugantivirusrunning
991 991 attempt to trigger an antivirus scanner to see if one is active
992 992 debugapplystreamclonebundle
993 993 apply a stream clone bundle file
994 994 debugbackupbundle
995 995 lists the changesets available in backup bundles
996 996 debugbuilddag
997 997 builds a repo with a given DAG from scratch in the current
998 998 empty repo
999 999 debugbundle lists the contents of a bundle
1000 1000 debugcapabilities
1001 1001 lists the capabilities of a remote peer
1002 1002 debugchangedfiles
1003 1003 list the stored files changes for a revision
1004 1004 debugcheckstate
1005 1005 validate the correctness of the current dirstate
1006 1006 debugcolor show available color, effects or style
1007 1007 debugcommands
1008 1008 list all available commands and options
1009 1009 debugcomplete
1010 1010 returns the completion list associated with the given command
1011 1011 debugcreatestreamclonebundle
1012 1012 create a stream clone bundle file
1013 1013 debugdag format the changelog or an index DAG as a concise textual
1014 1014 description
1015 1015 debugdata dump the contents of a data file revision
1016 1016 debugdate parse and display a date
1017 1017 debugdeltachain
1018 1018 dump information about delta chains in a revlog
1019 1019 debugdirstate
1020 1020 show the contents of the current dirstate
1021 1021 debugdirstateignorepatternshash
1022 1022 show the hash of ignore patterns stored in dirstate if v2,
1023 1023 debugdiscovery
1024 1024 runs the changeset discovery protocol in isolation
1025 1025 debugdownload
1026 1026 download a resource using Mercurial logic and config
1027 1027 debugextensions
1028 1028 show information about active extensions
1029 1029 debugfileset parse and apply a fileset specification
1030 1030 debugformat display format information about the current repository
1031 1031 debugfsinfo show information detected about current filesystem
1032 1032 debuggetbundle
1033 1033 retrieves a bundle from a repo
1034 1034 debugignore display the combined ignore pattern and information about
1035 1035 ignored files
1036 1036 debugindexdot
1037 1037 dump an index DAG as a graphviz dot file
1038 1038 debugindexstats
1039 1039 show stats related to the changelog index
1040 1040 debuginstall test Mercurial installation
1041 1041 debugknown test whether node ids are known to a repo
1042 1042 debuglocks show or modify state of locks
1043 1043 debugmanifestfulltextcache
1044 1044 show, clear or amend the contents of the manifest fulltext
1045 1045 cache
1046 1046 debugmergestate
1047 1047 print merge state
1048 1048 debugnamecomplete
1049 1049 complete "names" - tags, open branch names, bookmark names
1050 1050 debugnodemap write and inspect on disk nodemap
1051 1051 debugobsolete
1052 1052 create arbitrary obsolete marker
1053 1053 debugoptADV (no help text available)
1054 1054 debugoptDEP (no help text available)
1055 1055 debugoptEXP (no help text available)
1056 1056 debugp1copies
1057 1057 dump copy information compared to p1
1058 1058 debugp2copies
1059 1059 dump copy information compared to p2
1060 1060 debugpathcomplete
1061 1061 complete part or all of a tracked path
1062 1062 debugpathcopies
1063 1063 show copies between two revisions
1064 1064 debugpeer establish a connection to a peer repository
1065 1065 debugpickmergetool
1066 1066 examine which merge tool is chosen for specified file
1067 1067 debugpushkey access the pushkey key/value protocol
1068 1068 debugpvec (no help text available)
1069 1069 debugrebuilddirstate
1070 1070 rebuild the dirstate as it would look like for the given
1071 1071 revision
1072 1072 debugrebuildfncache
1073 1073 rebuild the fncache file
1074 1074 debugrename dump rename information
1075 1075 debugrequires
1076 1076 print the current repo requirements
1077 1077 debugrevlog show data and statistics about a revlog
1078 1078 debugrevlogindex
1079 1079 dump the contents of a revlog index
1080 1080 debugrevspec parse and apply a revision specification
1081 1081 debugserve run a server with advanced settings
1082 1082 debugsetparents
1083 1083 manually set the parents of the current working directory
1084 1084 (DANGEROUS)
1085 1085 debugshell run an interactive Python interpreter
1086 1086 debugsidedata
1087 1087 dump the side data for a cl/manifest/file revision
1088 1088 debugssl test a secure connection to a server
1089 1089 debugstrip strip changesets and all their descendants from the repository
1090 1090 debugsub (no help text available)
1091 1091 debugsuccessorssets
1092 1092 show set of successors for revision
1093 1093 debugtagscache
1094 1094 display the contents of .hg/cache/hgtagsfnodes1
1095 1095 debugtemplate
1096 1096 parse and apply a template
1097 1097 debuguigetpass
1098 1098 show prompt to type password
1099 1099 debuguiprompt
1100 1100 show plain prompt
1101 1101 debugupdatecaches
1102 1102 warm all known caches in the repository
1103 1103 debugupgraderepo
1104 1104 upgrade a repository to use different features
1105 1105 debugwalk show how files match on given patterns
1106 1106 debugwhyunstable
1107 1107 explain instabilities of a changeset
1108 1108 debugwireargs
1109 1109 (no help text available)
1110 1110 debugwireproto
1111 1111 send wire protocol commands to a server
1112 1112
1113 1113 (use 'hg help -v debug' to show built-in aliases and global options)
1114 1114
1115 1115 internals topic renders index of available sub-topics
1116 1116
1117 1117 $ hg help internals
1118 1118 Technical implementation topics
1119 1119 """""""""""""""""""""""""""""""
1120 1120
1121 1121 To access a subtopic, use "hg help internals.{subtopic-name}"
1122 1122
1123 1123 bid-merge Bid Merge Algorithm
1124 1124 bundle2 Bundle2
1125 1125 bundles Bundles
1126 1126 cbor CBOR
1127 1127 censor Censor
1128 1128 changegroups Changegroups
1129 1129 config Config Registrar
1130 1130 dirstate-v2 dirstate-v2 file format
1131 1131 extensions Extension API
1132 1132 mergestate Mergestate
1133 1133 requirements Repository Requirements
1134 1134 revlogs Revision Logs
1135 1135 wireprotocol Wire Protocol
1136 1136 wireprotocolrpc
1137 1137 Wire Protocol RPC
1138 1138 wireprotocolv2
1139 1139 Wire Protocol Version 2
1140 1140
1141 1141 sub-topics can be accessed
1142 1142
1143 1143 $ hg help internals.changegroups
1144 1144 Changegroups
1145 1145 """"""""""""
1146 1146
1147 1147 Changegroups are representations of repository revlog data, specifically
1148 1148 the changelog data, root/flat manifest data, treemanifest data, and
1149 1149 filelogs.
1150 1150
1151 1151 There are 4 versions of changegroups: "1", "2", "3" and "4". From a high-
1152 1152 level, versions "1" and "2" are almost exactly the same, with the only
1153 1153 difference being an additional item in the *delta header*. Version "3"
1154 1154 adds support for storage flags in the *delta header* and optionally
1155 1155 exchanging treemanifests (enabled by setting an option on the
1156 1156 "changegroup" part in the bundle2). Version "4" adds support for
1157 1157 exchanging sidedata (additional revision metadata not part of the digest).
1158 1158
1159 1159 Changegroups when not exchanging treemanifests consist of 3 logical
1160 1160 segments:
1161 1161
1162 1162 +---------------------------------+
1163 1163 | | | |
1164 1164 | changeset | manifest | filelogs |
1165 1165 | | | |
1166 1166 | | | |
1167 1167 +---------------------------------+
1168 1168
1169 1169 When exchanging treemanifests, there are 4 logical segments:
1170 1170
1171 1171 +-------------------------------------------------+
1172 1172 | | | | |
1173 1173 | changeset | root | treemanifests | filelogs |
1174 1174 | | manifest | | |
1175 1175 | | | | |
1176 1176 +-------------------------------------------------+
1177 1177
1178 1178 The principle building block of each segment is a *chunk*. A *chunk* is a
1179 1179 framed piece of data:
1180 1180
1181 1181 +---------------------------------------+
1182 1182 | | |
1183 1183 | length | data |
1184 1184 | (4 bytes) | (<length - 4> bytes) |
1185 1185 | | |
1186 1186 +---------------------------------------+
1187 1187
1188 1188 All integers are big-endian signed integers. Each chunk starts with a
1189 1189 32-bit integer indicating the length of the entire chunk (including the
1190 1190 length field itself).
1191 1191
1192 1192 There is a special case chunk that has a value of 0 for the length
1193 1193 ("0x00000000"). We call this an *empty chunk*.
1194 1194
1195 1195 Delta Groups
1196 1196 ============
1197 1197
1198 1198 A *delta group* expresses the content of a revlog as a series of deltas,
1199 1199 or patches against previous revisions.
1200 1200
1201 1201 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1202 1202 to signal the end of the delta group:
1203 1203
1204 1204 +------------------------------------------------------------------------+
1205 1205 | | | | | |
1206 1206 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1207 1207 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1208 1208 | | | | | |
1209 1209 +------------------------------------------------------------------------+
1210 1210
1211 1211 Each *chunk*'s data consists of the following:
1212 1212
1213 1213 +---------------------------------------+
1214 1214 | | |
1215 1215 | delta header | delta data |
1216 1216 | (various by version) | (various) |
1217 1217 | | |
1218 1218 +---------------------------------------+
1219 1219
1220 1220 The *delta data* is a series of *delta*s that describe a diff from an
1221 1221 existing entry (either that the recipient already has, or previously
1222 1222 specified in the bundle/changegroup).
1223 1223
1224 1224 The *delta header* is different between versions "1", "2", "3" and "4" of
1225 1225 the changegroup format.
1226 1226
1227 1227 Version 1 (headerlen=80):
1228 1228
1229 1229 +------------------------------------------------------+
1230 1230 | | | | |
1231 1231 | node | p1 node | p2 node | link node |
1232 1232 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1233 1233 | | | | |
1234 1234 +------------------------------------------------------+
1235 1235
1236 1236 Version 2 (headerlen=100):
1237 1237
1238 1238 +------------------------------------------------------------------+
1239 1239 | | | | | |
1240 1240 | node | p1 node | p2 node | base node | link node |
1241 1241 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1242 1242 | | | | | |
1243 1243 +------------------------------------------------------------------+
1244 1244
1245 1245 Version 3 (headerlen=102):
1246 1246
1247 1247 +------------------------------------------------------------------------------+
1248 1248 | | | | | | |
1249 1249 | node | p1 node | p2 node | base node | link node | flags |
1250 1250 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1251 1251 | | | | | | |
1252 1252 +------------------------------------------------------------------------------+
1253 1253
1254 1254 Version 4 (headerlen=103):
1255 1255
1256 1256 +------------------------------------------------------------------------------+----------+
1257 1257 | | | | | | | |
1258 1258 | node | p1 node | p2 node | base node | link node | flags | pflags |
1259 1259 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | (1 byte) |
1260 1260 | | | | | | | |
1261 1261 +------------------------------------------------------------------------------+----------+
1262 1262
1263 1263 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1264 1264 contain a series of *delta*s, densely packed (no separators). These deltas
1265 1265 describe a diff from an existing entry (either that the recipient already
1266 1266 has, or previously specified in the bundle/changegroup). The format is
1267 1267 described more fully in "hg help internals.bdiff", but briefly:
1268 1268
1269 1269 +---------------------------------------------------------------+
1270 1270 | | | | |
1271 1271 | start offset | end offset | new length | content |
1272 1272 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1273 1273 | | | | |
1274 1274 +---------------------------------------------------------------+
1275 1275
1276 1276 Please note that the length field in the delta data does *not* include
1277 1277 itself.
1278 1278
1279 1279 In version 1, the delta is always applied against the previous node from
1280 1280 the changegroup or the first parent if this is the first entry in the
1281 1281 changegroup.
1282 1282
1283 1283 In version 2 and up, the delta base node is encoded in the entry in the
1284 1284 changegroup. This allows the delta to be expressed against any parent,
1285 1285 which can result in smaller deltas and more efficient encoding of data.
1286 1286
1287 1287 The *flags* field holds bitwise flags affecting the processing of revision
1288 1288 data. The following flags are defined:
1289 1289
1290 1290 32768
1291 1291 Censored revision. The revision's fulltext has been replaced by censor
1292 1292 metadata. May only occur on file revisions.
1293 1293
1294 1294 16384
1295 1295 Ellipsis revision. Revision hash does not match data (likely due to
1296 1296 rewritten parents).
1297 1297
1298 1298 8192
1299 1299 Externally stored. The revision fulltext contains "key:value" "\n"
1300 1300 delimited metadata defining an object stored elsewhere. Used by the LFS
1301 1301 extension.
1302 1302
1303 1303 4096
1304 1304 Contains copy information. This revision changes files in a way that
1305 1305 could affect copy tracing. This does *not* affect changegroup handling,
1306 1306 but is relevant for other parts of Mercurial.
1307 1307
1308 1308 For historical reasons, the integer values are identical to revlog version
1309 1309 1 per-revision storage flags and correspond to bits being set in this
1310 1310 2-byte field. Bits were allocated starting from the most-significant bit,
1311 1311 hence the reverse ordering and allocation of these flags.
1312 1312
1313 1313 The *pflags* (protocol flags) field holds bitwise flags affecting the
1314 1314 protocol itself. They are first in the header since they may affect the
1315 1315 handling of the rest of the fields in a future version. They are defined
1316 1316 as such:
1317 1317
1318 1318 1 indicates whether to read a chunk of sidedata (of variable length) right
1319 1319 after the revision flags.
1320 1320
1321 1321 Changeset Segment
1322 1322 =================
1323 1323
1324 1324 The *changeset segment* consists of a single *delta group* holding
1325 1325 changelog data. The *empty chunk* at the end of the *delta group* denotes
1326 1326 the boundary to the *manifest segment*.
1327 1327
1328 1328 Manifest Segment
1329 1329 ================
1330 1330
1331 1331 The *manifest segment* consists of a single *delta group* holding manifest
1332 1332 data. If treemanifests are in use, it contains only the manifest for the
1333 1333 root directory of the repository. Otherwise, it contains the entire
1334 1334 manifest data. The *empty chunk* at the end of the *delta group* denotes
1335 1335 the boundary to the next segment (either the *treemanifests segment* or
1336 1336 the *filelogs segment*, depending on version and the request options).
1337 1337
1338 1338 Treemanifests Segment
1339 1339 ---------------------
1340 1340
1341 1341 The *treemanifests segment* only exists in changegroup version "3" and
1342 1342 "4", and only if the 'treemanifest' param is part of the bundle2
1343 1343 changegroup part (it is not possible to use changegroup version 3 or 4
1344 1344 outside of bundle2). Aside from the filenames in the *treemanifests
1345 1345 segment* containing a trailing "/" character, it behaves identically to
1346 1346 the *filelogs segment* (see below). The final sub-segment is followed by
1347 1347 an *empty chunk* (logically, a sub-segment with filename size 0). This
1348 1348 denotes the boundary to the *filelogs segment*.
1349 1349
1350 1350 Filelogs Segment
1351 1351 ================
1352 1352
1353 1353 The *filelogs segment* consists of multiple sub-segments, each
1354 1354 corresponding to an individual file whose data is being described:
1355 1355
1356 1356 +--------------------------------------------------+
1357 1357 | | | | | |
1358 1358 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1359 1359 | | | | | (4 bytes) |
1360 1360 | | | | | |
1361 1361 +--------------------------------------------------+
1362 1362
1363 1363 The final filelog sub-segment is followed by an *empty chunk* (logically,
1364 1364 a sub-segment with filename size 0). This denotes the end of the segment
1365 1365 and of the overall changegroup.
1366 1366
1367 1367 Each filelog sub-segment consists of the following:
1368 1368
1369 1369 +------------------------------------------------------+
1370 1370 | | | |
1371 1371 | filename length | filename | delta group |
1372 1372 | (4 bytes) | (<length - 4> bytes) | (various) |
1373 1373 | | | |
1374 1374 +------------------------------------------------------+
1375 1375
1376 1376 That is, a *chunk* consisting of the filename (not terminated or padded)
1377 1377 followed by N chunks constituting the *delta group* for this file. The
1378 1378 *empty chunk* at the end of each *delta group* denotes the boundary to the
1379 1379 next filelog sub-segment.
1380 1380
1381 1381 non-existent subtopics print an error
1382 1382
1383 1383 $ hg help internals.foo
1384 1384 abort: no such help topic: internals.foo
1385 1385 (try 'hg help --keyword foo')
1386 1386 [10]
1387 1387
1388 1388 test advanced, deprecated and experimental options are hidden in command help
1389 1389 $ hg help debugoptADV
1390 1390 hg debugoptADV
1391 1391
1392 1392 (no help text available)
1393 1393
1394 1394 options:
1395 1395
1396 1396 (some details hidden, use --verbose to show complete help)
1397 1397 $ hg help debugoptDEP
1398 1398 hg debugoptDEP
1399 1399
1400 1400 (no help text available)
1401 1401
1402 1402 options:
1403 1403
1404 1404 (some details hidden, use --verbose to show complete help)
1405 1405
1406 1406 $ hg help debugoptEXP
1407 1407 hg debugoptEXP
1408 1408
1409 1409 (no help text available)
1410 1410
1411 1411 options:
1412 1412
1413 1413 (some details hidden, use --verbose to show complete help)
1414 1414
1415 1415 test advanced, deprecated and experimental options are shown with -v
1416 1416 $ hg help -v debugoptADV | grep aopt
1417 1417 --aopt option is (ADVANCED)
1418 1418 $ hg help -v debugoptDEP | grep dopt
1419 1419 --dopt option is (DEPRECATED)
1420 1420 $ hg help -v debugoptEXP | grep eopt
1421 1421 --eopt option is (EXPERIMENTAL)
1422 1422
1423 1423 #if gettext
1424 1424 test deprecated option is hidden with translation with untranslated description
1425 1425 (use many globy for not failing on changed transaction)
1426 1426 $ LANGUAGE=sv hg help debugoptDEP
1427 1427 hg debugoptDEP
1428 1428
1429 1429 (*) (glob)
1430 1430
1431 1431 options:
1432 1432
1433 1433 (some details hidden, use --verbose to show complete help)
1434 1434 #endif
1435 1435
1436 1436 Test commands that collide with topics (issue4240)
1437 1437
1438 1438 $ hg config -hq
1439 1439 hg config [-u] [NAME]...
1440 1440
1441 1441 show combined config settings from all hgrc files
1442 1442 $ hg showconfig -hq
1443 1443 hg config [-u] [NAME]...
1444 1444
1445 1445 show combined config settings from all hgrc files
1446 1446
1447 1447 Test a help topic
1448 1448
1449 1449 $ hg help dates
1450 1450 Date Formats
1451 1451 """"""""""""
1452 1452
1453 1453 Some commands allow the user to specify a date, e.g.:
1454 1454
1455 1455 - backout, commit, import, tag: Specify the commit date.
1456 1456 - log, revert, update: Select revision(s) by date.
1457 1457
1458 1458 Many date formats are valid. Here are some examples:
1459 1459
1460 1460 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1461 1461 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1462 1462 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1463 1463 - "Dec 6" (midnight)
1464 1464 - "13:18" (today assumed)
1465 1465 - "3:39" (3:39AM assumed)
1466 1466 - "3:39pm" (15:39)
1467 1467 - "2006-12-06 13:18:29" (ISO 8601 format)
1468 1468 - "2006-12-6 13:18"
1469 1469 - "2006-12-6"
1470 1470 - "12-6"
1471 1471 - "12/6"
1472 1472 - "12/6/6" (Dec 6 2006)
1473 1473 - "today" (midnight)
1474 1474 - "yesterday" (midnight)
1475 1475 - "now" - right now
1476 1476
1477 1477 Lastly, there is Mercurial's internal format:
1478 1478
1479 1479 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1480 1480
1481 1481 This is the internal representation format for dates. The first number is
1482 1482 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1483 1483 is the offset of the local timezone, in seconds west of UTC (negative if
1484 1484 the timezone is east of UTC).
1485 1485
1486 1486 The log command also accepts date ranges:
1487 1487
1488 1488 - "<DATE" - at or before a given date/time
1489 1489 - ">DATE" - on or after a given date/time
1490 1490 - "DATE to DATE" - a date range, inclusive
1491 1491 - "-DAYS" - within a given number of days from today
1492 1492
1493 1493 Test repeated config section name
1494 1494
1495 1495 $ hg help config.host
1496 1496 "http_proxy.host"
1497 1497 Host name and (optional) port of the proxy server, for example
1498 1498 "myproxy:8000".
1499 1499
1500 1500 "smtp.host"
1501 1501 Host name of mail server, e.g. "mail.example.com".
1502 1502
1503 1503
1504 1504 Test section name with dot
1505 1505
1506 1506 $ hg help config.ui.username
1507 1507 "ui.username"
1508 1508 The committer of a changeset created when running "commit". Typically
1509 1509 a person's name and email address, e.g. "Fred Widget
1510 1510 <fred@example.com>". Environment variables in the username are
1511 1511 expanded.
1512 1512
1513 1513 (default: "$EMAIL" or "username@hostname". If the username in hgrc is
1514 1514 empty, e.g. if the system admin set "username =" in the system hgrc,
1515 1515 it has to be specified manually or in a different hgrc file)
1516 1516
1517 1517
1518 1518 $ hg help config.annotate.git
1519 1519 abort: help section not found: config.annotate.git
1520 1520 [10]
1521 1521
1522 1522 $ hg help config.update.check
1523 1523 "commands.update.check"
1524 1524 Determines what level of checking 'hg update' will perform before
1525 1525 moving to a destination revision. Valid values are "abort", "none",
1526 1526 "linear", and "noconflict".
1527 1527
1528 1528 - "abort" always fails if the working directory has uncommitted
1529 1529 changes.
1530 1530 - "none" performs no checking, and may result in a merge with
1531 1531 uncommitted changes.
1532 1532 - "linear" allows any update as long as it follows a straight line in
1533 1533 the revision history, and may trigger a merge with uncommitted
1534 1534 changes.
1535 1535 - "noconflict" will allow any update which would not trigger a merge
1536 1536 with uncommitted changes, if any are present.
1537 1537
1538 1538 (default: "linear")
1539 1539
1540 1540
1541 1541 $ hg help config.commands.update.check
1542 1542 "commands.update.check"
1543 1543 Determines what level of checking 'hg update' will perform before
1544 1544 moving to a destination revision. Valid values are "abort", "none",
1545 1545 "linear", and "noconflict".
1546 1546
1547 1547 - "abort" always fails if the working directory has uncommitted
1548 1548 changes.
1549 1549 - "none" performs no checking, and may result in a merge with
1550 1550 uncommitted changes.
1551 1551 - "linear" allows any update as long as it follows a straight line in
1552 1552 the revision history, and may trigger a merge with uncommitted
1553 1553 changes.
1554 1554 - "noconflict" will allow any update which would not trigger a merge
1555 1555 with uncommitted changes, if any are present.
1556 1556
1557 1557 (default: "linear")
1558 1558
1559 1559
1560 1560 $ hg help config.ommands.update.check
1561 1561 abort: help section not found: config.ommands.update.check
1562 1562 [10]
1563 1563
1564 1564 Unrelated trailing paragraphs shouldn't be included
1565 1565
1566 1566 $ hg help config.extramsg | grep '^$'
1567 1567
1568 1568
1569 1569 Test capitalized section name
1570 1570
1571 1571 $ hg help scripting.HGPLAIN > /dev/null
1572 1572
1573 1573 Help subsection:
1574 1574
1575 1575 $ hg help config.charsets |grep "Email example:" > /dev/null
1576 1576 [1]
1577 1577
1578 1578 Show nested definitions
1579 1579 ("profiling.type"[break]"ls"[break]"stat"[break])
1580 1580
1581 1581 $ hg help config.type | egrep '^$'|wc -l
1582 1582 \s*3 (re)
1583 1583
1584 1584 $ hg help config.profiling.type.ls
1585 1585 "profiling.type.ls"
1586 1586 Use Python's built-in instrumenting profiler. This profiler works on
1587 1587 all platforms, but each line number it reports is the first line of
1588 1588 a function. This restriction makes it difficult to identify the
1589 1589 expensive parts of a non-trivial function.
1590 1590
1591 1591
1592 1592 Separate sections from subsections
1593 1593
1594 1594 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1595 1595 "format"
1596 1596 --------
1597 1597
1598 1598 "usegeneraldelta"
1599 1599
1600 1600 "dotencode"
1601 1601
1602 1602 "usefncache"
1603 1603
1604 1604 "use-dirstate-v2"
1605 1605
1606 1606 "use-dirstate-v2.automatic-upgrade-of-mismatching-repositories"
1607 1607
1608 1608 "use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet"
1609 1609
1610 1610 "use-dirstate-tracked-hint"
1611 1611
1612 1612 "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories"
1613 1613
1614 "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet"
1615
1614 1616 "use-persistent-nodemap"
1615 1617
1616 1618 "use-share-safe"
1617 1619
1618 1620 "use-share-safe.automatic-upgrade-of-mismatching-repositories"
1619 1621
1620 1622 "use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet"
1621 1623
1622 1624 "usestore"
1623 1625
1624 1626 "sparse-revlog"
1625 1627
1626 1628 "revlog-compression"
1627 1629
1628 1630 "bookmarks-in-store"
1629 1631
1630 1632 "profiling"
1631 1633 -----------
1632 1634
1633 1635 "format"
1634 1636
1635 1637 "progress"
1636 1638 ----------
1637 1639
1638 1640 "format"
1639 1641
1640 1642
1641 1643 Last item in help config.*:
1642 1644
1643 1645 $ hg help config.`hg help config|grep '^ "'| \
1644 1646 > tail -1|sed 's![ "]*!!g'`| \
1645 1647 > grep 'hg help -c config' > /dev/null
1646 1648 [1]
1647 1649
1648 1650 note to use help -c for general hg help config:
1649 1651
1650 1652 $ hg help config |grep 'hg help -c config' > /dev/null
1651 1653
1652 1654 Test templating help
1653 1655
1654 1656 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1655 1657 desc String. The text of the changeset description.
1656 1658 diffstat String. Statistics of changes with the following format:
1657 1659 firstline Any text. Returns the first line of text.
1658 1660 nonempty Any text. Returns '(none)' if the string is empty.
1659 1661
1660 1662 Test deprecated items
1661 1663
1662 1664 $ hg help -v templating | grep currentbookmark
1663 1665 currentbookmark
1664 1666 $ hg help templating | (grep currentbookmark || true)
1665 1667
1666 1668 Test help hooks
1667 1669
1668 1670 $ cat > helphook1.py <<EOF
1669 1671 > from mercurial import help
1670 1672 >
1671 1673 > def rewrite(ui, topic, doc):
1672 1674 > return doc + b'\nhelphook1\n'
1673 1675 >
1674 1676 > def extsetup(ui):
1675 1677 > help.addtopichook(b'revisions', rewrite)
1676 1678 > EOF
1677 1679 $ cat > helphook2.py <<EOF
1678 1680 > from mercurial import help
1679 1681 >
1680 1682 > def rewrite(ui, topic, doc):
1681 1683 > return doc + b'\nhelphook2\n'
1682 1684 >
1683 1685 > def extsetup(ui):
1684 1686 > help.addtopichook(b'revisions', rewrite)
1685 1687 > EOF
1686 1688 $ echo '[extensions]' >> $HGRCPATH
1687 1689 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1688 1690 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1689 1691 $ hg help revsets | grep helphook
1690 1692 helphook1
1691 1693 helphook2
1692 1694
1693 1695 help -c should only show debug --debug
1694 1696
1695 1697 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1696 1698 [1]
1697 1699
1698 1700 help -c should only show deprecated for -v
1699 1701
1700 1702 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1701 1703 [1]
1702 1704
1703 1705 Test -s / --system
1704 1706
1705 1707 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1706 1708 > wc -l | sed -e 's/ //g'
1707 1709 0
1708 1710 $ hg help config.files --system unix | grep 'USER' | \
1709 1711 > wc -l | sed -e 's/ //g'
1710 1712 0
1711 1713
1712 1714 Test -e / -c / -k combinations
1713 1715
1714 1716 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1715 1717 Commands:
1716 1718 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1717 1719 Extensions:
1718 1720 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1719 1721 Topics:
1720 1722 Commands:
1721 1723 Extensions:
1722 1724 Extension Commands:
1723 1725 $ hg help -c schemes
1724 1726 abort: no such help topic: schemes
1725 1727 (try 'hg help --keyword schemes')
1726 1728 [10]
1727 1729 $ hg help -e schemes |head -1
1728 1730 schemes extension - extend schemes with shortcuts to repository swarms
1729 1731 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1730 1732 Commands:
1731 1733 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1732 1734 Extensions:
1733 1735 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1734 1736 Extensions:
1735 1737 Commands:
1736 1738 $ hg help -c commit > /dev/null
1737 1739 $ hg help -e -c commit > /dev/null
1738 1740 $ hg help -e commit
1739 1741 abort: no such help topic: commit
1740 1742 (try 'hg help --keyword commit')
1741 1743 [10]
1742 1744
1743 1745 Test keyword search help
1744 1746
1745 1747 $ cat > prefixedname.py <<EOF
1746 1748 > '''matched against word "clone"
1747 1749 > '''
1748 1750 > EOF
1749 1751 $ echo '[extensions]' >> $HGRCPATH
1750 1752 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1751 1753 $ hg help -k clone
1752 1754 Topics:
1753 1755
1754 1756 config Configuration Files
1755 1757 extensions Using Additional Features
1756 1758 glossary Glossary
1757 1759 phases Working with Phases
1758 1760 subrepos Subrepositories
1759 1761 urls URL Paths
1760 1762
1761 1763 Commands:
1762 1764
1763 1765 bookmarks create a new bookmark or list existing bookmarks
1764 1766 clone make a copy of an existing repository
1765 1767 paths show aliases for remote repositories
1766 1768 pull pull changes from the specified source
1767 1769 update update working directory (or switch revisions)
1768 1770
1769 1771 Extensions:
1770 1772
1771 1773 clonebundles advertise pre-generated bundles to seed clones
1772 1774 narrow create clones which fetch history data for subset of files
1773 1775 (EXPERIMENTAL)
1774 1776 prefixedname matched against word "clone"
1775 1777 relink recreates hardlinks between repository clones
1776 1778
1777 1779 Extension Commands:
1778 1780
1779 1781 qclone clone main and patch repository at same time
1780 1782
1781 1783 Test unfound topic
1782 1784
1783 1785 $ hg help nonexistingtopicthatwillneverexisteverever
1784 1786 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1785 1787 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1786 1788 [10]
1787 1789
1788 1790 Test unfound keyword
1789 1791
1790 1792 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1791 1793 abort: no matches
1792 1794 (try 'hg help' for a list of topics)
1793 1795 [10]
1794 1796
1795 1797 Test omit indicating for help
1796 1798
1797 1799 $ cat > addverboseitems.py <<EOF
1798 1800 > r'''extension to test omit indicating.
1799 1801 >
1800 1802 > This paragraph is never omitted (for extension)
1801 1803 >
1802 1804 > .. container:: verbose
1803 1805 >
1804 1806 > This paragraph is omitted,
1805 1807 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1806 1808 >
1807 1809 > This paragraph is never omitted, too (for extension)
1808 1810 > '''
1809 1811 > from mercurial import commands, help
1810 1812 > testtopic = br"""This paragraph is never omitted (for topic).
1811 1813 >
1812 1814 > .. container:: verbose
1813 1815 >
1814 1816 > This paragraph is omitted,
1815 1817 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1816 1818 >
1817 1819 > This paragraph is never omitted, too (for topic)
1818 1820 > """
1819 1821 > def extsetup(ui):
1820 1822 > help.helptable.append(([b"topic-containing-verbose"],
1821 1823 > b"This is the topic to test omit indicating.",
1822 1824 > lambda ui: testtopic))
1823 1825 > EOF
1824 1826 $ echo '[extensions]' >> $HGRCPATH
1825 1827 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1826 1828 $ hg help addverboseitems
1827 1829 addverboseitems extension - extension to test omit indicating.
1828 1830
1829 1831 This paragraph is never omitted (for extension)
1830 1832
1831 1833 This paragraph is never omitted, too (for extension)
1832 1834
1833 1835 (some details hidden, use --verbose to show complete help)
1834 1836
1835 1837 no commands defined
1836 1838 $ hg help -v addverboseitems
1837 1839 addverboseitems extension - extension to test omit indicating.
1838 1840
1839 1841 This paragraph is never omitted (for extension)
1840 1842
1841 1843 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1842 1844 extension)
1843 1845
1844 1846 This paragraph is never omitted, too (for extension)
1845 1847
1846 1848 no commands defined
1847 1849 $ hg help topic-containing-verbose
1848 1850 This is the topic to test omit indicating.
1849 1851 """"""""""""""""""""""""""""""""""""""""""
1850 1852
1851 1853 This paragraph is never omitted (for topic).
1852 1854
1853 1855 This paragraph is never omitted, too (for topic)
1854 1856
1855 1857 (some details hidden, use --verbose to show complete help)
1856 1858 $ hg help -v topic-containing-verbose
1857 1859 This is the topic to test omit indicating.
1858 1860 """"""""""""""""""""""""""""""""""""""""""
1859 1861
1860 1862 This paragraph is never omitted (for topic).
1861 1863
1862 1864 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1863 1865 topic)
1864 1866
1865 1867 This paragraph is never omitted, too (for topic)
1866 1868
1867 1869 Test section lookup
1868 1870
1869 1871 $ hg help revset.merge
1870 1872 "merge()"
1871 1873 Changeset is a merge changeset.
1872 1874
1873 1875 $ hg help glossary.dag
1874 1876 DAG
1875 1877 The repository of changesets of a distributed version control system
1876 1878 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1877 1879 of nodes and edges, where nodes correspond to changesets and edges
1878 1880 imply a parent -> child relation. This graph can be visualized by
1879 1881 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1880 1882 limited by the requirement for children to have at most two parents.
1881 1883
1882 1884
1883 1885 $ hg help hgrc.paths
1884 1886 "paths"
1885 1887 -------
1886 1888
1887 1889 Assigns symbolic names and behavior to repositories.
1888 1890
1889 1891 Options are symbolic names defining the URL or directory that is the
1890 1892 location of the repository. Example:
1891 1893
1892 1894 [paths]
1893 1895 my_server = https://example.com/my_repo
1894 1896 local_path = /home/me/repo
1895 1897
1896 1898 These symbolic names can be used from the command line. To pull from
1897 1899 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1898 1900 local_path'. You can check 'hg help urls' for details about valid URLs.
1899 1901
1900 1902 Options containing colons (":") denote sub-options that can influence
1901 1903 behavior for that specific path. Example:
1902 1904
1903 1905 [paths]
1904 1906 my_server = https://example.com/my_path
1905 1907 my_server:pushurl = ssh://example.com/my_path
1906 1908
1907 1909 Paths using the 'path://otherpath' scheme will inherit the sub-options
1908 1910 value from the path they point to.
1909 1911
1910 1912 The following sub-options can be defined:
1911 1913
1912 1914 "multi-urls"
1913 1915 A boolean option. When enabled the value of the '[paths]' entry will be
1914 1916 parsed as a list and the alias will resolve to multiple destination. If
1915 1917 some of the list entry use the 'path://' syntax, the suboption will be
1916 1918 inherited individually.
1917 1919
1918 1920 "pushurl"
1919 1921 The URL to use for push operations. If not defined, the location
1920 1922 defined by the path's main entry is used.
1921 1923
1922 1924 "pushrev"
1923 1925 A revset defining which revisions to push by default.
1924 1926
1925 1927 When 'hg push' is executed without a "-r" argument, the revset defined
1926 1928 by this sub-option is evaluated to determine what to push.
1927 1929
1928 1930 For example, a value of "." will push the working directory's revision
1929 1931 by default.
1930 1932
1931 1933 Revsets specifying bookmarks will not result in the bookmark being
1932 1934 pushed.
1933 1935
1934 1936 "bookmarks.mode"
1935 1937 How bookmark will be dealt during the exchange. It support the following
1936 1938 value
1937 1939
1938 1940 - "default": the default behavior, local and remote bookmarks are
1939 1941 "merged" on push/pull.
1940 1942 - "mirror": when pulling, replace local bookmarks by remote bookmarks.
1941 1943 This is useful to replicate a repository, or as an optimization.
1942 1944 - "ignore": ignore bookmarks during exchange. (This currently only
1943 1945 affect pulling)
1944 1946
1945 1947 The following special named paths exist:
1946 1948
1947 1949 "default"
1948 1950 The URL or directory to use when no source or remote is specified.
1949 1951
1950 1952 'hg clone' will automatically define this path to the location the
1951 1953 repository was cloned from.
1952 1954
1953 1955 "default-push"
1954 1956 (deprecated) The URL or directory for the default 'hg push' location.
1955 1957 "default:pushurl" should be used instead.
1956 1958
1957 1959 $ hg help glossary.mcguffin
1958 1960 abort: help section not found: glossary.mcguffin
1959 1961 [10]
1960 1962
1961 1963 $ hg help glossary.mc.guffin
1962 1964 abort: help section not found: glossary.mc.guffin
1963 1965 [10]
1964 1966
1965 1967 $ hg help template.files
1966 1968 files List of strings. All files modified, added, or removed by
1967 1969 this changeset.
1968 1970 files(pattern)
1969 1971 All files of the current changeset matching the pattern. See
1970 1972 'hg help patterns'.
1971 1973
1972 1974 Test section lookup by translated message
1973 1975
1974 1976 str.lower() instead of encoding.lower(str) on translated message might
1975 1977 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1976 1978 as the second or later byte of multi-byte character.
1977 1979
1978 1980 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1979 1981 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1980 1982 replacement makes message meaningless.
1981 1983
1982 1984 This tests that section lookup by translated string isn't broken by
1983 1985 such str.lower().
1984 1986
1985 1987 $ "$PYTHON" <<EOF
1986 1988 > def escape(s):
1987 1989 > return b''.join(b'\\u%x' % ord(uc) for uc in s.decode('cp932'))
1988 1990 > # translation of "record" in ja_JP.cp932
1989 1991 > upper = b"\x8bL\x98^"
1990 1992 > # str.lower()-ed section name should be treated as different one
1991 1993 > lower = b"\x8bl\x98^"
1992 1994 > with open('ambiguous.py', 'wb') as fp:
1993 1995 > fp.write(b"""# ambiguous section names in ja_JP.cp932
1994 1996 > u'''summary of extension
1995 1997 >
1996 1998 > %s
1997 1999 > ----
1998 2000 >
1999 2001 > Upper name should show only this message
2000 2002 >
2001 2003 > %s
2002 2004 > ----
2003 2005 >
2004 2006 > Lower name should show only this message
2005 2007 >
2006 2008 > subsequent section
2007 2009 > ------------------
2008 2010 >
2009 2011 > This should be hidden at 'hg help ambiguous' with section name.
2010 2012 > '''
2011 2013 > """ % (escape(upper), escape(lower)))
2012 2014 > EOF
2013 2015
2014 2016 $ cat >> $HGRCPATH <<EOF
2015 2017 > [extensions]
2016 2018 > ambiguous = ./ambiguous.py
2017 2019 > EOF
2018 2020
2019 2021 $ "$PYTHON" <<EOF | sh
2020 2022 > from mercurial.utils import procutil
2021 2023 > upper = b"\x8bL\x98^"
2022 2024 > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % upper)
2023 2025 > EOF
2024 2026 \x8bL\x98^ (esc)
2025 2027 ----
2026 2028
2027 2029 Upper name should show only this message
2028 2030
2029 2031
2030 2032 $ "$PYTHON" <<EOF | sh
2031 2033 > from mercurial.utils import procutil
2032 2034 > lower = b"\x8bl\x98^"
2033 2035 > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % lower)
2034 2036 > EOF
2035 2037 \x8bl\x98^ (esc)
2036 2038 ----
2037 2039
2038 2040 Lower name should show only this message
2039 2041
2040 2042
2041 2043 $ cat >> $HGRCPATH <<EOF
2042 2044 > [extensions]
2043 2045 > ambiguous = !
2044 2046 > EOF
2045 2047
2046 2048 Show help content of disabled extensions
2047 2049
2048 2050 $ cat >> $HGRCPATH <<EOF
2049 2051 > [extensions]
2050 2052 > ambiguous = !./ambiguous.py
2051 2053 > EOF
2052 2054 $ hg help -e ambiguous
2053 2055 ambiguous extension - (no help text available)
2054 2056
2055 2057 (use 'hg help extensions' for information on enabling extensions)
2056 2058
2057 2059 Test dynamic list of merge tools only shows up once
2058 2060 $ hg help merge-tools
2059 2061 Merge Tools
2060 2062 """""""""""
2061 2063
2062 2064 To merge files Mercurial uses merge tools.
2063 2065
2064 2066 A merge tool combines two different versions of a file into a merged file.
2065 2067 Merge tools are given the two files and the greatest common ancestor of
2066 2068 the two file versions, so they can determine the changes made on both
2067 2069 branches.
2068 2070
2069 2071 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
2070 2072 backout' and in several extensions.
2071 2073
2072 2074 Usually, the merge tool tries to automatically reconcile the files by
2073 2075 combining all non-overlapping changes that occurred separately in the two
2074 2076 different evolutions of the same initial base file. Furthermore, some
2075 2077 interactive merge programs make it easier to manually resolve conflicting
2076 2078 merges, either in a graphical way, or by inserting some conflict markers.
2077 2079 Mercurial does not include any interactive merge programs but relies on
2078 2080 external tools for that.
2079 2081
2080 2082 Available merge tools
2081 2083 =====================
2082 2084
2083 2085 External merge tools and their properties are configured in the merge-
2084 2086 tools configuration section - see hgrc(5) - but they can often just be
2085 2087 named by their executable.
2086 2088
2087 2089 A merge tool is generally usable if its executable can be found on the
2088 2090 system and if it can handle the merge. The executable is found if it is an
2089 2091 absolute or relative executable path or the name of an application in the
2090 2092 executable search path. The tool is assumed to be able to handle the merge
2091 2093 if it can handle symlinks if the file is a symlink, if it can handle
2092 2094 binary files if the file is binary, and if a GUI is available if the tool
2093 2095 requires a GUI.
2094 2096
2095 2097 There are some internal merge tools which can be used. The internal merge
2096 2098 tools are:
2097 2099
2098 2100 ":dump"
2099 2101 Creates three versions of the files to merge, containing the contents of
2100 2102 local, other and base. These files can then be used to perform a merge
2101 2103 manually. If the file to be merged is named "a.txt", these files will
2102 2104 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
2103 2105 they will be placed in the same directory as "a.txt".
2104 2106
2105 2107 This implies premerge. Therefore, files aren't dumped, if premerge runs
2106 2108 successfully. Use :forcedump to forcibly write files out.
2107 2109
2108 2110 (actual capabilities: binary, symlink)
2109 2111
2110 2112 ":fail"
2111 2113 Rather than attempting to merge files that were modified on both
2112 2114 branches, it marks them as unresolved. The resolve command must be used
2113 2115 to resolve these conflicts.
2114 2116
2115 2117 (actual capabilities: binary, symlink)
2116 2118
2117 2119 ":forcedump"
2118 2120 Creates three versions of the files as same as :dump, but omits
2119 2121 premerge.
2120 2122
2121 2123 (actual capabilities: binary, symlink)
2122 2124
2123 2125 ":local"
2124 2126 Uses the local 'p1()' version of files as the merged version.
2125 2127
2126 2128 (actual capabilities: binary, symlink)
2127 2129
2128 2130 ":merge"
2129 2131 Uses the internal non-interactive simple merge algorithm for merging
2130 2132 files. It will fail if there are any conflicts and leave markers in the
2131 2133 partially merged file. Markers will have two sections, one for each side
2132 2134 of merge.
2133 2135
2134 2136 ":merge-local"
2135 2137 Like :merge, but resolve all conflicts non-interactively in favor of the
2136 2138 local 'p1()' changes.
2137 2139
2138 2140 ":merge-other"
2139 2141 Like :merge, but resolve all conflicts non-interactively in favor of the
2140 2142 other 'p2()' changes.
2141 2143
2142 2144 ":merge3"
2143 2145 Uses the internal non-interactive simple merge algorithm for merging
2144 2146 files. It will fail if there are any conflicts and leave markers in the
2145 2147 partially merged file. Marker will have three sections, one from each
2146 2148 side of the merge and one for the base content.
2147 2149
2148 2150 ":mergediff"
2149 2151 Uses the internal non-interactive simple merge algorithm for merging
2150 2152 files. It will fail if there are any conflicts and leave markers in the
2151 2153 partially merged file. The marker will have two sections, one with the
2152 2154 content from one side of the merge, and one with a diff from the base
2153 2155 content to the content on the other side. (experimental)
2154 2156
2155 2157 ":other"
2156 2158 Uses the other 'p2()' version of files as the merged version.
2157 2159
2158 2160 (actual capabilities: binary, symlink)
2159 2161
2160 2162 ":prompt"
2161 2163 Asks the user which of the local 'p1()' or the other 'p2()' version to
2162 2164 keep as the merged version.
2163 2165
2164 2166 (actual capabilities: binary, symlink)
2165 2167
2166 2168 ":tagmerge"
2167 2169 Uses the internal tag merge algorithm (experimental).
2168 2170
2169 2171 ":union"
2170 2172 Uses the internal non-interactive simple merge algorithm for merging
2171 2173 files. It will use both left and right sides for conflict regions. No
2172 2174 markers are inserted.
2173 2175
2174 2176 Internal tools are always available and do not require a GUI but will by
2175 2177 default not handle symlinks or binary files. See next section for detail
2176 2178 about "actual capabilities" described above.
2177 2179
2178 2180 Choosing a merge tool
2179 2181 =====================
2180 2182
2181 2183 Mercurial uses these rules when deciding which merge tool to use:
2182 2184
2183 2185 1. If a tool has been specified with the --tool option to merge or
2184 2186 resolve, it is used. If it is the name of a tool in the merge-tools
2185 2187 configuration, its configuration is used. Otherwise the specified tool
2186 2188 must be executable by the shell.
2187 2189 2. If the "HGMERGE" environment variable is present, its value is used and
2188 2190 must be executable by the shell.
2189 2191 3. If the filename of the file to be merged matches any of the patterns in
2190 2192 the merge-patterns configuration section, the first usable merge tool
2191 2193 corresponding to a matching pattern is used.
2192 2194 4. If ui.merge is set it will be considered next. If the value is not the
2193 2195 name of a configured tool, the specified value is used and must be
2194 2196 executable by the shell. Otherwise the named tool is used if it is
2195 2197 usable.
2196 2198 5. If any usable merge tools are present in the merge-tools configuration
2197 2199 section, the one with the highest priority is used.
2198 2200 6. If a program named "hgmerge" can be found on the system, it is used -
2199 2201 but it will by default not be used for symlinks and binary files.
2200 2202 7. If the file to be merged is not binary and is not a symlink, then
2201 2203 internal ":merge" is used.
2202 2204 8. Otherwise, ":prompt" is used.
2203 2205
2204 2206 For historical reason, Mercurial treats merge tools as below while
2205 2207 examining rules above.
2206 2208
2207 2209 step specified via binary symlink
2208 2210 ----------------------------------
2209 2211 1. --tool o/o o/o
2210 2212 2. HGMERGE o/o o/o
2211 2213 3. merge-patterns o/o(*) x/?(*)
2212 2214 4. ui.merge x/?(*) x/?(*)
2213 2215
2214 2216 Each capability column indicates Mercurial behavior for internal/external
2215 2217 merge tools at examining each rule.
2216 2218
2217 2219 - "o": "assume that a tool has capability"
2218 2220 - "x": "assume that a tool does not have capability"
2219 2221 - "?": "check actual capability of a tool"
2220 2222
2221 2223 If "merge.strict-capability-check" configuration is true, Mercurial checks
2222 2224 capabilities of merge tools strictly in (*) cases above (= each capability
2223 2225 column becomes "?/?"). It is false by default for backward compatibility.
2224 2226
2225 2227 Note:
2226 2228 After selecting a merge program, Mercurial will by default attempt to
2227 2229 merge the files using a simple merge algorithm first. Only if it
2228 2230 doesn't succeed because of conflicting changes will Mercurial actually
2229 2231 execute the merge program. Whether to use the simple merge algorithm
2230 2232 first can be controlled by the premerge setting of the merge tool.
2231 2233 Premerge is enabled by default unless the file is binary or a symlink.
2232 2234
2233 2235 See the merge-tools and ui sections of hgrc(5) for details on the
2234 2236 configuration of merge tools.
2235 2237
2236 2238 Compression engines listed in `hg help bundlespec`
2237 2239
2238 2240 $ hg help bundlespec | grep gzip
2239 2241 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
2240 2242 An algorithm that produces smaller bundles than "gzip".
2241 2243 This engine will likely produce smaller bundles than "gzip" but will be
2242 2244 "gzip"
2243 2245 better compression than "gzip". It also frequently yields better (?)
2244 2246
2245 2247 Test usage of section marks in help documents
2246 2248
2247 2249 $ cd "$TESTDIR"/../doc
2248 2250 $ "$PYTHON" check-seclevel.py
2249 2251 $ cd $TESTTMP
2250 2252
2251 2253 #if serve
2252 2254
2253 2255 Test the help pages in hgweb.
2254 2256
2255 2257 Dish up an empty repo; serve it cold.
2256 2258
2257 2259 $ hg init "$TESTTMP/test"
2258 2260 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
2259 2261 $ cat hg.pid >> $DAEMON_PIDS
2260 2262
2261 2263 $ get-with-headers.py $LOCALIP:$HGPORT "help"
2262 2264 200 Script output follows
2263 2265
2264 2266 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2265 2267 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2266 2268 <head>
2267 2269 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2268 2270 <meta name="robots" content="index, nofollow" />
2269 2271 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2270 2272 <script type="text/javascript" src="/static/mercurial.js"></script>
2271 2273
2272 2274 <title>Help: Index</title>
2273 2275 </head>
2274 2276 <body>
2275 2277
2276 2278 <div class="container">
2277 2279 <div class="menu">
2278 2280 <div class="logo">
2279 2281 <a href="https://mercurial-scm.org/">
2280 2282 <img src="/static/hglogo.png" alt="mercurial" /></a>
2281 2283 </div>
2282 2284 <ul>
2283 2285 <li><a href="/shortlog">log</a></li>
2284 2286 <li><a href="/graph">graph</a></li>
2285 2287 <li><a href="/tags">tags</a></li>
2286 2288 <li><a href="/bookmarks">bookmarks</a></li>
2287 2289 <li><a href="/branches">branches</a></li>
2288 2290 </ul>
2289 2291 <ul>
2290 2292 <li class="active">help</li>
2291 2293 </ul>
2292 2294 </div>
2293 2295
2294 2296 <div class="main">
2295 2297 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2296 2298
2297 2299 <form class="search" action="/log">
2298 2300
2299 2301 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2300 2302 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2301 2303 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2302 2304 </form>
2303 2305 <table class="bigtable">
2304 2306 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
2305 2307
2306 2308 <tr><td>
2307 2309 <a href="/help/bundlespec">
2308 2310 bundlespec
2309 2311 </a>
2310 2312 </td><td>
2311 2313 Bundle File Formats
2312 2314 </td></tr>
2313 2315 <tr><td>
2314 2316 <a href="/help/color">
2315 2317 color
2316 2318 </a>
2317 2319 </td><td>
2318 2320 Colorizing Outputs
2319 2321 </td></tr>
2320 2322 <tr><td>
2321 2323 <a href="/help/config">
2322 2324 config
2323 2325 </a>
2324 2326 </td><td>
2325 2327 Configuration Files
2326 2328 </td></tr>
2327 2329 <tr><td>
2328 2330 <a href="/help/dates">
2329 2331 dates
2330 2332 </a>
2331 2333 </td><td>
2332 2334 Date Formats
2333 2335 </td></tr>
2334 2336 <tr><td>
2335 2337 <a href="/help/deprecated">
2336 2338 deprecated
2337 2339 </a>
2338 2340 </td><td>
2339 2341 Deprecated Features
2340 2342 </td></tr>
2341 2343 <tr><td>
2342 2344 <a href="/help/diffs">
2343 2345 diffs
2344 2346 </a>
2345 2347 </td><td>
2346 2348 Diff Formats
2347 2349 </td></tr>
2348 2350 <tr><td>
2349 2351 <a href="/help/environment">
2350 2352 environment
2351 2353 </a>
2352 2354 </td><td>
2353 2355 Environment Variables
2354 2356 </td></tr>
2355 2357 <tr><td>
2356 2358 <a href="/help/evolution">
2357 2359 evolution
2358 2360 </a>
2359 2361 </td><td>
2360 2362 Safely rewriting history (EXPERIMENTAL)
2361 2363 </td></tr>
2362 2364 <tr><td>
2363 2365 <a href="/help/extensions">
2364 2366 extensions
2365 2367 </a>
2366 2368 </td><td>
2367 2369 Using Additional Features
2368 2370 </td></tr>
2369 2371 <tr><td>
2370 2372 <a href="/help/filesets">
2371 2373 filesets
2372 2374 </a>
2373 2375 </td><td>
2374 2376 Specifying File Sets
2375 2377 </td></tr>
2376 2378 <tr><td>
2377 2379 <a href="/help/flags">
2378 2380 flags
2379 2381 </a>
2380 2382 </td><td>
2381 2383 Command-line flags
2382 2384 </td></tr>
2383 2385 <tr><td>
2384 2386 <a href="/help/glossary">
2385 2387 glossary
2386 2388 </a>
2387 2389 </td><td>
2388 2390 Glossary
2389 2391 </td></tr>
2390 2392 <tr><td>
2391 2393 <a href="/help/hgignore">
2392 2394 hgignore
2393 2395 </a>
2394 2396 </td><td>
2395 2397 Syntax for Mercurial Ignore Files
2396 2398 </td></tr>
2397 2399 <tr><td>
2398 2400 <a href="/help/hgweb">
2399 2401 hgweb
2400 2402 </a>
2401 2403 </td><td>
2402 2404 Configuring hgweb
2403 2405 </td></tr>
2404 2406 <tr><td>
2405 2407 <a href="/help/internals">
2406 2408 internals
2407 2409 </a>
2408 2410 </td><td>
2409 2411 Technical implementation topics
2410 2412 </td></tr>
2411 2413 <tr><td>
2412 2414 <a href="/help/merge-tools">
2413 2415 merge-tools
2414 2416 </a>
2415 2417 </td><td>
2416 2418 Merge Tools
2417 2419 </td></tr>
2418 2420 <tr><td>
2419 2421 <a href="/help/pager">
2420 2422 pager
2421 2423 </a>
2422 2424 </td><td>
2423 2425 Pager Support
2424 2426 </td></tr>
2425 2427 <tr><td>
2426 2428 <a href="/help/patterns">
2427 2429 patterns
2428 2430 </a>
2429 2431 </td><td>
2430 2432 File Name Patterns
2431 2433 </td></tr>
2432 2434 <tr><td>
2433 2435 <a href="/help/phases">
2434 2436 phases
2435 2437 </a>
2436 2438 </td><td>
2437 2439 Working with Phases
2438 2440 </td></tr>
2439 2441 <tr><td>
2440 2442 <a href="/help/revisions">
2441 2443 revisions
2442 2444 </a>
2443 2445 </td><td>
2444 2446 Specifying Revisions
2445 2447 </td></tr>
2446 2448 <tr><td>
2447 2449 <a href="/help/rust">
2448 2450 rust
2449 2451 </a>
2450 2452 </td><td>
2451 2453 Rust in Mercurial
2452 2454 </td></tr>
2453 2455 <tr><td>
2454 2456 <a href="/help/scripting">
2455 2457 scripting
2456 2458 </a>
2457 2459 </td><td>
2458 2460 Using Mercurial from scripts and automation
2459 2461 </td></tr>
2460 2462 <tr><td>
2461 2463 <a href="/help/subrepos">
2462 2464 subrepos
2463 2465 </a>
2464 2466 </td><td>
2465 2467 Subrepositories
2466 2468 </td></tr>
2467 2469 <tr><td>
2468 2470 <a href="/help/templating">
2469 2471 templating
2470 2472 </a>
2471 2473 </td><td>
2472 2474 Template Usage
2473 2475 </td></tr>
2474 2476 <tr><td>
2475 2477 <a href="/help/urls">
2476 2478 urls
2477 2479 </a>
2478 2480 </td><td>
2479 2481 URL Paths
2480 2482 </td></tr>
2481 2483 <tr><td>
2482 2484 <a href="/help/topic-containing-verbose">
2483 2485 topic-containing-verbose
2484 2486 </a>
2485 2487 </td><td>
2486 2488 This is the topic to test omit indicating.
2487 2489 </td></tr>
2488 2490
2489 2491
2490 2492 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2491 2493
2492 2494 <tr><td>
2493 2495 <a href="/help/abort">
2494 2496 abort
2495 2497 </a>
2496 2498 </td><td>
2497 2499 abort an unfinished operation (EXPERIMENTAL)
2498 2500 </td></tr>
2499 2501 <tr><td>
2500 2502 <a href="/help/add">
2501 2503 add
2502 2504 </a>
2503 2505 </td><td>
2504 2506 add the specified files on the next commit
2505 2507 </td></tr>
2506 2508 <tr><td>
2507 2509 <a href="/help/annotate">
2508 2510 annotate
2509 2511 </a>
2510 2512 </td><td>
2511 2513 show changeset information by line for each file
2512 2514 </td></tr>
2513 2515 <tr><td>
2514 2516 <a href="/help/clone">
2515 2517 clone
2516 2518 </a>
2517 2519 </td><td>
2518 2520 make a copy of an existing repository
2519 2521 </td></tr>
2520 2522 <tr><td>
2521 2523 <a href="/help/commit">
2522 2524 commit
2523 2525 </a>
2524 2526 </td><td>
2525 2527 commit the specified files or all outstanding changes
2526 2528 </td></tr>
2527 2529 <tr><td>
2528 2530 <a href="/help/continue">
2529 2531 continue
2530 2532 </a>
2531 2533 </td><td>
2532 2534 resumes an interrupted operation (EXPERIMENTAL)
2533 2535 </td></tr>
2534 2536 <tr><td>
2535 2537 <a href="/help/diff">
2536 2538 diff
2537 2539 </a>
2538 2540 </td><td>
2539 2541 diff repository (or selected files)
2540 2542 </td></tr>
2541 2543 <tr><td>
2542 2544 <a href="/help/export">
2543 2545 export
2544 2546 </a>
2545 2547 </td><td>
2546 2548 dump the header and diffs for one or more changesets
2547 2549 </td></tr>
2548 2550 <tr><td>
2549 2551 <a href="/help/forget">
2550 2552 forget
2551 2553 </a>
2552 2554 </td><td>
2553 2555 forget the specified files on the next commit
2554 2556 </td></tr>
2555 2557 <tr><td>
2556 2558 <a href="/help/init">
2557 2559 init
2558 2560 </a>
2559 2561 </td><td>
2560 2562 create a new repository in the given directory
2561 2563 </td></tr>
2562 2564 <tr><td>
2563 2565 <a href="/help/log">
2564 2566 log
2565 2567 </a>
2566 2568 </td><td>
2567 2569 show revision history of entire repository or files
2568 2570 </td></tr>
2569 2571 <tr><td>
2570 2572 <a href="/help/merge">
2571 2573 merge
2572 2574 </a>
2573 2575 </td><td>
2574 2576 merge another revision into working directory
2575 2577 </td></tr>
2576 2578 <tr><td>
2577 2579 <a href="/help/pull">
2578 2580 pull
2579 2581 </a>
2580 2582 </td><td>
2581 2583 pull changes from the specified source
2582 2584 </td></tr>
2583 2585 <tr><td>
2584 2586 <a href="/help/push">
2585 2587 push
2586 2588 </a>
2587 2589 </td><td>
2588 2590 push changes to the specified destination
2589 2591 </td></tr>
2590 2592 <tr><td>
2591 2593 <a href="/help/remove">
2592 2594 remove
2593 2595 </a>
2594 2596 </td><td>
2595 2597 remove the specified files on the next commit
2596 2598 </td></tr>
2597 2599 <tr><td>
2598 2600 <a href="/help/serve">
2599 2601 serve
2600 2602 </a>
2601 2603 </td><td>
2602 2604 start stand-alone webserver
2603 2605 </td></tr>
2604 2606 <tr><td>
2605 2607 <a href="/help/status">
2606 2608 status
2607 2609 </a>
2608 2610 </td><td>
2609 2611 show changed files in the working directory
2610 2612 </td></tr>
2611 2613 <tr><td>
2612 2614 <a href="/help/summary">
2613 2615 summary
2614 2616 </a>
2615 2617 </td><td>
2616 2618 summarize working directory state
2617 2619 </td></tr>
2618 2620 <tr><td>
2619 2621 <a href="/help/update">
2620 2622 update
2621 2623 </a>
2622 2624 </td><td>
2623 2625 update working directory (or switch revisions)
2624 2626 </td></tr>
2625 2627
2626 2628
2627 2629
2628 2630 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2629 2631
2630 2632 <tr><td>
2631 2633 <a href="/help/addremove">
2632 2634 addremove
2633 2635 </a>
2634 2636 </td><td>
2635 2637 add all new files, delete all missing files
2636 2638 </td></tr>
2637 2639 <tr><td>
2638 2640 <a href="/help/archive">
2639 2641 archive
2640 2642 </a>
2641 2643 </td><td>
2642 2644 create an unversioned archive of a repository revision
2643 2645 </td></tr>
2644 2646 <tr><td>
2645 2647 <a href="/help/backout">
2646 2648 backout
2647 2649 </a>
2648 2650 </td><td>
2649 2651 reverse effect of earlier changeset
2650 2652 </td></tr>
2651 2653 <tr><td>
2652 2654 <a href="/help/bisect">
2653 2655 bisect
2654 2656 </a>
2655 2657 </td><td>
2656 2658 subdivision search of changesets
2657 2659 </td></tr>
2658 2660 <tr><td>
2659 2661 <a href="/help/bookmarks">
2660 2662 bookmarks
2661 2663 </a>
2662 2664 </td><td>
2663 2665 create a new bookmark or list existing bookmarks
2664 2666 </td></tr>
2665 2667 <tr><td>
2666 2668 <a href="/help/branch">
2667 2669 branch
2668 2670 </a>
2669 2671 </td><td>
2670 2672 set or show the current branch name
2671 2673 </td></tr>
2672 2674 <tr><td>
2673 2675 <a href="/help/branches">
2674 2676 branches
2675 2677 </a>
2676 2678 </td><td>
2677 2679 list repository named branches
2678 2680 </td></tr>
2679 2681 <tr><td>
2680 2682 <a href="/help/bundle">
2681 2683 bundle
2682 2684 </a>
2683 2685 </td><td>
2684 2686 create a bundle file
2685 2687 </td></tr>
2686 2688 <tr><td>
2687 2689 <a href="/help/cat">
2688 2690 cat
2689 2691 </a>
2690 2692 </td><td>
2691 2693 output the current or given revision of files
2692 2694 </td></tr>
2693 2695 <tr><td>
2694 2696 <a href="/help/config">
2695 2697 config
2696 2698 </a>
2697 2699 </td><td>
2698 2700 show combined config settings from all hgrc files
2699 2701 </td></tr>
2700 2702 <tr><td>
2701 2703 <a href="/help/copy">
2702 2704 copy
2703 2705 </a>
2704 2706 </td><td>
2705 2707 mark files as copied for the next commit
2706 2708 </td></tr>
2707 2709 <tr><td>
2708 2710 <a href="/help/files">
2709 2711 files
2710 2712 </a>
2711 2713 </td><td>
2712 2714 list tracked files
2713 2715 </td></tr>
2714 2716 <tr><td>
2715 2717 <a href="/help/graft">
2716 2718 graft
2717 2719 </a>
2718 2720 </td><td>
2719 2721 copy changes from other branches onto the current branch
2720 2722 </td></tr>
2721 2723 <tr><td>
2722 2724 <a href="/help/grep">
2723 2725 grep
2724 2726 </a>
2725 2727 </td><td>
2726 2728 search for a pattern in specified files
2727 2729 </td></tr>
2728 2730 <tr><td>
2729 2731 <a href="/help/hashelp">
2730 2732 hashelp
2731 2733 </a>
2732 2734 </td><td>
2733 2735 Extension command's help
2734 2736 </td></tr>
2735 2737 <tr><td>
2736 2738 <a href="/help/heads">
2737 2739 heads
2738 2740 </a>
2739 2741 </td><td>
2740 2742 show branch heads
2741 2743 </td></tr>
2742 2744 <tr><td>
2743 2745 <a href="/help/help">
2744 2746 help
2745 2747 </a>
2746 2748 </td><td>
2747 2749 show help for a given topic or a help overview
2748 2750 </td></tr>
2749 2751 <tr><td>
2750 2752 <a href="/help/hgalias">
2751 2753 hgalias
2752 2754 </a>
2753 2755 </td><td>
2754 2756 My doc
2755 2757 </td></tr>
2756 2758 <tr><td>
2757 2759 <a href="/help/hgaliasnodoc">
2758 2760 hgaliasnodoc
2759 2761 </a>
2760 2762 </td><td>
2761 2763 summarize working directory state
2762 2764 </td></tr>
2763 2765 <tr><td>
2764 2766 <a href="/help/identify">
2765 2767 identify
2766 2768 </a>
2767 2769 </td><td>
2768 2770 identify the working directory or specified revision
2769 2771 </td></tr>
2770 2772 <tr><td>
2771 2773 <a href="/help/import">
2772 2774 import
2773 2775 </a>
2774 2776 </td><td>
2775 2777 import an ordered set of patches
2776 2778 </td></tr>
2777 2779 <tr><td>
2778 2780 <a href="/help/incoming">
2779 2781 incoming
2780 2782 </a>
2781 2783 </td><td>
2782 2784 show new changesets found in source
2783 2785 </td></tr>
2784 2786 <tr><td>
2785 2787 <a href="/help/manifest">
2786 2788 manifest
2787 2789 </a>
2788 2790 </td><td>
2789 2791 output the current or given revision of the project manifest
2790 2792 </td></tr>
2791 2793 <tr><td>
2792 2794 <a href="/help/nohelp">
2793 2795 nohelp
2794 2796 </a>
2795 2797 </td><td>
2796 2798 (no help text available)
2797 2799 </td></tr>
2798 2800 <tr><td>
2799 2801 <a href="/help/outgoing">
2800 2802 outgoing
2801 2803 </a>
2802 2804 </td><td>
2803 2805 show changesets not found in the destination
2804 2806 </td></tr>
2805 2807 <tr><td>
2806 2808 <a href="/help/paths">
2807 2809 paths
2808 2810 </a>
2809 2811 </td><td>
2810 2812 show aliases for remote repositories
2811 2813 </td></tr>
2812 2814 <tr><td>
2813 2815 <a href="/help/phase">
2814 2816 phase
2815 2817 </a>
2816 2818 </td><td>
2817 2819 set or show the current phase name
2818 2820 </td></tr>
2819 2821 <tr><td>
2820 2822 <a href="/help/purge">
2821 2823 purge
2822 2824 </a>
2823 2825 </td><td>
2824 2826 removes files not tracked by Mercurial
2825 2827 </td></tr>
2826 2828 <tr><td>
2827 2829 <a href="/help/recover">
2828 2830 recover
2829 2831 </a>
2830 2832 </td><td>
2831 2833 roll back an interrupted transaction
2832 2834 </td></tr>
2833 2835 <tr><td>
2834 2836 <a href="/help/rename">
2835 2837 rename
2836 2838 </a>
2837 2839 </td><td>
2838 2840 rename files; equivalent of copy + remove
2839 2841 </td></tr>
2840 2842 <tr><td>
2841 2843 <a href="/help/resolve">
2842 2844 resolve
2843 2845 </a>
2844 2846 </td><td>
2845 2847 redo merges or set/view the merge status of files
2846 2848 </td></tr>
2847 2849 <tr><td>
2848 2850 <a href="/help/revert">
2849 2851 revert
2850 2852 </a>
2851 2853 </td><td>
2852 2854 restore files to their checkout state
2853 2855 </td></tr>
2854 2856 <tr><td>
2855 2857 <a href="/help/root">
2856 2858 root
2857 2859 </a>
2858 2860 </td><td>
2859 2861 print the root (top) of the current working directory
2860 2862 </td></tr>
2861 2863 <tr><td>
2862 2864 <a href="/help/shellalias">
2863 2865 shellalias
2864 2866 </a>
2865 2867 </td><td>
2866 2868 (no help text available)
2867 2869 </td></tr>
2868 2870 <tr><td>
2869 2871 <a href="/help/shelve">
2870 2872 shelve
2871 2873 </a>
2872 2874 </td><td>
2873 2875 save and set aside changes from the working directory
2874 2876 </td></tr>
2875 2877 <tr><td>
2876 2878 <a href="/help/tag">
2877 2879 tag
2878 2880 </a>
2879 2881 </td><td>
2880 2882 add one or more tags for the current or given revision
2881 2883 </td></tr>
2882 2884 <tr><td>
2883 2885 <a href="/help/tags">
2884 2886 tags
2885 2887 </a>
2886 2888 </td><td>
2887 2889 list repository tags
2888 2890 </td></tr>
2889 2891 <tr><td>
2890 2892 <a href="/help/unbundle">
2891 2893 unbundle
2892 2894 </a>
2893 2895 </td><td>
2894 2896 apply one or more bundle files
2895 2897 </td></tr>
2896 2898 <tr><td>
2897 2899 <a href="/help/unshelve">
2898 2900 unshelve
2899 2901 </a>
2900 2902 </td><td>
2901 2903 restore a shelved change to the working directory
2902 2904 </td></tr>
2903 2905 <tr><td>
2904 2906 <a href="/help/verify">
2905 2907 verify
2906 2908 </a>
2907 2909 </td><td>
2908 2910 verify the integrity of the repository
2909 2911 </td></tr>
2910 2912 <tr><td>
2911 2913 <a href="/help/version">
2912 2914 version
2913 2915 </a>
2914 2916 </td><td>
2915 2917 output version and copyright information
2916 2918 </td></tr>
2917 2919
2918 2920
2919 2921 </table>
2920 2922 </div>
2921 2923 </div>
2922 2924
2923 2925
2924 2926
2925 2927 </body>
2926 2928 </html>
2927 2929
2928 2930
2929 2931 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2930 2932 200 Script output follows
2931 2933
2932 2934 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2933 2935 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2934 2936 <head>
2935 2937 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2936 2938 <meta name="robots" content="index, nofollow" />
2937 2939 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2938 2940 <script type="text/javascript" src="/static/mercurial.js"></script>
2939 2941
2940 2942 <title>Help: add</title>
2941 2943 </head>
2942 2944 <body>
2943 2945
2944 2946 <div class="container">
2945 2947 <div class="menu">
2946 2948 <div class="logo">
2947 2949 <a href="https://mercurial-scm.org/">
2948 2950 <img src="/static/hglogo.png" alt="mercurial" /></a>
2949 2951 </div>
2950 2952 <ul>
2951 2953 <li><a href="/shortlog">log</a></li>
2952 2954 <li><a href="/graph">graph</a></li>
2953 2955 <li><a href="/tags">tags</a></li>
2954 2956 <li><a href="/bookmarks">bookmarks</a></li>
2955 2957 <li><a href="/branches">branches</a></li>
2956 2958 </ul>
2957 2959 <ul>
2958 2960 <li class="active"><a href="/help">help</a></li>
2959 2961 </ul>
2960 2962 </div>
2961 2963
2962 2964 <div class="main">
2963 2965 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2964 2966 <h3>Help: add</h3>
2965 2967
2966 2968 <form class="search" action="/log">
2967 2969
2968 2970 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2969 2971 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2970 2972 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2971 2973 </form>
2972 2974 <div id="doc">
2973 2975 <p>
2974 2976 hg add [OPTION]... [FILE]...
2975 2977 </p>
2976 2978 <p>
2977 2979 add the specified files on the next commit
2978 2980 </p>
2979 2981 <p>
2980 2982 Schedule files to be version controlled and added to the
2981 2983 repository.
2982 2984 </p>
2983 2985 <p>
2984 2986 The files will be added to the repository at the next commit. To
2985 2987 undo an add before that, see 'hg forget'.
2986 2988 </p>
2987 2989 <p>
2988 2990 If no names are given, add all files to the repository (except
2989 2991 files matching &quot;.hgignore&quot;).
2990 2992 </p>
2991 2993 <p>
2992 2994 Examples:
2993 2995 </p>
2994 2996 <ul>
2995 2997 <li> New (unknown) files are added automatically by 'hg add':
2996 2998 <pre>
2997 2999 \$ ls (re)
2998 3000 foo.c
2999 3001 \$ hg status (re)
3000 3002 ? foo.c
3001 3003 \$ hg add (re)
3002 3004 adding foo.c
3003 3005 \$ hg status (re)
3004 3006 A foo.c
3005 3007 </pre>
3006 3008 <li> Specific files to be added can be specified:
3007 3009 <pre>
3008 3010 \$ ls (re)
3009 3011 bar.c foo.c
3010 3012 \$ hg status (re)
3011 3013 ? bar.c
3012 3014 ? foo.c
3013 3015 \$ hg add bar.c (re)
3014 3016 \$ hg status (re)
3015 3017 A bar.c
3016 3018 ? foo.c
3017 3019 </pre>
3018 3020 </ul>
3019 3021 <p>
3020 3022 Returns 0 if all files are successfully added.
3021 3023 </p>
3022 3024 <p>
3023 3025 options ([+] can be repeated):
3024 3026 </p>
3025 3027 <table>
3026 3028 <tr><td>-I</td>
3027 3029 <td>--include PATTERN [+]</td>
3028 3030 <td>include names matching the given patterns</td></tr>
3029 3031 <tr><td>-X</td>
3030 3032 <td>--exclude PATTERN [+]</td>
3031 3033 <td>exclude names matching the given patterns</td></tr>
3032 3034 <tr><td>-S</td>
3033 3035 <td>--subrepos</td>
3034 3036 <td>recurse into subrepositories</td></tr>
3035 3037 <tr><td>-n</td>
3036 3038 <td>--dry-run</td>
3037 3039 <td>do not perform actions, just print output</td></tr>
3038 3040 </table>
3039 3041 <p>
3040 3042 global options ([+] can be repeated):
3041 3043 </p>
3042 3044 <table>
3043 3045 <tr><td>-R</td>
3044 3046 <td>--repository REPO</td>
3045 3047 <td>repository root directory or name of overlay bundle file</td></tr>
3046 3048 <tr><td></td>
3047 3049 <td>--cwd DIR</td>
3048 3050 <td>change working directory</td></tr>
3049 3051 <tr><td>-y</td>
3050 3052 <td>--noninteractive</td>
3051 3053 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
3052 3054 <tr><td>-q</td>
3053 3055 <td>--quiet</td>
3054 3056 <td>suppress output</td></tr>
3055 3057 <tr><td>-v</td>
3056 3058 <td>--verbose</td>
3057 3059 <td>enable additional output</td></tr>
3058 3060 <tr><td></td>
3059 3061 <td>--color TYPE</td>
3060 3062 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
3061 3063 <tr><td></td>
3062 3064 <td>--config CONFIG [+]</td>
3063 3065 <td>set/override config option (use 'section.name=value')</td></tr>
3064 3066 <tr><td></td>
3065 3067 <td>--debug</td>
3066 3068 <td>enable debugging output</td></tr>
3067 3069 <tr><td></td>
3068 3070 <td>--debugger</td>
3069 3071 <td>start debugger</td></tr>
3070 3072 <tr><td></td>
3071 3073 <td>--encoding ENCODE</td>
3072 3074 <td>set the charset encoding (default: ascii)</td></tr>
3073 3075 <tr><td></td>
3074 3076 <td>--encodingmode MODE</td>
3075 3077 <td>set the charset encoding mode (default: strict)</td></tr>
3076 3078 <tr><td></td>
3077 3079 <td>--traceback</td>
3078 3080 <td>always print a traceback on exception</td></tr>
3079 3081 <tr><td></td>
3080 3082 <td>--time</td>
3081 3083 <td>time how long the command takes</td></tr>
3082 3084 <tr><td></td>
3083 3085 <td>--profile</td>
3084 3086 <td>print command execution profile</td></tr>
3085 3087 <tr><td></td>
3086 3088 <td>--version</td>
3087 3089 <td>output version information and exit</td></tr>
3088 3090 <tr><td>-h</td>
3089 3091 <td>--help</td>
3090 3092 <td>display help and exit</td></tr>
3091 3093 <tr><td></td>
3092 3094 <td>--hidden</td>
3093 3095 <td>consider hidden changesets</td></tr>
3094 3096 <tr><td></td>
3095 3097 <td>--pager TYPE</td>
3096 3098 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
3097 3099 </table>
3098 3100
3099 3101 </div>
3100 3102 </div>
3101 3103 </div>
3102 3104
3103 3105
3104 3106
3105 3107 </body>
3106 3108 </html>
3107 3109
3108 3110
3109 3111 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
3110 3112 200 Script output follows
3111 3113
3112 3114 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3113 3115 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3114 3116 <head>
3115 3117 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3116 3118 <meta name="robots" content="index, nofollow" />
3117 3119 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3118 3120 <script type="text/javascript" src="/static/mercurial.js"></script>
3119 3121
3120 3122 <title>Help: remove</title>
3121 3123 </head>
3122 3124 <body>
3123 3125
3124 3126 <div class="container">
3125 3127 <div class="menu">
3126 3128 <div class="logo">
3127 3129 <a href="https://mercurial-scm.org/">
3128 3130 <img src="/static/hglogo.png" alt="mercurial" /></a>
3129 3131 </div>
3130 3132 <ul>
3131 3133 <li><a href="/shortlog">log</a></li>
3132 3134 <li><a href="/graph">graph</a></li>
3133 3135 <li><a href="/tags">tags</a></li>
3134 3136 <li><a href="/bookmarks">bookmarks</a></li>
3135 3137 <li><a href="/branches">branches</a></li>
3136 3138 </ul>
3137 3139 <ul>
3138 3140 <li class="active"><a href="/help">help</a></li>
3139 3141 </ul>
3140 3142 </div>
3141 3143
3142 3144 <div class="main">
3143 3145 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3144 3146 <h3>Help: remove</h3>
3145 3147
3146 3148 <form class="search" action="/log">
3147 3149
3148 3150 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3149 3151 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3150 3152 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3151 3153 </form>
3152 3154 <div id="doc">
3153 3155 <p>
3154 3156 hg remove [OPTION]... FILE...
3155 3157 </p>
3156 3158 <p>
3157 3159 aliases: rm
3158 3160 </p>
3159 3161 <p>
3160 3162 remove the specified files on the next commit
3161 3163 </p>
3162 3164 <p>
3163 3165 Schedule the indicated files for removal from the current branch.
3164 3166 </p>
3165 3167 <p>
3166 3168 This command schedules the files to be removed at the next commit.
3167 3169 To undo a remove before that, see 'hg revert'. To undo added
3168 3170 files, see 'hg forget'.
3169 3171 </p>
3170 3172 <p>
3171 3173 -A/--after can be used to remove only files that have already
3172 3174 been deleted, -f/--force can be used to force deletion, and -Af
3173 3175 can be used to remove files from the next revision without
3174 3176 deleting them from the working directory.
3175 3177 </p>
3176 3178 <p>
3177 3179 The following table details the behavior of remove for different
3178 3180 file states (columns) and option combinations (rows). The file
3179 3181 states are Added [A], Clean [C], Modified [M] and Missing [!]
3180 3182 (as reported by 'hg status'). The actions are Warn, Remove
3181 3183 (from branch) and Delete (from disk):
3182 3184 </p>
3183 3185 <table>
3184 3186 <tr><td>opt/state</td>
3185 3187 <td>A</td>
3186 3188 <td>C</td>
3187 3189 <td>M</td>
3188 3190 <td>!</td></tr>
3189 3191 <tr><td>none</td>
3190 3192 <td>W</td>
3191 3193 <td>RD</td>
3192 3194 <td>W</td>
3193 3195 <td>R</td></tr>
3194 3196 <tr><td>-f</td>
3195 3197 <td>R</td>
3196 3198 <td>RD</td>
3197 3199 <td>RD</td>
3198 3200 <td>R</td></tr>
3199 3201 <tr><td>-A</td>
3200 3202 <td>W</td>
3201 3203 <td>W</td>
3202 3204 <td>W</td>
3203 3205 <td>R</td></tr>
3204 3206 <tr><td>-Af</td>
3205 3207 <td>R</td>
3206 3208 <td>R</td>
3207 3209 <td>R</td>
3208 3210 <td>R</td></tr>
3209 3211 </table>
3210 3212 <p>
3211 3213 <b>Note:</b>
3212 3214 </p>
3213 3215 <p>
3214 3216 'hg remove' never deletes files in Added [A] state from the
3215 3217 working directory, not even if &quot;--force&quot; is specified.
3216 3218 </p>
3217 3219 <p>
3218 3220 Returns 0 on success, 1 if any warnings encountered.
3219 3221 </p>
3220 3222 <p>
3221 3223 options ([+] can be repeated):
3222 3224 </p>
3223 3225 <table>
3224 3226 <tr><td>-A</td>
3225 3227 <td>--after</td>
3226 3228 <td>record delete for missing files</td></tr>
3227 3229 <tr><td>-f</td>
3228 3230 <td>--force</td>
3229 3231 <td>forget added files, delete modified files</td></tr>
3230 3232 <tr><td>-S</td>
3231 3233 <td>--subrepos</td>
3232 3234 <td>recurse into subrepositories</td></tr>
3233 3235 <tr><td>-I</td>
3234 3236 <td>--include PATTERN [+]</td>
3235 3237 <td>include names matching the given patterns</td></tr>
3236 3238 <tr><td>-X</td>
3237 3239 <td>--exclude PATTERN [+]</td>
3238 3240 <td>exclude names matching the given patterns</td></tr>
3239 3241 <tr><td>-n</td>
3240 3242 <td>--dry-run</td>
3241 3243 <td>do not perform actions, just print output</td></tr>
3242 3244 </table>
3243 3245 <p>
3244 3246 global options ([+] can be repeated):
3245 3247 </p>
3246 3248 <table>
3247 3249 <tr><td>-R</td>
3248 3250 <td>--repository REPO</td>
3249 3251 <td>repository root directory or name of overlay bundle file</td></tr>
3250 3252 <tr><td></td>
3251 3253 <td>--cwd DIR</td>
3252 3254 <td>change working directory</td></tr>
3253 3255 <tr><td>-y</td>
3254 3256 <td>--noninteractive</td>
3255 3257 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
3256 3258 <tr><td>-q</td>
3257 3259 <td>--quiet</td>
3258 3260 <td>suppress output</td></tr>
3259 3261 <tr><td>-v</td>
3260 3262 <td>--verbose</td>
3261 3263 <td>enable additional output</td></tr>
3262 3264 <tr><td></td>
3263 3265 <td>--color TYPE</td>
3264 3266 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
3265 3267 <tr><td></td>
3266 3268 <td>--config CONFIG [+]</td>
3267 3269 <td>set/override config option (use 'section.name=value')</td></tr>
3268 3270 <tr><td></td>
3269 3271 <td>--debug</td>
3270 3272 <td>enable debugging output</td></tr>
3271 3273 <tr><td></td>
3272 3274 <td>--debugger</td>
3273 3275 <td>start debugger</td></tr>
3274 3276 <tr><td></td>
3275 3277 <td>--encoding ENCODE</td>
3276 3278 <td>set the charset encoding (default: ascii)</td></tr>
3277 3279 <tr><td></td>
3278 3280 <td>--encodingmode MODE</td>
3279 3281 <td>set the charset encoding mode (default: strict)</td></tr>
3280 3282 <tr><td></td>
3281 3283 <td>--traceback</td>
3282 3284 <td>always print a traceback on exception</td></tr>
3283 3285 <tr><td></td>
3284 3286 <td>--time</td>
3285 3287 <td>time how long the command takes</td></tr>
3286 3288 <tr><td></td>
3287 3289 <td>--profile</td>
3288 3290 <td>print command execution profile</td></tr>
3289 3291 <tr><td></td>
3290 3292 <td>--version</td>
3291 3293 <td>output version information and exit</td></tr>
3292 3294 <tr><td>-h</td>
3293 3295 <td>--help</td>
3294 3296 <td>display help and exit</td></tr>
3295 3297 <tr><td></td>
3296 3298 <td>--hidden</td>
3297 3299 <td>consider hidden changesets</td></tr>
3298 3300 <tr><td></td>
3299 3301 <td>--pager TYPE</td>
3300 3302 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
3301 3303 </table>
3302 3304
3303 3305 </div>
3304 3306 </div>
3305 3307 </div>
3306 3308
3307 3309
3308 3310
3309 3311 </body>
3310 3312 </html>
3311 3313
3312 3314
3313 3315 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
3314 3316 200 Script output follows
3315 3317
3316 3318 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3317 3319 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3318 3320 <head>
3319 3321 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3320 3322 <meta name="robots" content="index, nofollow" />
3321 3323 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3322 3324 <script type="text/javascript" src="/static/mercurial.js"></script>
3323 3325
3324 3326 <title>Help: dates</title>
3325 3327 </head>
3326 3328 <body>
3327 3329
3328 3330 <div class="container">
3329 3331 <div class="menu">
3330 3332 <div class="logo">
3331 3333 <a href="https://mercurial-scm.org/">
3332 3334 <img src="/static/hglogo.png" alt="mercurial" /></a>
3333 3335 </div>
3334 3336 <ul>
3335 3337 <li><a href="/shortlog">log</a></li>
3336 3338 <li><a href="/graph">graph</a></li>
3337 3339 <li><a href="/tags">tags</a></li>
3338 3340 <li><a href="/bookmarks">bookmarks</a></li>
3339 3341 <li><a href="/branches">branches</a></li>
3340 3342 </ul>
3341 3343 <ul>
3342 3344 <li class="active"><a href="/help">help</a></li>
3343 3345 </ul>
3344 3346 </div>
3345 3347
3346 3348 <div class="main">
3347 3349 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3348 3350 <h3>Help: dates</h3>
3349 3351
3350 3352 <form class="search" action="/log">
3351 3353
3352 3354 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3353 3355 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3354 3356 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3355 3357 </form>
3356 3358 <div id="doc">
3357 3359 <h1>Date Formats</h1>
3358 3360 <p>
3359 3361 Some commands allow the user to specify a date, e.g.:
3360 3362 </p>
3361 3363 <ul>
3362 3364 <li> backout, commit, import, tag: Specify the commit date.
3363 3365 <li> log, revert, update: Select revision(s) by date.
3364 3366 </ul>
3365 3367 <p>
3366 3368 Many date formats are valid. Here are some examples:
3367 3369 </p>
3368 3370 <ul>
3369 3371 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
3370 3372 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
3371 3373 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
3372 3374 <li> &quot;Dec 6&quot; (midnight)
3373 3375 <li> &quot;13:18&quot; (today assumed)
3374 3376 <li> &quot;3:39&quot; (3:39AM assumed)
3375 3377 <li> &quot;3:39pm&quot; (15:39)
3376 3378 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
3377 3379 <li> &quot;2006-12-6 13:18&quot;
3378 3380 <li> &quot;2006-12-6&quot;
3379 3381 <li> &quot;12-6&quot;
3380 3382 <li> &quot;12/6&quot;
3381 3383 <li> &quot;12/6/6&quot; (Dec 6 2006)
3382 3384 <li> &quot;today&quot; (midnight)
3383 3385 <li> &quot;yesterday&quot; (midnight)
3384 3386 <li> &quot;now&quot; - right now
3385 3387 </ul>
3386 3388 <p>
3387 3389 Lastly, there is Mercurial's internal format:
3388 3390 </p>
3389 3391 <ul>
3390 3392 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
3391 3393 </ul>
3392 3394 <p>
3393 3395 This is the internal representation format for dates. The first number
3394 3396 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
3395 3397 second is the offset of the local timezone, in seconds west of UTC
3396 3398 (negative if the timezone is east of UTC).
3397 3399 </p>
3398 3400 <p>
3399 3401 The log command also accepts date ranges:
3400 3402 </p>
3401 3403 <ul>
3402 3404 <li> &quot;&lt;DATE&quot; - at or before a given date/time
3403 3405 <li> &quot;&gt;DATE&quot; - on or after a given date/time
3404 3406 <li> &quot;DATE to DATE&quot; - a date range, inclusive
3405 3407 <li> &quot;-DAYS&quot; - within a given number of days from today
3406 3408 </ul>
3407 3409
3408 3410 </div>
3409 3411 </div>
3410 3412 </div>
3411 3413
3412 3414
3413 3415
3414 3416 </body>
3415 3417 </html>
3416 3418
3417 3419
3418 3420 $ get-with-headers.py $LOCALIP:$HGPORT "help/pager"
3419 3421 200 Script output follows
3420 3422
3421 3423 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3422 3424 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3423 3425 <head>
3424 3426 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3425 3427 <meta name="robots" content="index, nofollow" />
3426 3428 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3427 3429 <script type="text/javascript" src="/static/mercurial.js"></script>
3428 3430
3429 3431 <title>Help: pager</title>
3430 3432 </head>
3431 3433 <body>
3432 3434
3433 3435 <div class="container">
3434 3436 <div class="menu">
3435 3437 <div class="logo">
3436 3438 <a href="https://mercurial-scm.org/">
3437 3439 <img src="/static/hglogo.png" alt="mercurial" /></a>
3438 3440 </div>
3439 3441 <ul>
3440 3442 <li><a href="/shortlog">log</a></li>
3441 3443 <li><a href="/graph">graph</a></li>
3442 3444 <li><a href="/tags">tags</a></li>
3443 3445 <li><a href="/bookmarks">bookmarks</a></li>
3444 3446 <li><a href="/branches">branches</a></li>
3445 3447 </ul>
3446 3448 <ul>
3447 3449 <li class="active"><a href="/help">help</a></li>
3448 3450 </ul>
3449 3451 </div>
3450 3452
3451 3453 <div class="main">
3452 3454 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3453 3455 <h3>Help: pager</h3>
3454 3456
3455 3457 <form class="search" action="/log">
3456 3458
3457 3459 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3458 3460 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3459 3461 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3460 3462 </form>
3461 3463 <div id="doc">
3462 3464 <h1>Pager Support</h1>
3463 3465 <p>
3464 3466 Some Mercurial commands can produce a lot of output, and Mercurial will
3465 3467 attempt to use a pager to make those commands more pleasant.
3466 3468 </p>
3467 3469 <p>
3468 3470 To set the pager that should be used, set the application variable:
3469 3471 </p>
3470 3472 <pre>
3471 3473 [pager]
3472 3474 pager = less -FRX
3473 3475 </pre>
3474 3476 <p>
3475 3477 If no pager is set in the user or repository configuration, Mercurial uses the
3476 3478 environment variable $PAGER. If $PAGER is not set, pager.pager from the default
3477 3479 or system configuration is used. If none of these are set, a default pager will
3478 3480 be used, typically 'less' on Unix and 'more' on Windows.
3479 3481 </p>
3480 3482 <p>
3481 3483 You can disable the pager for certain commands by adding them to the
3482 3484 pager.ignore list:
3483 3485 </p>
3484 3486 <pre>
3485 3487 [pager]
3486 3488 ignore = version, help, update
3487 3489 </pre>
3488 3490 <p>
3489 3491 To ignore global commands like 'hg version' or 'hg help', you have
3490 3492 to specify them in your user configuration file.
3491 3493 </p>
3492 3494 <p>
3493 3495 To control whether the pager is used at all for an individual command,
3494 3496 you can use --pager=&lt;value&gt;:
3495 3497 </p>
3496 3498 <ul>
3497 3499 <li> use as needed: 'auto'.
3498 3500 <li> require the pager: 'yes' or 'on'.
3499 3501 <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work).
3500 3502 </ul>
3501 3503 <p>
3502 3504 To globally turn off all attempts to use a pager, set:
3503 3505 </p>
3504 3506 <pre>
3505 3507 [ui]
3506 3508 paginate = never
3507 3509 </pre>
3508 3510 <p>
3509 3511 which will prevent the pager from running.
3510 3512 </p>
3511 3513
3512 3514 </div>
3513 3515 </div>
3514 3516 </div>
3515 3517
3516 3518
3517 3519
3518 3520 </body>
3519 3521 </html>
3520 3522
3521 3523
3522 3524 Sub-topic indexes rendered properly
3523 3525
3524 3526 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3525 3527 200 Script output follows
3526 3528
3527 3529 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3528 3530 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3529 3531 <head>
3530 3532 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3531 3533 <meta name="robots" content="index, nofollow" />
3532 3534 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3533 3535 <script type="text/javascript" src="/static/mercurial.js"></script>
3534 3536
3535 3537 <title>Help: internals</title>
3536 3538 </head>
3537 3539 <body>
3538 3540
3539 3541 <div class="container">
3540 3542 <div class="menu">
3541 3543 <div class="logo">
3542 3544 <a href="https://mercurial-scm.org/">
3543 3545 <img src="/static/hglogo.png" alt="mercurial" /></a>
3544 3546 </div>
3545 3547 <ul>
3546 3548 <li><a href="/shortlog">log</a></li>
3547 3549 <li><a href="/graph">graph</a></li>
3548 3550 <li><a href="/tags">tags</a></li>
3549 3551 <li><a href="/bookmarks">bookmarks</a></li>
3550 3552 <li><a href="/branches">branches</a></li>
3551 3553 </ul>
3552 3554 <ul>
3553 3555 <li><a href="/help">help</a></li>
3554 3556 </ul>
3555 3557 </div>
3556 3558
3557 3559 <div class="main">
3558 3560 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3559 3561
3560 3562 <form class="search" action="/log">
3561 3563
3562 3564 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3563 3565 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3564 3566 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3565 3567 </form>
3566 3568 <table class="bigtable">
3567 3569 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3568 3570
3569 3571 <tr><td>
3570 3572 <a href="/help/internals.bid-merge">
3571 3573 bid-merge
3572 3574 </a>
3573 3575 </td><td>
3574 3576 Bid Merge Algorithm
3575 3577 </td></tr>
3576 3578 <tr><td>
3577 3579 <a href="/help/internals.bundle2">
3578 3580 bundle2
3579 3581 </a>
3580 3582 </td><td>
3581 3583 Bundle2
3582 3584 </td></tr>
3583 3585 <tr><td>
3584 3586 <a href="/help/internals.bundles">
3585 3587 bundles
3586 3588 </a>
3587 3589 </td><td>
3588 3590 Bundles
3589 3591 </td></tr>
3590 3592 <tr><td>
3591 3593 <a href="/help/internals.cbor">
3592 3594 cbor
3593 3595 </a>
3594 3596 </td><td>
3595 3597 CBOR
3596 3598 </td></tr>
3597 3599 <tr><td>
3598 3600 <a href="/help/internals.censor">
3599 3601 censor
3600 3602 </a>
3601 3603 </td><td>
3602 3604 Censor
3603 3605 </td></tr>
3604 3606 <tr><td>
3605 3607 <a href="/help/internals.changegroups">
3606 3608 changegroups
3607 3609 </a>
3608 3610 </td><td>
3609 3611 Changegroups
3610 3612 </td></tr>
3611 3613 <tr><td>
3612 3614 <a href="/help/internals.config">
3613 3615 config
3614 3616 </a>
3615 3617 </td><td>
3616 3618 Config Registrar
3617 3619 </td></tr>
3618 3620 <tr><td>
3619 3621 <a href="/help/internals.dirstate-v2">
3620 3622 dirstate-v2
3621 3623 </a>
3622 3624 </td><td>
3623 3625 dirstate-v2 file format
3624 3626 </td></tr>
3625 3627 <tr><td>
3626 3628 <a href="/help/internals.extensions">
3627 3629 extensions
3628 3630 </a>
3629 3631 </td><td>
3630 3632 Extension API
3631 3633 </td></tr>
3632 3634 <tr><td>
3633 3635 <a href="/help/internals.mergestate">
3634 3636 mergestate
3635 3637 </a>
3636 3638 </td><td>
3637 3639 Mergestate
3638 3640 </td></tr>
3639 3641 <tr><td>
3640 3642 <a href="/help/internals.requirements">
3641 3643 requirements
3642 3644 </a>
3643 3645 </td><td>
3644 3646 Repository Requirements
3645 3647 </td></tr>
3646 3648 <tr><td>
3647 3649 <a href="/help/internals.revlogs">
3648 3650 revlogs
3649 3651 </a>
3650 3652 </td><td>
3651 3653 Revision Logs
3652 3654 </td></tr>
3653 3655 <tr><td>
3654 3656 <a href="/help/internals.wireprotocol">
3655 3657 wireprotocol
3656 3658 </a>
3657 3659 </td><td>
3658 3660 Wire Protocol
3659 3661 </td></tr>
3660 3662 <tr><td>
3661 3663 <a href="/help/internals.wireprotocolrpc">
3662 3664 wireprotocolrpc
3663 3665 </a>
3664 3666 </td><td>
3665 3667 Wire Protocol RPC
3666 3668 </td></tr>
3667 3669 <tr><td>
3668 3670 <a href="/help/internals.wireprotocolv2">
3669 3671 wireprotocolv2
3670 3672 </a>
3671 3673 </td><td>
3672 3674 Wire Protocol Version 2
3673 3675 </td></tr>
3674 3676
3675 3677
3676 3678
3677 3679
3678 3680
3679 3681 </table>
3680 3682 </div>
3681 3683 </div>
3682 3684
3683 3685
3684 3686
3685 3687 </body>
3686 3688 </html>
3687 3689
3688 3690
3689 3691 Sub-topic topics rendered properly
3690 3692
3691 3693 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3692 3694 200 Script output follows
3693 3695
3694 3696 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3695 3697 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3696 3698 <head>
3697 3699 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3698 3700 <meta name="robots" content="index, nofollow" />
3699 3701 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3700 3702 <script type="text/javascript" src="/static/mercurial.js"></script>
3701 3703
3702 3704 <title>Help: internals.changegroups</title>
3703 3705 </head>
3704 3706 <body>
3705 3707
3706 3708 <div class="container">
3707 3709 <div class="menu">
3708 3710 <div class="logo">
3709 3711 <a href="https://mercurial-scm.org/">
3710 3712 <img src="/static/hglogo.png" alt="mercurial" /></a>
3711 3713 </div>
3712 3714 <ul>
3713 3715 <li><a href="/shortlog">log</a></li>
3714 3716 <li><a href="/graph">graph</a></li>
3715 3717 <li><a href="/tags">tags</a></li>
3716 3718 <li><a href="/bookmarks">bookmarks</a></li>
3717 3719 <li><a href="/branches">branches</a></li>
3718 3720 </ul>
3719 3721 <ul>
3720 3722 <li class="active"><a href="/help">help</a></li>
3721 3723 </ul>
3722 3724 </div>
3723 3725
3724 3726 <div class="main">
3725 3727 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3726 3728 <h3>Help: internals.changegroups</h3>
3727 3729
3728 3730 <form class="search" action="/log">
3729 3731
3730 3732 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3731 3733 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3732 3734 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3733 3735 </form>
3734 3736 <div id="doc">
3735 3737 <h1>Changegroups</h1>
3736 3738 <p>
3737 3739 Changegroups are representations of repository revlog data, specifically
3738 3740 the changelog data, root/flat manifest data, treemanifest data, and
3739 3741 filelogs.
3740 3742 </p>
3741 3743 <p>
3742 3744 There are 4 versions of changegroups: &quot;1&quot;, &quot;2&quot;, &quot;3&quot; and &quot;4&quot;. From a
3743 3745 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3744 3746 only difference being an additional item in the *delta header*. Version
3745 3747 &quot;3&quot; adds support for storage flags in the *delta header* and optionally
3746 3748 exchanging treemanifests (enabled by setting an option on the
3747 3749 &quot;changegroup&quot; part in the bundle2). Version &quot;4&quot; adds support for exchanging
3748 3750 sidedata (additional revision metadata not part of the digest).
3749 3751 </p>
3750 3752 <p>
3751 3753 Changegroups when not exchanging treemanifests consist of 3 logical
3752 3754 segments:
3753 3755 </p>
3754 3756 <pre>
3755 3757 +---------------------------------+
3756 3758 | | | |
3757 3759 | changeset | manifest | filelogs |
3758 3760 | | | |
3759 3761 | | | |
3760 3762 +---------------------------------+
3761 3763 </pre>
3762 3764 <p>
3763 3765 When exchanging treemanifests, there are 4 logical segments:
3764 3766 </p>
3765 3767 <pre>
3766 3768 +-------------------------------------------------+
3767 3769 | | | | |
3768 3770 | changeset | root | treemanifests | filelogs |
3769 3771 | | manifest | | |
3770 3772 | | | | |
3771 3773 +-------------------------------------------------+
3772 3774 </pre>
3773 3775 <p>
3774 3776 The principle building block of each segment is a *chunk*. A *chunk*
3775 3777 is a framed piece of data:
3776 3778 </p>
3777 3779 <pre>
3778 3780 +---------------------------------------+
3779 3781 | | |
3780 3782 | length | data |
3781 3783 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3782 3784 | | |
3783 3785 +---------------------------------------+
3784 3786 </pre>
3785 3787 <p>
3786 3788 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3787 3789 integer indicating the length of the entire chunk (including the length field
3788 3790 itself).
3789 3791 </p>
3790 3792 <p>
3791 3793 There is a special case chunk that has a value of 0 for the length
3792 3794 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3793 3795 </p>
3794 3796 <h2>Delta Groups</h2>
3795 3797 <p>
3796 3798 A *delta group* expresses the content of a revlog as a series of deltas,
3797 3799 or patches against previous revisions.
3798 3800 </p>
3799 3801 <p>
3800 3802 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3801 3803 to signal the end of the delta group:
3802 3804 </p>
3803 3805 <pre>
3804 3806 +------------------------------------------------------------------------+
3805 3807 | | | | | |
3806 3808 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3807 3809 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3808 3810 | | | | | |
3809 3811 +------------------------------------------------------------------------+
3810 3812 </pre>
3811 3813 <p>
3812 3814 Each *chunk*'s data consists of the following:
3813 3815 </p>
3814 3816 <pre>
3815 3817 +---------------------------------------+
3816 3818 | | |
3817 3819 | delta header | delta data |
3818 3820 | (various by version) | (various) |
3819 3821 | | |
3820 3822 +---------------------------------------+
3821 3823 </pre>
3822 3824 <p>
3823 3825 The *delta data* is a series of *delta*s that describe a diff from an existing
3824 3826 entry (either that the recipient already has, or previously specified in the
3825 3827 bundle/changegroup).
3826 3828 </p>
3827 3829 <p>
3828 3830 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, &quot;3&quot; and &quot;4&quot;
3829 3831 of the changegroup format.
3830 3832 </p>
3831 3833 <p>
3832 3834 Version 1 (headerlen=80):
3833 3835 </p>
3834 3836 <pre>
3835 3837 +------------------------------------------------------+
3836 3838 | | | | |
3837 3839 | node | p1 node | p2 node | link node |
3838 3840 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3839 3841 | | | | |
3840 3842 +------------------------------------------------------+
3841 3843 </pre>
3842 3844 <p>
3843 3845 Version 2 (headerlen=100):
3844 3846 </p>
3845 3847 <pre>
3846 3848 +------------------------------------------------------------------+
3847 3849 | | | | | |
3848 3850 | node | p1 node | p2 node | base node | link node |
3849 3851 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3850 3852 | | | | | |
3851 3853 +------------------------------------------------------------------+
3852 3854 </pre>
3853 3855 <p>
3854 3856 Version 3 (headerlen=102):
3855 3857 </p>
3856 3858 <pre>
3857 3859 +------------------------------------------------------------------------------+
3858 3860 | | | | | | |
3859 3861 | node | p1 node | p2 node | base node | link node | flags |
3860 3862 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3861 3863 | | | | | | |
3862 3864 +------------------------------------------------------------------------------+
3863 3865 </pre>
3864 3866 <p>
3865 3867 Version 4 (headerlen=103):
3866 3868 </p>
3867 3869 <pre>
3868 3870 +------------------------------------------------------------------------------+----------+
3869 3871 | | | | | | | |
3870 3872 | node | p1 node | p2 node | base node | link node | flags | pflags |
3871 3873 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | (1 byte) |
3872 3874 | | | | | | | |
3873 3875 +------------------------------------------------------------------------------+----------+
3874 3876 </pre>
3875 3877 <p>
3876 3878 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3877 3879 series of *delta*s, densely packed (no separators). These deltas describe a diff
3878 3880 from an existing entry (either that the recipient already has, or previously
3879 3881 specified in the bundle/changegroup). The format is described more fully in
3880 3882 &quot;hg help internals.bdiff&quot;, but briefly:
3881 3883 </p>
3882 3884 <pre>
3883 3885 +---------------------------------------------------------------+
3884 3886 | | | | |
3885 3887 | start offset | end offset | new length | content |
3886 3888 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3887 3889 | | | | |
3888 3890 +---------------------------------------------------------------+
3889 3891 </pre>
3890 3892 <p>
3891 3893 Please note that the length field in the delta data does *not* include itself.
3892 3894 </p>
3893 3895 <p>
3894 3896 In version 1, the delta is always applied against the previous node from
3895 3897 the changegroup or the first parent if this is the first entry in the
3896 3898 changegroup.
3897 3899 </p>
3898 3900 <p>
3899 3901 In version 2 and up, the delta base node is encoded in the entry in the
3900 3902 changegroup. This allows the delta to be expressed against any parent,
3901 3903 which can result in smaller deltas and more efficient encoding of data.
3902 3904 </p>
3903 3905 <p>
3904 3906 The *flags* field holds bitwise flags affecting the processing of revision
3905 3907 data. The following flags are defined:
3906 3908 </p>
3907 3909 <dl>
3908 3910 <dt>32768
3909 3911 <dd>Censored revision. The revision's fulltext has been replaced by censor metadata. May only occur on file revisions.
3910 3912 <dt>16384
3911 3913 <dd>Ellipsis revision. Revision hash does not match data (likely due to rewritten parents).
3912 3914 <dt>8192
3913 3915 <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.
3914 3916 <dt>4096
3915 3917 <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.
3916 3918 </dl>
3917 3919 <p>
3918 3920 For historical reasons, the integer values are identical to revlog version 1
3919 3921 per-revision storage flags and correspond to bits being set in this 2-byte
3920 3922 field. Bits were allocated starting from the most-significant bit, hence the
3921 3923 reverse ordering and allocation of these flags.
3922 3924 </p>
3923 3925 <p>
3924 3926 The *pflags* (protocol flags) field holds bitwise flags affecting the protocol
3925 3927 itself. They are first in the header since they may affect the handling of the
3926 3928 rest of the fields in a future version. They are defined as such:
3927 3929 </p>
3928 3930 <dl>
3929 3931 <dt>1 indicates whether to read a chunk of sidedata (of variable length) right
3930 3932 <dd>after the revision flags.
3931 3933 </dl>
3932 3934 <h2>Changeset Segment</h2>
3933 3935 <p>
3934 3936 The *changeset segment* consists of a single *delta group* holding
3935 3937 changelog data. The *empty chunk* at the end of the *delta group* denotes
3936 3938 the boundary to the *manifest segment*.
3937 3939 </p>
3938 3940 <h2>Manifest Segment</h2>
3939 3941 <p>
3940 3942 The *manifest segment* consists of a single *delta group* holding manifest
3941 3943 data. If treemanifests are in use, it contains only the manifest for the
3942 3944 root directory of the repository. Otherwise, it contains the entire
3943 3945 manifest data. The *empty chunk* at the end of the *delta group* denotes
3944 3946 the boundary to the next segment (either the *treemanifests segment* or the
3945 3947 *filelogs segment*, depending on version and the request options).
3946 3948 </p>
3947 3949 <h3>Treemanifests Segment</h3>
3948 3950 <p>
3949 3951 The *treemanifests segment* only exists in changegroup version &quot;3&quot; and &quot;4&quot;,
3950 3952 and only if the 'treemanifest' param is part of the bundle2 changegroup part
3951 3953 (it is not possible to use changegroup version 3 or 4 outside of bundle2).
3952 3954 Aside from the filenames in the *treemanifests segment* containing a
3953 3955 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3954 3956 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3955 3957 a sub-segment with filename size 0). This denotes the boundary to the
3956 3958 *filelogs segment*.
3957 3959 </p>
3958 3960 <h2>Filelogs Segment</h2>
3959 3961 <p>
3960 3962 The *filelogs segment* consists of multiple sub-segments, each
3961 3963 corresponding to an individual file whose data is being described:
3962 3964 </p>
3963 3965 <pre>
3964 3966 +--------------------------------------------------+
3965 3967 | | | | | |
3966 3968 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3967 3969 | | | | | (4 bytes) |
3968 3970 | | | | | |
3969 3971 +--------------------------------------------------+
3970 3972 </pre>
3971 3973 <p>
3972 3974 The final filelog sub-segment is followed by an *empty chunk* (logically,
3973 3975 a sub-segment with filename size 0). This denotes the end of the segment
3974 3976 and of the overall changegroup.
3975 3977 </p>
3976 3978 <p>
3977 3979 Each filelog sub-segment consists of the following:
3978 3980 </p>
3979 3981 <pre>
3980 3982 +------------------------------------------------------+
3981 3983 | | | |
3982 3984 | filename length | filename | delta group |
3983 3985 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3984 3986 | | | |
3985 3987 +------------------------------------------------------+
3986 3988 </pre>
3987 3989 <p>
3988 3990 That is, a *chunk* consisting of the filename (not terminated or padded)
3989 3991 followed by N chunks constituting the *delta group* for this file. The
3990 3992 *empty chunk* at the end of each *delta group* denotes the boundary to the
3991 3993 next filelog sub-segment.
3992 3994 </p>
3993 3995
3994 3996 </div>
3995 3997 </div>
3996 3998 </div>
3997 3999
3998 4000
3999 4001
4000 4002 </body>
4001 4003 </html>
4002 4004
4003 4005
4004 4006 $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic"
4005 4007 404 Not Found
4006 4008
4007 4009 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4008 4010 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
4009 4011 <head>
4010 4012 <link rel="icon" href="/static/hgicon.png" type="image/png" />
4011 4013 <meta name="robots" content="index, nofollow" />
4012 4014 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
4013 4015 <script type="text/javascript" src="/static/mercurial.js"></script>
4014 4016
4015 4017 <title>test: error</title>
4016 4018 </head>
4017 4019 <body>
4018 4020
4019 4021 <div class="container">
4020 4022 <div class="menu">
4021 4023 <div class="logo">
4022 4024 <a href="https://mercurial-scm.org/">
4023 4025 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
4024 4026 </div>
4025 4027 <ul>
4026 4028 <li><a href="/shortlog">log</a></li>
4027 4029 <li><a href="/graph">graph</a></li>
4028 4030 <li><a href="/tags">tags</a></li>
4029 4031 <li><a href="/bookmarks">bookmarks</a></li>
4030 4032 <li><a href="/branches">branches</a></li>
4031 4033 </ul>
4032 4034 <ul>
4033 4035 <li><a href="/help">help</a></li>
4034 4036 </ul>
4035 4037 </div>
4036 4038
4037 4039 <div class="main">
4038 4040
4039 4041 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
4040 4042 <h3>error</h3>
4041 4043
4042 4044
4043 4045 <form class="search" action="/log">
4044 4046
4045 4047 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
4046 4048 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
4047 4049 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
4048 4050 </form>
4049 4051
4050 4052 <div class="description">
4051 4053 <p>
4052 4054 An error occurred while processing your request:
4053 4055 </p>
4054 4056 <p>
4055 4057 Not Found
4056 4058 </p>
4057 4059 </div>
4058 4060 </div>
4059 4061 </div>
4060 4062
4061 4063
4062 4064
4063 4065 </body>
4064 4066 </html>
4065 4067
4066 4068 [1]
4067 4069
4068 4070 $ killdaemons.py
4069 4071
4070 4072 #endif
@@ -1,2130 +1,2128
1 1 #require no-reposimplestore
2 2
3 3 $ cat >> $HGRCPATH << EOF
4 4 > [extensions]
5 5 > share =
6 6 > [format]
7 7 > # stabilize test accross variant
8 8 > revlog-compression=zlib
9 9 > [storage]
10 10 > dirstate-v2.slow-path=allow
11 11 > EOF
12 12
13 13 store and revlogv1 are required in source
14 14
15 15 $ hg --config format.usestore=false init no-store
16 16 $ hg -R no-store debugupgraderepo
17 17 abort: cannot upgrade repository; requirement missing: store
18 18 [255]
19 19
20 20 $ hg init no-revlogv1
21 21 $ cat > no-revlogv1/.hg/requires << EOF
22 22 > dotencode
23 23 > fncache
24 24 > generaldelta
25 25 > store
26 26 > EOF
27 27
28 28 $ hg -R no-revlogv1 debugupgraderepo
29 29 abort: cannot upgrade repository; missing a revlog version
30 30 [255]
31 31
32 32 Cannot upgrade shared repositories
33 33
34 34 $ hg init share-parent
35 35 $ hg -R share-parent debugbuilddag -n .+9
36 36 $ hg -R share-parent up tip
37 37 10 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 38 $ hg -q share share-parent share-child
39 39
40 40 $ hg -R share-child debugupgraderepo --config format.sparse-revlog=no
41 41 abort: cannot use these actions on a share repository: sparserevlog
42 42 (upgrade the main repository directly)
43 43 [255]
44 44
45 45 Unless the action is compatible with share
46 46
47 47 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet
48 48 requirements
49 49 preserved: * (glob)
50 50 added: dirstate-v2
51 51
52 52 no revlogs to process
53 53
54 54
55 55 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet --run
56 56 upgrade will perform the following actions:
57 57
58 58 requirements
59 59 preserved: * (glob)
60 60 added: dirstate-v2
61 61
62 62 no revlogs to process
63 63
64 64 $ hg debugformat -R share-child | grep dirstate-v2
65 65 dirstate-v2: yes
66 66 $ hg debugformat -R share-parent | grep dirstate-v2
67 67 dirstate-v2: no
68 68 $ hg status --all -R share-child
69 69 C nf0
70 70 C nf1
71 71 C nf2
72 72 C nf3
73 73 C nf4
74 74 C nf5
75 75 C nf6
76 76 C nf7
77 77 C nf8
78 78 C nf9
79 79 $ hg log -l 3 -R share-child
80 80 changeset: 9:0059eb38e4a4
81 81 tag: tip
82 82 user: debugbuilddag
83 83 date: Thu Jan 01 00:00:09 1970 +0000
84 84 summary: r9
85 85
86 86 changeset: 8:4d5be70c8130
87 87 user: debugbuilddag
88 88 date: Thu Jan 01 00:00:08 1970 +0000
89 89 summary: r8
90 90
91 91 changeset: 7:e60bfe72517e
92 92 user: debugbuilddag
93 93 date: Thu Jan 01 00:00:07 1970 +0000
94 94 summary: r7
95 95
96 96 $ hg status --all -R share-parent
97 97 C nf0
98 98 C nf1
99 99 C nf2
100 100 C nf3
101 101 C nf4
102 102 C nf5
103 103 C nf6
104 104 C nf7
105 105 C nf8
106 106 C nf9
107 107 $ hg log -l 3 -R share-parent
108 108 changeset: 9:0059eb38e4a4
109 109 tag: tip
110 110 user: debugbuilddag
111 111 date: Thu Jan 01 00:00:09 1970 +0000
112 112 summary: r9
113 113
114 114 changeset: 8:4d5be70c8130
115 115 user: debugbuilddag
116 116 date: Thu Jan 01 00:00:08 1970 +0000
117 117 summary: r8
118 118
119 119 changeset: 7:e60bfe72517e
120 120 user: debugbuilddag
121 121 date: Thu Jan 01 00:00:07 1970 +0000
122 122 summary: r7
123 123
124 124
125 125 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=no --quiet --run
126 126 upgrade will perform the following actions:
127 127
128 128 requirements
129 129 preserved: * (glob)
130 130 removed: dirstate-v2
131 131
132 132 no revlogs to process
133 133
134 134 $ hg debugformat -R share-child | grep dirstate-v2
135 135 dirstate-v2: no
136 136 $ hg debugformat -R share-parent | grep dirstate-v2
137 137 dirstate-v2: no
138 138 $ hg status --all -R share-child
139 139 C nf0
140 140 C nf1
141 141 C nf2
142 142 C nf3
143 143 C nf4
144 144 C nf5
145 145 C nf6
146 146 C nf7
147 147 C nf8
148 148 C nf9
149 149 $ hg log -l 3 -R share-child
150 150 changeset: 9:0059eb38e4a4
151 151 tag: tip
152 152 user: debugbuilddag
153 153 date: Thu Jan 01 00:00:09 1970 +0000
154 154 summary: r9
155 155
156 156 changeset: 8:4d5be70c8130
157 157 user: debugbuilddag
158 158 date: Thu Jan 01 00:00:08 1970 +0000
159 159 summary: r8
160 160
161 161 changeset: 7:e60bfe72517e
162 162 user: debugbuilddag
163 163 date: Thu Jan 01 00:00:07 1970 +0000
164 164 summary: r7
165 165
166 166 $ hg status --all -R share-parent
167 167 C nf0
168 168 C nf1
169 169 C nf2
170 170 C nf3
171 171 C nf4
172 172 C nf5
173 173 C nf6
174 174 C nf7
175 175 C nf8
176 176 C nf9
177 177 $ hg log -l 3 -R share-parent
178 178 changeset: 9:0059eb38e4a4
179 179 tag: tip
180 180 user: debugbuilddag
181 181 date: Thu Jan 01 00:00:09 1970 +0000
182 182 summary: r9
183 183
184 184 changeset: 8:4d5be70c8130
185 185 user: debugbuilddag
186 186 date: Thu Jan 01 00:00:08 1970 +0000
187 187 summary: r8
188 188
189 189 changeset: 7:e60bfe72517e
190 190 user: debugbuilddag
191 191 date: Thu Jan 01 00:00:07 1970 +0000
192 192 summary: r7
193 193
194 194
195 195 Do not yet support upgrading treemanifest repos
196 196
197 197 $ hg --config experimental.treemanifest=true init treemanifest
198 198 $ hg -R treemanifest debugupgraderepo
199 199 abort: cannot upgrade repository; unsupported source requirement: treemanifest
200 200 [255]
201 201
202 202 Cannot add treemanifest requirement during upgrade
203 203
204 204 $ hg init disallowaddedreq
205 205 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
206 206 abort: cannot upgrade repository; do not support adding requirement: treemanifest
207 207 [255]
208 208
209 209 An upgrade of a repository created with recommended settings only suggests optimizations
210 210
211 211 $ hg init empty
212 212 $ cd empty
213 213 $ hg debugformat
214 214 format-variant repo
215 215 fncache: yes
216 216 dirstate-v2: no
217 217 tracked-hint: no
218 218 dotencode: yes
219 219 generaldelta: yes
220 220 share-safe: yes
221 221 sparserevlog: yes
222 222 persistent-nodemap: no (no-rust !)
223 223 persistent-nodemap: yes (rust !)
224 224 copies-sdc: no
225 225 revlog-v2: no
226 226 changelog-v2: no
227 227 plain-cl-delta: yes
228 228 compression: zlib
229 229 compression-level: default
230 230 $ hg debugformat --verbose
231 231 format-variant repo config default
232 232 fncache: yes yes yes
233 233 dirstate-v2: no no no
234 234 tracked-hint: no no no
235 235 dotencode: yes yes yes
236 236 generaldelta: yes yes yes
237 237 share-safe: yes yes yes
238 238 sparserevlog: yes yes yes
239 239 persistent-nodemap: no no no (no-rust !)
240 240 persistent-nodemap: yes yes no (rust !)
241 241 copies-sdc: no no no
242 242 revlog-v2: no no no
243 243 changelog-v2: no no no
244 244 plain-cl-delta: yes yes yes
245 245 compression: zlib zlib zlib (no-zstd !)
246 246 compression: zlib zlib zstd (zstd !)
247 247 compression-level: default default default
248 248 $ hg debugformat --verbose --config format.usefncache=no
249 249 format-variant repo config default
250 250 fncache: yes no yes
251 251 dirstate-v2: no no no
252 252 tracked-hint: no no no
253 253 dotencode: yes no yes
254 254 generaldelta: yes yes yes
255 255 share-safe: yes yes yes
256 256 sparserevlog: yes yes yes
257 257 persistent-nodemap: no no no (no-rust !)
258 258 persistent-nodemap: yes yes no (rust !)
259 259 copies-sdc: no no no
260 260 revlog-v2: no no no
261 261 changelog-v2: no no no
262 262 plain-cl-delta: yes yes yes
263 263 compression: zlib zlib zlib (no-zstd !)
264 264 compression: zlib zlib zstd (zstd !)
265 265 compression-level: default default default
266 266 $ hg debugformat --verbose --config format.usefncache=no --color=debug
267 267 format-variant repo config default
268 268 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
269 269 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
270 270 [formatvariant.name.uptodate|tracked-hint: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
271 271 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
272 272 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
273 273 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
274 274 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
275 275 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
276 276 [formatvariant.name.mismatchdefault|persistent-nodemap:][formatvariant.repo.mismatchdefault| yes][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
277 277 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
278 278 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
279 279 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
280 280 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
281 281 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
282 282 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
283 283 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
284 284 $ hg debugformat -Tjson
285 285 [
286 286 {
287 287 "config": true,
288 288 "default": true,
289 289 "name": "fncache",
290 290 "repo": true
291 291 },
292 292 {
293 293 "config": false,
294 294 "default": false,
295 295 "name": "dirstate-v2",
296 296 "repo": false
297 297 },
298 298 {
299 299 "config": false,
300 300 "default": false,
301 301 "name": "tracked-hint",
302 302 "repo": false
303 303 },
304 304 {
305 305 "config": true,
306 306 "default": true,
307 307 "name": "dotencode",
308 308 "repo": true
309 309 },
310 310 {
311 311 "config": true,
312 312 "default": true,
313 313 "name": "generaldelta",
314 314 "repo": true
315 315 },
316 316 {
317 317 "config": true,
318 318 "default": true,
319 319 "name": "share-safe",
320 320 "repo": true
321 321 },
322 322 {
323 323 "config": true,
324 324 "default": true,
325 325 "name": "sparserevlog",
326 326 "repo": true
327 327 },
328 328 {
329 329 "config": false, (no-rust !)
330 330 "config": true, (rust !)
331 331 "default": false,
332 332 "name": "persistent-nodemap",
333 333 "repo": false (no-rust !)
334 334 "repo": true (rust !)
335 335 },
336 336 {
337 337 "config": false,
338 338 "default": false,
339 339 "name": "copies-sdc",
340 340 "repo": false
341 341 },
342 342 {
343 343 "config": false,
344 344 "default": false,
345 345 "name": "revlog-v2",
346 346 "repo": false
347 347 },
348 348 {
349 349 "config": false,
350 350 "default": false,
351 351 "name": "changelog-v2",
352 352 "repo": false
353 353 },
354 354 {
355 355 "config": true,
356 356 "default": true,
357 357 "name": "plain-cl-delta",
358 358 "repo": true
359 359 },
360 360 {
361 361 "config": "zlib",
362 362 "default": "zlib", (no-zstd !)
363 363 "default": "zstd", (zstd !)
364 364 "name": "compression",
365 365 "repo": "zlib"
366 366 },
367 367 {
368 368 "config": "default",
369 369 "default": "default",
370 370 "name": "compression-level",
371 371 "repo": "default"
372 372 }
373 373 ]
374 374 $ hg debugupgraderepo
375 375 (no format upgrades found in existing repository)
376 376 performing an upgrade with "--run" will make the following changes:
377 377
378 378 requirements
379 379 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
380 380 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
381 381
382 382 no revlogs to process
383 383
384 384 additional optimizations are available by specifying "--optimize <name>":
385 385
386 386 re-delta-parent
387 387 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
388 388
389 389 re-delta-multibase
390 390 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
391 391
392 392 re-delta-all
393 393 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
394 394
395 395 re-delta-fulladd
396 396 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
397 397
398 398
399 399 $ hg debugupgraderepo --quiet
400 400 requirements
401 401 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
402 402 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
403 403
404 404 no revlogs to process
405 405
406 406
407 407 --optimize can be used to add optimizations
408 408
409 409 $ hg debugupgrade --optimize 're-delta-parent'
410 410 (no format upgrades found in existing repository)
411 411 performing an upgrade with "--run" will make the following changes:
412 412
413 413 requirements
414 414 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
415 415 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
416 416
417 417 optimisations: re-delta-parent
418 418
419 419 re-delta-parent
420 420 deltas within internal storage will choose a new base revision if needed
421 421
422 422 processed revlogs:
423 423 - all-filelogs
424 424 - changelog
425 425 - manifest
426 426
427 427 additional optimizations are available by specifying "--optimize <name>":
428 428
429 429 re-delta-multibase
430 430 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
431 431
432 432 re-delta-all
433 433 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
434 434
435 435 re-delta-fulladd
436 436 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
437 437
438 438
439 439 modern form of the option
440 440
441 441 $ hg debugupgrade --optimize re-delta-parent
442 442 (no format upgrades found in existing repository)
443 443 performing an upgrade with "--run" will make the following changes:
444 444
445 445 requirements
446 446 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
447 447 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
448 448
449 449 optimisations: re-delta-parent
450 450
451 451 re-delta-parent
452 452 deltas within internal storage will choose a new base revision if needed
453 453
454 454 processed revlogs:
455 455 - all-filelogs
456 456 - changelog
457 457 - manifest
458 458
459 459 additional optimizations are available by specifying "--optimize <name>":
460 460
461 461 re-delta-multibase
462 462 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
463 463
464 464 re-delta-all
465 465 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
466 466
467 467 re-delta-fulladd
468 468 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
469 469
470 470 $ hg debugupgrade --optimize re-delta-parent --quiet
471 471 requirements
472 472 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
473 473 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
474 474
475 475 optimisations: re-delta-parent
476 476
477 477 processed revlogs:
478 478 - all-filelogs
479 479 - changelog
480 480 - manifest
481 481
482 482
483 483 unknown optimization:
484 484
485 485 $ hg debugupgrade --optimize foobar
486 486 abort: unknown optimization action requested: foobar
487 487 (run without arguments to see valid optimizations)
488 488 [255]
489 489
490 490 Various sub-optimal detections work
491 491
492 492 $ cat > .hg/requires << EOF
493 493 > revlogv1
494 494 > store
495 495 > EOF
496 496
497 497 $ hg debugformat
498 498 format-variant repo
499 499 fncache: no
500 500 dirstate-v2: no
501 501 tracked-hint: no
502 502 dotencode: no
503 503 generaldelta: no
504 504 share-safe: no
505 505 sparserevlog: no
506 506 persistent-nodemap: no
507 507 copies-sdc: no
508 508 revlog-v2: no
509 509 changelog-v2: no
510 510 plain-cl-delta: yes
511 511 compression: zlib
512 512 compression-level: default
513 513 $ hg debugformat --verbose
514 514 format-variant repo config default
515 515 fncache: no yes yes
516 516 dirstate-v2: no no no
517 517 tracked-hint: no no no
518 518 dotencode: no yes yes
519 519 generaldelta: no yes yes
520 520 share-safe: no yes yes
521 521 sparserevlog: no yes yes
522 522 persistent-nodemap: no no no (no-rust !)
523 523 persistent-nodemap: no yes no (rust !)
524 524 copies-sdc: no no no
525 525 revlog-v2: no no no
526 526 changelog-v2: no no no
527 527 plain-cl-delta: yes yes yes
528 528 compression: zlib zlib zlib (no-zstd !)
529 529 compression: zlib zlib zstd (zstd !)
530 530 compression-level: default default default
531 531 $ hg debugformat --verbose --config format.usegeneraldelta=no
532 532 format-variant repo config default
533 533 fncache: no yes yes
534 534 dirstate-v2: no no no
535 535 tracked-hint: no no no
536 536 dotencode: no yes yes
537 537 generaldelta: no no yes
538 538 share-safe: no yes yes
539 539 sparserevlog: no no yes
540 540 persistent-nodemap: no no no (no-rust !)
541 541 persistent-nodemap: no yes no (rust !)
542 542 copies-sdc: no no no
543 543 revlog-v2: no no no
544 544 changelog-v2: no no no
545 545 plain-cl-delta: yes yes yes
546 546 compression: zlib zlib zlib (no-zstd !)
547 547 compression: zlib zlib zstd (zstd !)
548 548 compression-level: default default default
549 549 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
550 550 format-variant repo config default
551 551 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
552 552 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
553 553 [formatvariant.name.uptodate|tracked-hint: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
554 554 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
555 555 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
556 556 [formatvariant.name.mismatchconfig|share-safe: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
557 557 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
558 558 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
559 559 [formatvariant.name.mismatchconfig|persistent-nodemap:][formatvariant.repo.mismatchconfig| no][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
560 560 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
561 561 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
562 562 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
563 563 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
564 564 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
565 565 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
566 566 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
567 567 $ hg debugupgraderepo
568 568 note: selecting all-filelogs for processing to change: dotencode
569 569 note: selecting all-manifestlogs for processing to change: dotencode
570 570 note: selecting changelog for processing to change: dotencode
571 571
572 572 repository lacks features recommended by current config options:
573 573
574 574 fncache
575 575 long and reserved filenames may not work correctly; repository performance is sub-optimal
576 576
577 577 dotencode
578 578 storage of filenames beginning with a period or space may not work correctly
579 579
580 580 generaldelta
581 581 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
582 582
583 583 share-safe
584 584 old shared repositories do not share source repository requirements and config. This leads to various problems when the source repository format is upgraded or some new extensions are enabled.
585 585
586 586 sparserevlog
587 587 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
588 588
589 589 persistent-nodemap (rust !)
590 590 persist the node -> rev mapping on disk to speedup lookup (rust !)
591 591 (rust !)
592 592
593 593 performing an upgrade with "--run" will make the following changes:
594 594
595 595 requirements
596 596 preserved: revlogv1, store
597 597 added: dotencode, fncache, generaldelta, share-safe, sparserevlog (no-rust !)
598 598 added: dotencode, fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
599 599
600 600 fncache
601 601 repository will be more resilient to storing certain paths and performance of certain operations should be improved
602 602
603 603 dotencode
604 604 repository will be better able to store files beginning with a space or period
605 605
606 606 generaldelta
607 607 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
608 608
609 609 share-safe
610 610 Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
611 611
612 612 sparserevlog
613 613 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
614 614
615 615 persistent-nodemap (rust !)
616 616 Speedup revision lookup by node id. (rust !)
617 617 (rust !)
618 618 processed revlogs:
619 619 - all-filelogs
620 620 - changelog
621 621 - manifest
622 622
623 623 additional optimizations are available by specifying "--optimize <name>":
624 624
625 625 re-delta-parent
626 626 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
627 627
628 628 re-delta-multibase
629 629 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
630 630
631 631 re-delta-all
632 632 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
633 633
634 634 re-delta-fulladd
635 635 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
636 636
637 637 $ hg debugupgraderepo --quiet
638 638 requirements
639 639 preserved: revlogv1, store
640 640 added: dotencode, fncache, generaldelta, share-safe, sparserevlog (no-rust !)
641 641 added: dotencode, fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
642 642
643 643 processed revlogs:
644 644 - all-filelogs
645 645 - changelog
646 646 - manifest
647 647
648 648
649 649 $ hg --config format.dotencode=false debugupgraderepo
650 650 note: selecting all-filelogs for processing to change: fncache
651 651 note: selecting all-manifestlogs for processing to change: fncache
652 652 note: selecting changelog for processing to change: fncache
653 653
654 654 repository lacks features recommended by current config options:
655 655
656 656 fncache
657 657 long and reserved filenames may not work correctly; repository performance is sub-optimal
658 658
659 659 generaldelta
660 660 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
661 661
662 662 share-safe
663 663 old shared repositories do not share source repository requirements and config. This leads to various problems when the source repository format is upgraded or some new extensions are enabled.
664 664
665 665 sparserevlog
666 666 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
667 667
668 668 persistent-nodemap (rust !)
669 669 persist the node -> rev mapping on disk to speedup lookup (rust !)
670 670 (rust !)
671 671 repository lacks features used by the default config options:
672 672
673 673 dotencode
674 674 storage of filenames beginning with a period or space may not work correctly
675 675
676 676
677 677 performing an upgrade with "--run" will make the following changes:
678 678
679 679 requirements
680 680 preserved: revlogv1, store
681 681 added: fncache, generaldelta, share-safe, sparserevlog (no-rust !)
682 682 added: fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
683 683
684 684 fncache
685 685 repository will be more resilient to storing certain paths and performance of certain operations should be improved
686 686
687 687 generaldelta
688 688 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
689 689
690 690 share-safe
691 691 Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
692 692
693 693 sparserevlog
694 694 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
695 695
696 696 persistent-nodemap (rust !)
697 697 Speedup revision lookup by node id. (rust !)
698 698 (rust !)
699 699 processed revlogs:
700 700 - all-filelogs
701 701 - changelog
702 702 - manifest
703 703
704 704 additional optimizations are available by specifying "--optimize <name>":
705 705
706 706 re-delta-parent
707 707 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
708 708
709 709 re-delta-multibase
710 710 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
711 711
712 712 re-delta-all
713 713 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
714 714
715 715 re-delta-fulladd
716 716 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
717 717
718 718
719 719 $ cd ..
720 720
721 721 Upgrading a repository that is already modern essentially no-ops
722 722
723 723 $ hg init modern
724 724 $ hg -R modern debugupgraderepo --run
725 725 nothing to do
726 726
727 727 Upgrading a repository to generaldelta works
728 728
729 729 $ hg --config format.usegeneraldelta=false init upgradegd
730 730 $ cd upgradegd
731 731 $ touch f0
732 732 $ hg -q commit -A -m initial
733 733 $ mkdir FooBarDirectory.d
734 734 $ touch FooBarDirectory.d/f1
735 735 $ hg -q commit -A -m 'add f1'
736 736 $ hg -q up -r 0
737 737 >>> import random
738 738 >>> random.seed(0) # have a reproducible content
739 739 >>> with open("f2", "wb") as f:
740 740 ... for i in range(100000):
741 741 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
742 742 $ hg -q commit -A -m 'add f2'
743 743
744 744 make sure we have a .d file
745 745
746 746 $ ls -d .hg/store/data/*
747 747 .hg/store/data/_foo_bar_directory.d.hg
748 748 .hg/store/data/f0.i
749 749 .hg/store/data/f2.d
750 750 .hg/store/data/f2.i
751 751
752 752 $ hg debugupgraderepo --run --config format.sparse-revlog=false
753 753 note: selecting all-filelogs for processing to change: generaldelta
754 754 note: selecting all-manifestlogs for processing to change: generaldelta
755 755 note: selecting changelog for processing to change: generaldelta
756 756
757 757 upgrade will perform the following actions:
758 758
759 759 requirements
760 760 preserved: dotencode, fncache, revlogv1, share-safe, store (no-rust !)
761 761 preserved: dotencode, fncache, persistent-nodemap, revlogv1, share-safe, store (rust !)
762 762 added: generaldelta
763 763
764 764 generaldelta
765 765 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
766 766
767 767 processed revlogs:
768 768 - all-filelogs
769 769 - changelog
770 770 - manifest
771 771
772 772 beginning upgrade...
773 773 repository locked and read-only
774 774 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
775 775 (it is safe to interrupt this process any time before data migration completes)
776 776 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
777 777 migrating 519 KB in store; 1.05 MB tracked data
778 778 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
779 779 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
780 780 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
781 781 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
782 782 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
783 783 finished migrating 3 changelog revisions; change in size: 0 bytes
784 784 finished migrating 9 total revisions; total change in store size: -17 bytes
785 785 copying phaseroots
786 786 copying requires
787 787 data fully upgraded in a temporary repository
788 788 marking source repository as being upgraded; clients will be unable to read from repository
789 789 starting in-place swap of repository data
790 790 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
791 791 replacing store...
792 792 store replacement complete; repository was inconsistent for *s (glob)
793 793 finalizing requirements file and making repository readable again
794 794 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
795 795 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
796 796 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
797 797
798 798 Original requirements backed up
799 799
800 800 $ cat .hg/upgradebackup.*/requires
801 801 share-safe
802 802 $ cat .hg/upgradebackup.*/store/requires
803 803 dotencode
804 804 fncache
805 805 persistent-nodemap (rust !)
806 806 revlogv1
807 807 store
808 808 upgradeinprogress
809 809
810 810 generaldelta added to original requirements files
811 811
812 812 $ hg debugrequires
813 813 dotencode
814 814 fncache
815 815 generaldelta
816 816 persistent-nodemap (rust !)
817 817 revlogv1
818 818 share-safe
819 819 store
820 820
821 821 store directory has files we expect
822 822
823 823 $ ls .hg/store
824 824 00changelog.i
825 825 00manifest.i
826 826 data
827 827 fncache
828 828 phaseroots
829 829 requires
830 830 undo
831 831 undo.backupfiles
832 832 undo.phaseroots
833 833
834 834 manifest should be generaldelta
835 835
836 836 $ hg debugrevlog -m | grep flags
837 837 flags : inline, generaldelta
838 838
839 839 verify should be happy
840 840
841 841 $ hg verify
842 842 checking changesets
843 843 checking manifests
844 844 crosschecking files in changesets and manifests
845 845 checking files
846 846 checked 3 changesets with 3 changes to 3 files
847 847
848 848 old store should be backed up
849 849
850 850 $ ls -d .hg/upgradebackup.*/
851 851 .hg/upgradebackup.*/ (glob)
852 852 $ ls .hg/upgradebackup.*/store
853 853 00changelog.i
854 854 00manifest.i
855 855 data
856 856 fncache
857 857 phaseroots
858 858 requires
859 859 undo
860 860 undo.backup.fncache
861 861 undo.backupfiles
862 862 undo.phaseroots
863 863
864 864 unless --no-backup is passed
865 865
866 866 $ rm -rf .hg/upgradebackup.*/
867 867 $ hg debugupgraderepo --run --no-backup
868 868 note: selecting all-filelogs for processing to change: sparserevlog
869 869 note: selecting all-manifestlogs for processing to change: sparserevlog
870 870 note: selecting changelog for processing to change: sparserevlog
871 871
872 872 upgrade will perform the following actions:
873 873
874 874 requirements
875 875 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
876 876 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
877 877 added: sparserevlog
878 878
879 879 sparserevlog
880 880 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
881 881
882 882 processed revlogs:
883 883 - all-filelogs
884 884 - changelog
885 885 - manifest
886 886
887 887 beginning upgrade...
888 888 repository locked and read-only
889 889 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
890 890 (it is safe to interrupt this process any time before data migration completes)
891 891 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
892 892 migrating 519 KB in store; 1.05 MB tracked data
893 893 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
894 894 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
895 895 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
896 896 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
897 897 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
898 898 finished migrating 3 changelog revisions; change in size: 0 bytes
899 899 finished migrating 9 total revisions; total change in store size: 0 bytes
900 900 copying phaseroots
901 901 copying requires
902 902 data fully upgraded in a temporary repository
903 903 marking source repository as being upgraded; clients will be unable to read from repository
904 904 starting in-place swap of repository data
905 905 replacing store...
906 906 store replacement complete; repository was inconsistent for * (glob)
907 907 finalizing requirements file and making repository readable again
908 908 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
909 909 $ ls -1 .hg/ | grep upgradebackup
910 910 [1]
911 911
912 912 We can restrict optimization to some revlog:
913 913
914 914 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
915 915 upgrade will perform the following actions:
916 916
917 917 requirements
918 918 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
919 919 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
920 920
921 921 optimisations: re-delta-parent
922 922
923 923 re-delta-parent
924 924 deltas within internal storage will choose a new base revision if needed
925 925
926 926 processed revlogs:
927 927 - manifest
928 928
929 929 beginning upgrade...
930 930 repository locked and read-only
931 931 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
932 932 (it is safe to interrupt this process any time before data migration completes)
933 933 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
934 934 migrating 519 KB in store; 1.05 MB tracked data
935 935 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
936 936 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
937 937 blindly copying data/f0.i containing 1 revisions
938 938 blindly copying data/f2.i containing 1 revisions
939 939 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
940 940 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
941 941 cloning 3 revisions from 00manifest.i
942 942 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
943 943 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
944 944 blindly copying 00changelog.i containing 3 revisions
945 945 finished migrating 3 changelog revisions; change in size: 0 bytes
946 946 finished migrating 9 total revisions; total change in store size: 0 bytes
947 947 copying phaseroots
948 948 copying requires
949 949 data fully upgraded in a temporary repository
950 950 marking source repository as being upgraded; clients will be unable to read from repository
951 951 starting in-place swap of repository data
952 952 replacing store...
953 953 store replacement complete; repository was inconsistent for *s (glob)
954 954 finalizing requirements file and making repository readable again
955 955 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
956 956
957 957 Check that the repo still works fine
958 958
959 959 $ hg log -G --stat
960 960 @ changeset: 2:fca376863211 (py3 !)
961 961 | tag: tip
962 962 | parent: 0:ba592bf28da2
963 963 | user: test
964 964 | date: Thu Jan 01 00:00:00 1970 +0000
965 965 | summary: add f2
966 966 |
967 967 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
968 968 | 1 files changed, 100000 insertions(+), 0 deletions(-)
969 969 |
970 970 | o changeset: 1:2029ce2354e2
971 971 |/ user: test
972 972 | date: Thu Jan 01 00:00:00 1970 +0000
973 973 | summary: add f1
974 974 |
975 975 |
976 976 o changeset: 0:ba592bf28da2
977 977 user: test
978 978 date: Thu Jan 01 00:00:00 1970 +0000
979 979 summary: initial
980 980
981 981
982 982
983 983 $ hg verify
984 984 checking changesets
985 985 checking manifests
986 986 crosschecking files in changesets and manifests
987 987 checking files
988 988 checked 3 changesets with 3 changes to 3 files
989 989
990 990 Check we can select negatively
991 991
992 992 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
993 993 upgrade will perform the following actions:
994 994
995 995 requirements
996 996 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
997 997 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
998 998
999 999 optimisations: re-delta-parent
1000 1000
1001 1001 re-delta-parent
1002 1002 deltas within internal storage will choose a new base revision if needed
1003 1003
1004 1004 processed revlogs:
1005 1005 - all-filelogs
1006 1006 - changelog
1007 1007
1008 1008 beginning upgrade...
1009 1009 repository locked and read-only
1010 1010 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1011 1011 (it is safe to interrupt this process any time before data migration completes)
1012 1012 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1013 1013 migrating 519 KB in store; 1.05 MB tracked data
1014 1014 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1015 1015 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1016 1016 cloning 1 revisions from data/f0.i
1017 1017 cloning 1 revisions from data/f2.i
1018 1018 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1019 1019 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1020 1020 blindly copying 00manifest.i containing 3 revisions
1021 1021 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1022 1022 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1023 1023 cloning 3 revisions from 00changelog.i
1024 1024 finished migrating 3 changelog revisions; change in size: 0 bytes
1025 1025 finished migrating 9 total revisions; total change in store size: 0 bytes
1026 1026 copying phaseroots
1027 1027 copying requires
1028 1028 data fully upgraded in a temporary repository
1029 1029 marking source repository as being upgraded; clients will be unable to read from repository
1030 1030 starting in-place swap of repository data
1031 1031 replacing store...
1032 1032 store replacement complete; repository was inconsistent for *s (glob)
1033 1033 finalizing requirements file and making repository readable again
1034 1034 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1035 1035 $ hg verify
1036 1036 checking changesets
1037 1037 checking manifests
1038 1038 crosschecking files in changesets and manifests
1039 1039 checking files
1040 1040 checked 3 changesets with 3 changes to 3 files
1041 1041
1042 1042 Check that we can select changelog only
1043 1043
1044 1044 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
1045 1045 upgrade will perform the following actions:
1046 1046
1047 1047 requirements
1048 1048 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1049 1049 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1050 1050
1051 1051 optimisations: re-delta-parent
1052 1052
1053 1053 re-delta-parent
1054 1054 deltas within internal storage will choose a new base revision if needed
1055 1055
1056 1056 processed revlogs:
1057 1057 - changelog
1058 1058
1059 1059 beginning upgrade...
1060 1060 repository locked and read-only
1061 1061 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1062 1062 (it is safe to interrupt this process any time before data migration completes)
1063 1063 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1064 1064 migrating 519 KB in store; 1.05 MB tracked data
1065 1065 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1066 1066 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
1067 1067 blindly copying data/f0.i containing 1 revisions
1068 1068 blindly copying data/f2.i containing 1 revisions
1069 1069 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1070 1070 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1071 1071 blindly copying 00manifest.i containing 3 revisions
1072 1072 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1073 1073 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1074 1074 cloning 3 revisions from 00changelog.i
1075 1075 finished migrating 3 changelog revisions; change in size: 0 bytes
1076 1076 finished migrating 9 total revisions; total change in store size: 0 bytes
1077 1077 copying phaseroots
1078 1078 copying requires
1079 1079 data fully upgraded in a temporary repository
1080 1080 marking source repository as being upgraded; clients will be unable to read from repository
1081 1081 starting in-place swap of repository data
1082 1082 replacing store...
1083 1083 store replacement complete; repository was inconsistent for *s (glob)
1084 1084 finalizing requirements file and making repository readable again
1085 1085 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1086 1086 $ hg verify
1087 1087 checking changesets
1088 1088 checking manifests
1089 1089 crosschecking files in changesets and manifests
1090 1090 checking files
1091 1091 checked 3 changesets with 3 changes to 3 files
1092 1092
1093 1093 Check that we can select filelog only
1094 1094
1095 1095 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
1096 1096 upgrade will perform the following actions:
1097 1097
1098 1098 requirements
1099 1099 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1100 1100 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1101 1101
1102 1102 optimisations: re-delta-parent
1103 1103
1104 1104 re-delta-parent
1105 1105 deltas within internal storage will choose a new base revision if needed
1106 1106
1107 1107 processed revlogs:
1108 1108 - all-filelogs
1109 1109
1110 1110 beginning upgrade...
1111 1111 repository locked and read-only
1112 1112 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1113 1113 (it is safe to interrupt this process any time before data migration completes)
1114 1114 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1115 1115 migrating 519 KB in store; 1.05 MB tracked data
1116 1116 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1117 1117 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1118 1118 cloning 1 revisions from data/f0.i
1119 1119 cloning 1 revisions from data/f2.i
1120 1120 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1121 1121 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1122 1122 blindly copying 00manifest.i containing 3 revisions
1123 1123 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1124 1124 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1125 1125 blindly copying 00changelog.i containing 3 revisions
1126 1126 finished migrating 3 changelog revisions; change in size: 0 bytes
1127 1127 finished migrating 9 total revisions; total change in store size: 0 bytes
1128 1128 copying phaseroots
1129 1129 copying requires
1130 1130 data fully upgraded in a temporary repository
1131 1131 marking source repository as being upgraded; clients will be unable to read from repository
1132 1132 starting in-place swap of repository data
1133 1133 replacing store...
1134 1134 store replacement complete; repository was inconsistent for *s (glob)
1135 1135 finalizing requirements file and making repository readable again
1136 1136 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1137 1137 $ hg verify
1138 1138 checking changesets
1139 1139 checking manifests
1140 1140 crosschecking files in changesets and manifests
1141 1141 checking files
1142 1142 checked 3 changesets with 3 changes to 3 files
1143 1143
1144 1144
1145 1145 Check you can't skip revlog clone during important format downgrade
1146 1146
1147 1147 $ echo "[format]" > .hg/hgrc
1148 1148 $ echo "sparse-revlog=no" >> .hg/hgrc
1149 1149 $ hg debugupgrade --optimize re-delta-parent --no-manifest --no-backup --quiet
1150 1150 warning: ignoring --no-manifest, as upgrade is changing: sparserevlog
1151 1151
1152 1152 requirements
1153 1153 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1154 1154 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1155 1155 removed: sparserevlog
1156 1156
1157 1157 optimisations: re-delta-parent
1158 1158
1159 1159 processed revlogs:
1160 1160 - all-filelogs
1161 1161 - changelog
1162 1162 - manifest
1163 1163
1164 1164 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1165 1165 note: selecting all-filelogs for processing to change: sparserevlog
1166 1166 note: selecting changelog for processing to change: sparserevlog
1167 1167
1168 1168 upgrade will perform the following actions:
1169 1169
1170 1170 requirements
1171 1171 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1172 1172 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1173 1173 removed: sparserevlog
1174 1174
1175 1175 optimisations: re-delta-parent
1176 1176
1177 1177 re-delta-parent
1178 1178 deltas within internal storage will choose a new base revision if needed
1179 1179
1180 1180 processed revlogs:
1181 1181 - all-filelogs
1182 1182 - changelog
1183 1183 - manifest
1184 1184
1185 1185 beginning upgrade...
1186 1186 repository locked and read-only
1187 1187 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1188 1188 (it is safe to interrupt this process any time before data migration completes)
1189 1189 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1190 1190 migrating 519 KB in store; 1.05 MB tracked data
1191 1191 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1192 1192 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1193 1193 cloning 1 revisions from data/f0.i
1194 1194 cloning 1 revisions from data/f2.i
1195 1195 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1196 1196 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1197 1197 cloning 3 revisions from 00manifest.i
1198 1198 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1199 1199 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1200 1200 cloning 3 revisions from 00changelog.i
1201 1201 finished migrating 3 changelog revisions; change in size: 0 bytes
1202 1202 finished migrating 9 total revisions; total change in store size: 0 bytes
1203 1203 copying phaseroots
1204 1204 copying requires
1205 1205 data fully upgraded in a temporary repository
1206 1206 marking source repository as being upgraded; clients will be unable to read from repository
1207 1207 starting in-place swap of repository data
1208 1208 replacing store...
1209 1209 store replacement complete; repository was inconsistent for *s (glob)
1210 1210 finalizing requirements file and making repository readable again
1211 1211 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1212 1212 $ hg verify
1213 1213 checking changesets
1214 1214 checking manifests
1215 1215 crosschecking files in changesets and manifests
1216 1216 checking files
1217 1217 checked 3 changesets with 3 changes to 3 files
1218 1218
1219 1219 Check you can't skip revlog clone during important format upgrade
1220 1220
1221 1221 $ echo "sparse-revlog=yes" >> .hg/hgrc
1222 1222 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1223 1223 note: selecting all-filelogs for processing to change: sparserevlog
1224 1224 note: selecting changelog for processing to change: sparserevlog
1225 1225
1226 1226 upgrade will perform the following actions:
1227 1227
1228 1228 requirements
1229 1229 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1230 1230 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1231 1231 added: sparserevlog
1232 1232
1233 1233 optimisations: re-delta-parent
1234 1234
1235 1235 sparserevlog
1236 1236 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
1237 1237
1238 1238 re-delta-parent
1239 1239 deltas within internal storage will choose a new base revision if needed
1240 1240
1241 1241 processed revlogs:
1242 1242 - all-filelogs
1243 1243 - changelog
1244 1244 - manifest
1245 1245
1246 1246 beginning upgrade...
1247 1247 repository locked and read-only
1248 1248 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1249 1249 (it is safe to interrupt this process any time before data migration completes)
1250 1250 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1251 1251 migrating 519 KB in store; 1.05 MB tracked data
1252 1252 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1253 1253 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1254 1254 cloning 1 revisions from data/f0.i
1255 1255 cloning 1 revisions from data/f2.i
1256 1256 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1257 1257 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1258 1258 cloning 3 revisions from 00manifest.i
1259 1259 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1260 1260 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1261 1261 cloning 3 revisions from 00changelog.i
1262 1262 finished migrating 3 changelog revisions; change in size: 0 bytes
1263 1263 finished migrating 9 total revisions; total change in store size: 0 bytes
1264 1264 copying phaseroots
1265 1265 copying requires
1266 1266 data fully upgraded in a temporary repository
1267 1267 marking source repository as being upgraded; clients will be unable to read from repository
1268 1268 starting in-place swap of repository data
1269 1269 replacing store...
1270 1270 store replacement complete; repository was inconsistent for *s (glob)
1271 1271 finalizing requirements file and making repository readable again
1272 1272 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1273 1273 $ hg verify
1274 1274 checking changesets
1275 1275 checking manifests
1276 1276 crosschecking files in changesets and manifests
1277 1277 checking files
1278 1278 checked 3 changesets with 3 changes to 3 files
1279 1279
1280 1280 $ cd ..
1281 1281
1282 1282 store files with special filenames aren't encoded during copy
1283 1283
1284 1284 $ hg init store-filenames
1285 1285 $ cd store-filenames
1286 1286 $ touch foo
1287 1287 $ hg -q commit -A -m initial
1288 1288 $ touch .hg/store/.XX_special_filename
1289 1289
1290 1290 $ hg debugupgraderepo --run
1291 1291 nothing to do
1292 1292 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
1293 1293 upgrade will perform the following actions:
1294 1294
1295 1295 requirements
1296 1296 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1297 1297 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1298 1298
1299 1299 optimisations: re-delta-fulladd
1300 1300
1301 1301 re-delta-fulladd
1302 1302 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
1303 1303
1304 1304 processed revlogs:
1305 1305 - all-filelogs
1306 1306 - changelog
1307 1307 - manifest
1308 1308
1309 1309 beginning upgrade...
1310 1310 repository locked and read-only
1311 1311 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1312 1312 (it is safe to interrupt this process any time before data migration completes)
1313 1313 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1314 1314 migrating 301 bytes in store; 107 bytes tracked data
1315 1315 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1316 1316 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1317 1317 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1318 1318 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1319 1319 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1320 1320 finished migrating 1 changelog revisions; change in size: 0 bytes
1321 1321 finished migrating 3 total revisions; total change in store size: 0 bytes
1322 1322 copying .XX_special_filename
1323 1323 copying phaseroots
1324 1324 copying requires
1325 1325 data fully upgraded in a temporary repository
1326 1326 marking source repository as being upgraded; clients will be unable to read from repository
1327 1327 starting in-place swap of repository data
1328 1328 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1329 1329 replacing store...
1330 1330 store replacement complete; repository was inconsistent for *s (glob)
1331 1331 finalizing requirements file and making repository readable again
1332 1332 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1333 1333 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1334 1334 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1335 1335
1336 1336 fncache is valid after upgrade
1337 1337
1338 1338 $ hg debugrebuildfncache
1339 1339 fncache already up to date
1340 1340
1341 1341 $ cd ..
1342 1342
1343 1343 Check upgrading a large file repository
1344 1344 ---------------------------------------
1345 1345
1346 1346 $ hg init largefilesrepo
1347 1347 $ cat << EOF >> largefilesrepo/.hg/hgrc
1348 1348 > [extensions]
1349 1349 > largefiles =
1350 1350 > EOF
1351 1351
1352 1352 $ cd largefilesrepo
1353 1353 $ touch foo
1354 1354 $ hg add --large foo
1355 1355 $ hg -q commit -m initial
1356 1356 $ hg debugrequires
1357 1357 dotencode
1358 1358 fncache
1359 1359 generaldelta
1360 1360 largefiles
1361 1361 persistent-nodemap (rust !)
1362 1362 revlogv1
1363 1363 share-safe
1364 1364 sparserevlog
1365 1365 store
1366 1366
1367 1367 $ hg debugupgraderepo --run
1368 1368 nothing to do
1369 1369 $ hg debugrequires
1370 1370 dotencode
1371 1371 fncache
1372 1372 generaldelta
1373 1373 largefiles
1374 1374 persistent-nodemap (rust !)
1375 1375 revlogv1
1376 1376 share-safe
1377 1377 sparserevlog
1378 1378 store
1379 1379
1380 1380 $ cat << EOF >> .hg/hgrc
1381 1381 > [extensions]
1382 1382 > lfs =
1383 1383 > [lfs]
1384 1384 > threshold = 10
1385 1385 > EOF
1386 1386 $ echo '123456789012345' > lfs.bin
1387 1387 $ hg ci -Am 'lfs.bin'
1388 1388 adding lfs.bin
1389 1389 $ hg debugrequires | grep lfs
1390 1390 lfs
1391 1391 $ find .hg/store/lfs -type f
1392 1392 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1393 1393
1394 1394 $ hg debugupgraderepo --run
1395 1395 nothing to do
1396 1396
1397 1397 $ hg debugrequires | grep lfs
1398 1398 lfs
1399 1399 $ find .hg/store/lfs -type f
1400 1400 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1401 1401 $ hg verify
1402 1402 checking changesets
1403 1403 checking manifests
1404 1404 crosschecking files in changesets and manifests
1405 1405 checking files
1406 1406 checked 2 changesets with 2 changes to 2 files
1407 1407 $ hg debugdata lfs.bin 0
1408 1408 version https://git-lfs.github.com/spec/v1
1409 1409 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1410 1410 size 16
1411 1411 x-is-binary 0
1412 1412
1413 1413 $ cd ..
1414 1414
1415 1415 repository config is taken in account
1416 1416 -------------------------------------
1417 1417
1418 1418 $ cat << EOF >> $HGRCPATH
1419 1419 > [format]
1420 1420 > maxchainlen = 1
1421 1421 > EOF
1422 1422
1423 1423 $ hg init localconfig
1424 1424 $ cd localconfig
1425 1425 $ cat << EOF > file
1426 1426 > some content
1427 1427 > with some length
1428 1428 > to make sure we get a delta
1429 1429 > after changes
1430 1430 > very long
1431 1431 > very long
1432 1432 > very long
1433 1433 > very long
1434 1434 > very long
1435 1435 > very long
1436 1436 > very long
1437 1437 > very long
1438 1438 > very long
1439 1439 > very long
1440 1440 > very long
1441 1441 > EOF
1442 1442 $ hg -q commit -A -m A
1443 1443 $ echo "new line" >> file
1444 1444 $ hg -q commit -m B
1445 1445 $ echo "new line" >> file
1446 1446 $ hg -q commit -m C
1447 1447
1448 1448 $ cat << EOF >> .hg/hgrc
1449 1449 > [format]
1450 1450 > maxchainlen = 9001
1451 1451 > EOF
1452 1452 $ hg config format
1453 1453 format.revlog-compression=$BUNDLE2_COMPRESSIONS$
1454 1454 format.maxchainlen=9001
1455 1455 $ hg debugdeltachain file
1456 1456 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1457 1457 0 -1 -1 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1458 1458 1 0 -1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1459 1459 2 1 -1 1 2 0 snap 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1460 1460
1461 1461 $ hg debugupgraderepo --run --optimize 're-delta-all'
1462 1462 upgrade will perform the following actions:
1463 1463
1464 1464 requirements
1465 1465 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1466 1466 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1467 1467
1468 1468 optimisations: re-delta-all
1469 1469
1470 1470 re-delta-all
1471 1471 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1472 1472
1473 1473 processed revlogs:
1474 1474 - all-filelogs
1475 1475 - changelog
1476 1476 - manifest
1477 1477
1478 1478 beginning upgrade...
1479 1479 repository locked and read-only
1480 1480 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1481 1481 (it is safe to interrupt this process any time before data migration completes)
1482 1482 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1483 1483 migrating 1019 bytes in store; 882 bytes tracked data
1484 1484 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1485 1485 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1486 1486 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1487 1487 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1488 1488 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1489 1489 finished migrating 3 changelog revisions; change in size: 0 bytes
1490 1490 finished migrating 9 total revisions; total change in store size: -9 bytes
1491 1491 copying phaseroots
1492 1492 copying requires
1493 1493 data fully upgraded in a temporary repository
1494 1494 marking source repository as being upgraded; clients will be unable to read from repository
1495 1495 starting in-place swap of repository data
1496 1496 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1497 1497 replacing store...
1498 1498 store replacement complete; repository was inconsistent for *s (glob)
1499 1499 finalizing requirements file and making repository readable again
1500 1500 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1501 1501 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1502 1502 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1503 1503 $ hg debugdeltachain file
1504 1504 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1505 1505 0 -1 -1 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1506 1506 1 0 -1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1507 1507 2 1 -1 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1508 1508 $ cd ..
1509 1509
1510 1510 $ cat << EOF >> $HGRCPATH
1511 1511 > [format]
1512 1512 > maxchainlen = 9001
1513 1513 > EOF
1514 1514
1515 1515 Check upgrading a sparse-revlog repository
1516 1516 ---------------------------------------
1517 1517
1518 1518 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1519 1519 $ cd sparserevlogrepo
1520 1520 $ touch foo
1521 1521 $ hg add foo
1522 1522 $ hg -q commit -m "foo"
1523 1523 $ hg debugrequires
1524 1524 dotencode
1525 1525 fncache
1526 1526 generaldelta
1527 1527 persistent-nodemap (rust !)
1528 1528 revlogv1
1529 1529 share-safe
1530 1530 store
1531 1531
1532 1532 Check that we can add the sparse-revlog format requirement
1533 1533 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1534 1534 upgrade will perform the following actions:
1535 1535
1536 1536 requirements
1537 1537 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1538 1538 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1539 1539 added: sparserevlog
1540 1540
1541 1541 processed revlogs:
1542 1542 - all-filelogs
1543 1543 - changelog
1544 1544 - manifest
1545 1545
1546 1546 $ hg debugrequires
1547 1547 dotencode
1548 1548 fncache
1549 1549 generaldelta
1550 1550 persistent-nodemap (rust !)
1551 1551 revlogv1
1552 1552 share-safe
1553 1553 sparserevlog
1554 1554 store
1555 1555
1556 1556 Check that we can remove the sparse-revlog format requirement
1557 1557 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1558 1558 upgrade will perform the following actions:
1559 1559
1560 1560 requirements
1561 1561 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1562 1562 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1563 1563 removed: sparserevlog
1564 1564
1565 1565 processed revlogs:
1566 1566 - all-filelogs
1567 1567 - changelog
1568 1568 - manifest
1569 1569
1570 1570 $ hg debugrequires
1571 1571 dotencode
1572 1572 fncache
1573 1573 generaldelta
1574 1574 persistent-nodemap (rust !)
1575 1575 revlogv1
1576 1576 share-safe
1577 1577 store
1578 1578
1579 1579 #if zstd
1580 1580
1581 1581 Check upgrading to a zstd revlog
1582 1582 --------------------------------
1583 1583
1584 1584 upgrade
1585 1585
1586 1586 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1587 1587 upgrade will perform the following actions:
1588 1588
1589 1589 requirements
1590 1590 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1591 1591 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1592 1592 added: revlog-compression-zstd, sparserevlog
1593 1593
1594 1594 processed revlogs:
1595 1595 - all-filelogs
1596 1596 - changelog
1597 1597 - manifest
1598 1598
1599 1599 $ hg debugformat -v
1600 1600 format-variant repo config default
1601 1601 fncache: yes yes yes
1602 1602 dirstate-v2: no no no
1603 1603 tracked-hint: no no no
1604 1604 dotencode: yes yes yes
1605 1605 generaldelta: yes yes yes
1606 1606 share-safe: yes yes yes
1607 1607 sparserevlog: yes yes yes
1608 1608 persistent-nodemap: no no no (no-rust !)
1609 1609 persistent-nodemap: yes yes no (rust !)
1610 1610 copies-sdc: no no no
1611 1611 revlog-v2: no no no
1612 1612 changelog-v2: no no no
1613 1613 plain-cl-delta: yes yes yes
1614 1614 compression: zlib zlib zlib (no-zstd !)
1615 1615 compression: zstd zlib zstd (zstd !)
1616 1616 compression-level: default default default
1617 1617 $ hg debugrequires
1618 1618 dotencode
1619 1619 fncache
1620 1620 generaldelta
1621 1621 persistent-nodemap (rust !)
1622 1622 revlog-compression-zstd
1623 1623 revlogv1
1624 1624 share-safe
1625 1625 sparserevlog
1626 1626 store
1627 1627
1628 1628 downgrade
1629 1629
1630 1630 $ hg debugupgraderepo --run --no-backup --quiet
1631 1631 upgrade will perform the following actions:
1632 1632
1633 1633 requirements
1634 1634 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1635 1635 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1636 1636 removed: revlog-compression-zstd
1637 1637
1638 1638 processed revlogs:
1639 1639 - all-filelogs
1640 1640 - changelog
1641 1641 - manifest
1642 1642
1643 1643 $ hg debugformat -v
1644 1644 format-variant repo config default
1645 1645 fncache: yes yes yes
1646 1646 dirstate-v2: no no no
1647 1647 tracked-hint: no no no
1648 1648 dotencode: yes yes yes
1649 1649 generaldelta: yes yes yes
1650 1650 share-safe: yes yes yes
1651 1651 sparserevlog: yes yes yes
1652 1652 persistent-nodemap: no no no (no-rust !)
1653 1653 persistent-nodemap: yes yes no (rust !)
1654 1654 copies-sdc: no no no
1655 1655 revlog-v2: no no no
1656 1656 changelog-v2: no no no
1657 1657 plain-cl-delta: yes yes yes
1658 1658 compression: zlib zlib zlib (no-zstd !)
1659 1659 compression: zlib zlib zstd (zstd !)
1660 1660 compression-level: default default default
1661 1661 $ hg debugrequires
1662 1662 dotencode
1663 1663 fncache
1664 1664 generaldelta
1665 1665 persistent-nodemap (rust !)
1666 1666 revlogv1
1667 1667 share-safe
1668 1668 sparserevlog
1669 1669 store
1670 1670
1671 1671 upgrade from hgrc
1672 1672
1673 1673 $ cat >> .hg/hgrc << EOF
1674 1674 > [format]
1675 1675 > revlog-compression=zstd
1676 1676 > EOF
1677 1677 $ hg debugupgraderepo --run --no-backup --quiet
1678 1678 upgrade will perform the following actions:
1679 1679
1680 1680 requirements
1681 1681 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1682 1682 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1683 1683 added: revlog-compression-zstd
1684 1684
1685 1685 processed revlogs:
1686 1686 - all-filelogs
1687 1687 - changelog
1688 1688 - manifest
1689 1689
1690 1690 $ hg debugformat -v
1691 1691 format-variant repo config default
1692 1692 fncache: yes yes yes
1693 1693 dirstate-v2: no no no
1694 1694 tracked-hint: no no no
1695 1695 dotencode: yes yes yes
1696 1696 generaldelta: yes yes yes
1697 1697 share-safe: yes yes yes
1698 1698 sparserevlog: yes yes yes
1699 1699 persistent-nodemap: no no no (no-rust !)
1700 1700 persistent-nodemap: yes yes no (rust !)
1701 1701 copies-sdc: no no no
1702 1702 revlog-v2: no no no
1703 1703 changelog-v2: no no no
1704 1704 plain-cl-delta: yes yes yes
1705 1705 compression: zlib zlib zlib (no-zstd !)
1706 1706 compression: zstd zstd zstd (zstd !)
1707 1707 compression-level: default default default
1708 1708 $ hg debugrequires
1709 1709 dotencode
1710 1710 fncache
1711 1711 generaldelta
1712 1712 persistent-nodemap (rust !)
1713 1713 revlog-compression-zstd
1714 1714 revlogv1
1715 1715 share-safe
1716 1716 sparserevlog
1717 1717 store
1718 1718
1719 1719 #endif
1720 1720
1721 1721 Check upgrading to a revlog format supporting sidedata
1722 1722 ------------------------------------------------------
1723 1723
1724 1724 upgrade
1725 1725
1726 1726 $ hg debugsidedata -c 0
1727 1727 $ hg --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1728 1728 upgrade will perform the following actions:
1729 1729
1730 1730 requirements
1731 1731 preserved: dotencode, fncache, generaldelta, share-safe, store (no-zstd !)
1732 1732 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1733 1733 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1734 1734 removed: revlogv1
1735 1735 added: exp-revlogv2.2 (zstd !)
1736 1736 added: exp-revlogv2.2, sparserevlog (no-zstd !)
1737 1737
1738 1738 processed revlogs:
1739 1739 - all-filelogs
1740 1740 - changelog
1741 1741 - manifest
1742 1742
1743 1743 $ hg debugformat -v
1744 1744 format-variant repo config default
1745 1745 fncache: yes yes yes
1746 1746 dirstate-v2: no no no
1747 1747 tracked-hint: no no no
1748 1748 dotencode: yes yes yes
1749 1749 generaldelta: yes yes yes
1750 1750 share-safe: yes yes yes
1751 1751 sparserevlog: yes yes yes
1752 1752 persistent-nodemap: no no no (no-rust !)
1753 1753 persistent-nodemap: yes yes no (rust !)
1754 1754 copies-sdc: no no no
1755 1755 revlog-v2: yes no no
1756 1756 changelog-v2: no no no
1757 1757 plain-cl-delta: yes yes yes
1758 1758 compression: zlib zlib zlib (no-zstd !)
1759 1759 compression: zstd zstd zstd (zstd !)
1760 1760 compression-level: default default default
1761 1761 $ hg debugrequires
1762 1762 dotencode
1763 1763 exp-revlogv2.2
1764 1764 fncache
1765 1765 generaldelta
1766 1766 persistent-nodemap (rust !)
1767 1767 revlog-compression-zstd (zstd !)
1768 1768 share-safe
1769 1769 sparserevlog
1770 1770 store
1771 1771 $ hg debugsidedata -c 0
1772 1772 2 sidedata entries
1773 1773 entry-0001 size 4
1774 1774 entry-0002 size 32
1775 1775
1776 1776 downgrade
1777 1777
1778 1778 $ hg debugupgraderepo --config experimental.revlogv2=no --run --no-backup --quiet
1779 1779 upgrade will perform the following actions:
1780 1780
1781 1781 requirements
1782 1782 preserved: dotencode, fncache, generaldelta, share-safe, sparserevlog, store (no-zstd !)
1783 1783 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1784 1784 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1785 1785 removed: exp-revlogv2.2
1786 1786 added: revlogv1
1787 1787
1788 1788 processed revlogs:
1789 1789 - all-filelogs
1790 1790 - changelog
1791 1791 - manifest
1792 1792
1793 1793 $ hg debugformat -v
1794 1794 format-variant repo config default
1795 1795 fncache: yes yes yes
1796 1796 dirstate-v2: no no no
1797 1797 tracked-hint: no no no
1798 1798 dotencode: yes yes yes
1799 1799 generaldelta: yes yes yes
1800 1800 share-safe: yes yes yes
1801 1801 sparserevlog: yes yes yes
1802 1802 persistent-nodemap: no no no (no-rust !)
1803 1803 persistent-nodemap: yes yes no (rust !)
1804 1804 copies-sdc: no no no
1805 1805 revlog-v2: no no no
1806 1806 changelog-v2: no no no
1807 1807 plain-cl-delta: yes yes yes
1808 1808 compression: zlib zlib zlib (no-zstd !)
1809 1809 compression: zstd zstd zstd (zstd !)
1810 1810 compression-level: default default default
1811 1811 $ hg debugrequires
1812 1812 dotencode
1813 1813 fncache
1814 1814 generaldelta
1815 1815 persistent-nodemap (rust !)
1816 1816 revlog-compression-zstd (zstd !)
1817 1817 revlogv1
1818 1818 share-safe
1819 1819 sparserevlog
1820 1820 store
1821 1821 $ hg debugsidedata -c 0
1822 1822
1823 1823 upgrade from hgrc
1824 1824
1825 1825 $ cat >> .hg/hgrc << EOF
1826 1826 > [experimental]
1827 1827 > revlogv2=enable-unstable-format-and-corrupt-my-data
1828 1828 > EOF
1829 1829 $ hg debugupgraderepo --run --no-backup --quiet
1830 1830 upgrade will perform the following actions:
1831 1831
1832 1832 requirements
1833 1833 preserved: dotencode, fncache, generaldelta, share-safe, sparserevlog, store (no-zstd !)
1834 1834 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1835 1835 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1836 1836 removed: revlogv1
1837 1837 added: exp-revlogv2.2
1838 1838
1839 1839 processed revlogs:
1840 1840 - all-filelogs
1841 1841 - changelog
1842 1842 - manifest
1843 1843
1844 1844 $ hg debugformat -v
1845 1845 format-variant repo config default
1846 1846 fncache: yes yes yes
1847 1847 dirstate-v2: no no no
1848 1848 tracked-hint: no no no
1849 1849 dotencode: yes yes yes
1850 1850 generaldelta: yes yes yes
1851 1851 share-safe: yes yes yes
1852 1852 sparserevlog: yes yes yes
1853 1853 persistent-nodemap: no no no (no-rust !)
1854 1854 persistent-nodemap: yes yes no (rust !)
1855 1855 copies-sdc: no no no
1856 1856 revlog-v2: yes yes no
1857 1857 changelog-v2: no no no
1858 1858 plain-cl-delta: yes yes yes
1859 1859 compression: zlib zlib zlib (no-zstd !)
1860 1860 compression: zstd zstd zstd (zstd !)
1861 1861 compression-level: default default default
1862 1862 $ hg debugrequires
1863 1863 dotencode
1864 1864 exp-revlogv2.2
1865 1865 fncache
1866 1866 generaldelta
1867 1867 persistent-nodemap (rust !)
1868 1868 revlog-compression-zstd (zstd !)
1869 1869 share-safe
1870 1870 sparserevlog
1871 1871 store
1872 1872 $ hg debugsidedata -c 0
1873 1873
1874 1874 Demonstrate that nothing to perform upgrade will still run all the way through
1875 1875
1876 1876 $ hg debugupgraderepo --run
1877 1877 nothing to do
1878 1878
1879 1879 #if no-rust
1880 1880
1881 1881 $ cat << EOF >> $HGRCPATH
1882 1882 > [storage]
1883 1883 > dirstate-v2.slow-path = allow
1884 1884 > EOF
1885 1885
1886 1886 #endif
1887 1887
1888 1888 Upgrade to dirstate-v2
1889 1889
1890 1890 $ hg debugformat -v --config format.use-dirstate-v2=1 | grep dirstate-v2
1891 1891 dirstate-v2: no yes no
1892 1892 $ hg debugupgraderepo --config format.use-dirstate-v2=1 --run
1893 1893 upgrade will perform the following actions:
1894 1894
1895 1895 requirements
1896 1896 preserved: * (glob)
1897 1897 added: dirstate-v2
1898 1898
1899 1899 dirstate-v2
1900 1900 "hg status" will be faster
1901 1901
1902 1902 no revlogs to process
1903 1903
1904 1904 beginning upgrade...
1905 1905 repository locked and read-only
1906 1906 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1907 1907 (it is safe to interrupt this process any time before data migration completes)
1908 1908 upgrading to dirstate-v2 from v1
1909 1909 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1910 1910 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1911 1911 $ ls .hg/upgradebackup.*/dirstate
1912 1912 .hg/upgradebackup.*/dirstate (glob)
1913 1913 $ hg debugformat -v | grep dirstate-v2
1914 1914 dirstate-v2: yes no no
1915 1915 $ hg status
1916 1916 $ dd bs=12 count=1 if=.hg/dirstate 2> /dev/null
1917 1917 dirstate-v2
1918 1918
1919 1919 Downgrade from dirstate-v2
1920 1920
1921 1921 $ hg debugupgraderepo --run
1922 1922 upgrade will perform the following actions:
1923 1923
1924 1924 requirements
1925 1925 preserved: * (glob)
1926 1926 removed: dirstate-v2
1927 1927
1928 1928 no revlogs to process
1929 1929
1930 1930 beginning upgrade...
1931 1931 repository locked and read-only
1932 1932 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1933 1933 (it is safe to interrupt this process any time before data migration completes)
1934 1934 downgrading from dirstate-v2 to v1
1935 1935 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1936 1936 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1937 1937 $ hg debugformat -v | grep dirstate-v2
1938 1938 dirstate-v2: no no no
1939 1939 $ hg status
1940 1940
1941 1941 $ cd ..
1942 1942
1943 1943 dirstate-v2: upgrade and downgrade from and empty repository:
1944 1944 -------------------------------------------------------------
1945 1945
1946 1946 $ hg init --config format.use-dirstate-v2=no dirstate-v2-empty
1947 1947 $ cd dirstate-v2-empty
1948 1948 $ hg debugformat | grep dirstate-v2
1949 1949 dirstate-v2: no
1950 1950
1951 1951 upgrade
1952 1952
1953 1953 $ hg debugupgraderepo --run --config format.use-dirstate-v2=yes
1954 1954 upgrade will perform the following actions:
1955 1955
1956 1956 requirements
1957 1957 preserved: * (glob)
1958 1958 added: dirstate-v2
1959 1959
1960 1960 dirstate-v2
1961 1961 "hg status" will be faster
1962 1962
1963 1963 no revlogs to process
1964 1964
1965 1965 beginning upgrade...
1966 1966 repository locked and read-only
1967 1967 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1968 1968 (it is safe to interrupt this process any time before data migration completes)
1969 1969 upgrading to dirstate-v2 from v1
1970 1970 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1971 1971 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1972 1972 $ hg debugformat | grep dirstate-v2
1973 1973 dirstate-v2: yes
1974 1974
1975 1975 downgrade
1976 1976
1977 1977 $ hg debugupgraderepo --run --config format.use-dirstate-v2=no
1978 1978 upgrade will perform the following actions:
1979 1979
1980 1980 requirements
1981 1981 preserved: * (glob)
1982 1982 removed: dirstate-v2
1983 1983
1984 1984 no revlogs to process
1985 1985
1986 1986 beginning upgrade...
1987 1987 repository locked and read-only
1988 1988 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1989 1989 (it is safe to interrupt this process any time before data migration completes)
1990 1990 downgrading from dirstate-v2 to v1
1991 1991 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1992 1992 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1993 1993 $ hg debugformat | grep dirstate-v2
1994 1994 dirstate-v2: no
1995 1995
1996 1996 $ cd ..
1997 1997
1998 1998 Test automatic upgrade/downgrade
1999 1999 ================================
2000 2000
2001 2001
2002 2002 For dirstate v2
2003 2003 ---------------
2004 2004
2005 2005 create an initial repository
2006 2006
2007 2007 $ hg init auto-upgrade \
2008 2008 > --config format.use-dirstate-v2=no \
2009 2009 > --config format.use-dirstate-tracked-hint=yes \
2010 2010 > --config format.use-share-safe=no
2011 2011 $ hg debugbuilddag -R auto-upgrade --new-file .+5
2012 2012 $ hg -R auto-upgrade update
2013 2013 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
2014 2014 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2015 2015 dirstate-v2: no
2016 2016
2017 2017 upgrade it to dirstate-v2 automatically
2018 2018
2019 2019 $ hg status -R auto-upgrade \
2020 2020 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2021 2021 > --config format.use-dirstate-v2=yes
2022 2022 automatically upgrading repository to the `dirstate-v2` feature
2023 2023 (see `hg help config.format.use-dirstate-v2` for details)
2024 2024 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2025 2025 dirstate-v2: yes
2026 2026
2027 2027 downgrade it from dirstate-v2 automatically
2028 2028
2029 2029 $ hg status -R auto-upgrade \
2030 2030 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2031 2031 > --config format.use-dirstate-v2=no
2032 2032 automatically downgrading repository from the `dirstate-v2` feature
2033 2033 (see `hg help config.format.use-dirstate-v2` for details)
2034 2034 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2035 2035 dirstate-v2: no
2036 2036
2037 2037
2038 2038 For multiple change at the same time
2039 2039 ------------------------------------
2040 2040
2041 2041 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2042 2042 dirstate-v2: no
2043 2043 tracked-hint: yes
2044 2044 share-safe: no
2045 2045
2046 2046 $ hg status -R auto-upgrade \
2047 2047 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2048 2048 > --config format.use-dirstate-v2=yes \
2049 2049 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2050 2050 > --config format.use-dirstate-tracked-hint=no\
2051 2051 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2052 2052 > --config format.use-share-safe=yes
2053 2053 automatically upgrading repository to the `dirstate-v2` feature
2054 2054 (see `hg help config.format.use-dirstate-v2` for details)
2055 2055 automatically upgrading repository to the `share-safe` feature
2056 2056 (see `hg help config.format.use-share-safe` for details)
2057 2057 automatically downgrading repository from the `tracked-hint` feature
2058 2058 (see `hg help config.format.use-dirstate-tracked-hint` for details)
2059 2059 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2060 2060 dirstate-v2: yes
2061 2061 tracked-hint: no
2062 2062 share-safe: yes
2063 2063
2064 2064 Quiet upgrade and downgrade
2065 2065 ---------------------------
2066 2066
2067 2067
2068 2068 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2069 2069 dirstate-v2: yes
2070 2070 tracked-hint: no
2071 2071 share-safe: yes
2072 2072 $ hg status -R auto-upgrade \
2073 2073 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2074 2074 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2075 2075 > --config format.use-dirstate-v2=no \
2076 2076 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2077 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2077 2078 > --config format.use-dirstate-tracked-hint=yes \
2078 2079 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2079 2080 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2080 2081 > --config format.use-share-safe=no
2081 automatically upgrading repository to the `tracked-hint` feature
2082 (see `hg help config.format.use-dirstate-tracked-hint` for details)
2083 2082
2084 2083 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2085 2084 dirstate-v2: no
2086 2085 tracked-hint: yes
2087 2086 share-safe: no
2088 2087
2089 2088 $ hg status -R auto-upgrade \
2090 2089 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2091 2090 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2092 2091 > --config format.use-dirstate-v2=yes \
2093 2092 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2093 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2094 2094 > --config format.use-dirstate-tracked-hint=no\
2095 2095 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2096 2096 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2097 2097 > --config format.use-share-safe=yes
2098 automatically downgrading repository from the `tracked-hint` feature
2099 (see `hg help config.format.use-dirstate-tracked-hint` for details)
2100 2098 $ hg debugformat -R auto-upgrade | egrep '(dirstate-v2|tracked|share-safe)'
2101 2099 dirstate-v2: yes
2102 2100 tracked-hint: no
2103 2101 share-safe: yes
2104 2102
2105 2103 Attempting Auto-upgrade on a read-only repository
2106 2104 -------------------------------------------------
2107 2105
2108 2106 $ chmod -R a-w auto-upgrade
2109 2107
2110 2108 $ hg status -R auto-upgrade \
2111 2109 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2112 2110 > --config format.use-dirstate-v2=no
2113 2111 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2114 2112 dirstate-v2: yes
2115 2113
2116 2114 $ chmod -R u+w auto-upgrade
2117 2115
2118 2116 Attempting Auto-upgrade on a locked repository
2119 2117 ----------------------------------------------
2120 2118
2121 2119 $ hg -R auto-upgrade debuglock --set-lock --quiet &
2122 2120 $ echo $! >> $DAEMON_PIDS
2123 2121 $ $RUNTESTDIR/testlib/wait-on-file 10 auto-upgrade/.hg/store/lock
2124 2122 $ hg status -R auto-upgrade \
2125 2123 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2126 2124 > --config format.use-dirstate-v2=no
2127 2125 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2128 2126 dirstate-v2: yes
2129 2127
2130 2128 $ killdaemons.py
General Comments 0
You need to be logged in to leave comments. Login now