##// END OF EJS Templates
sharesafe: introduce config to disallow outdated shares if upgrade fails...
Pulkit Goyal -
r46856:d159d0fa default
parent child Browse files
Show More
@@ -1,2550 +1,2555 b''
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 from __future__ import absolute_import
9 9
10 10 import functools
11 11 import re
12 12
13 13 from . import (
14 14 encoding,
15 15 error,
16 16 )
17 17
18 18
19 19 def loadconfigtable(ui, extname, configtable):
20 20 """update config item known to the ui with the extension ones"""
21 21 for section, items in sorted(configtable.items()):
22 22 knownitems = ui._knownconfig.setdefault(section, itemregister())
23 23 knownkeys = set(knownitems)
24 24 newkeys = set(items)
25 25 for key in sorted(knownkeys & newkeys):
26 26 msg = b"extension '%s' overwrite config item '%s.%s'"
27 27 msg %= (extname, section, key)
28 28 ui.develwarn(msg, config=b'warn-config')
29 29
30 30 knownitems.update(items)
31 31
32 32
33 33 class configitem(object):
34 34 """represent a known config item
35 35
36 36 :section: the official config section where to find this item,
37 37 :name: the official name within the section,
38 38 :default: default value for this item,
39 39 :alias: optional list of tuples as alternatives,
40 40 :generic: this is a generic definition, match name using regular expression.
41 41 """
42 42
43 43 def __init__(
44 44 self,
45 45 section,
46 46 name,
47 47 default=None,
48 48 alias=(),
49 49 generic=False,
50 50 priority=0,
51 51 experimental=False,
52 52 ):
53 53 self.section = section
54 54 self.name = name
55 55 self.default = default
56 56 self.alias = list(alias)
57 57 self.generic = generic
58 58 self.priority = priority
59 59 self.experimental = experimental
60 60 self._re = None
61 61 if generic:
62 62 self._re = re.compile(self.name)
63 63
64 64
65 65 class itemregister(dict):
66 66 """A specialized dictionary that can handle wild-card selection"""
67 67
68 68 def __init__(self):
69 69 super(itemregister, self).__init__()
70 70 self._generics = set()
71 71
72 72 def update(self, other):
73 73 super(itemregister, self).update(other)
74 74 self._generics.update(other._generics)
75 75
76 76 def __setitem__(self, key, item):
77 77 super(itemregister, self).__setitem__(key, item)
78 78 if item.generic:
79 79 self._generics.add(item)
80 80
81 81 def get(self, key):
82 82 baseitem = super(itemregister, self).get(key)
83 83 if baseitem is not None and not baseitem.generic:
84 84 return baseitem
85 85
86 86 # search for a matching generic item
87 87 generics = sorted(self._generics, key=(lambda x: (x.priority, x.name)))
88 88 for item in generics:
89 89 # we use 'match' instead of 'search' to make the matching simpler
90 90 # for people unfamiliar with regular expression. Having the match
91 91 # rooted to the start of the string will produce less surprising
92 92 # result for user writing simple regex for sub-attribute.
93 93 #
94 94 # For example using "color\..*" match produces an unsurprising
95 95 # result, while using search could suddenly match apparently
96 96 # unrelated configuration that happens to contains "color."
97 97 # anywhere. This is a tradeoff where we favor requiring ".*" on
98 98 # some match to avoid the need to prefix most pattern with "^".
99 99 # The "^" seems more error prone.
100 100 if item._re.match(key):
101 101 return item
102 102
103 103 return None
104 104
105 105
106 106 coreitems = {}
107 107
108 108
109 109 def _register(configtable, *args, **kwargs):
110 110 item = configitem(*args, **kwargs)
111 111 section = configtable.setdefault(item.section, itemregister())
112 112 if item.name in section:
113 113 msg = b"duplicated config item registration for '%s.%s'"
114 114 raise error.ProgrammingError(msg % (item.section, item.name))
115 115 section[item.name] = item
116 116
117 117
118 118 # special value for case where the default is derived from other values
119 119 dynamicdefault = object()
120 120
121 121 # Registering actual config items
122 122
123 123
124 124 def getitemregister(configtable):
125 125 f = functools.partial(_register, configtable)
126 126 # export pseudo enum as configitem.*
127 127 f.dynamicdefault = dynamicdefault
128 128 return f
129 129
130 130
131 131 coreconfigitem = getitemregister(coreitems)
132 132
133 133
134 134 def _registerdiffopts(section, configprefix=b''):
135 135 coreconfigitem(
136 136 section,
137 137 configprefix + b'nodates',
138 138 default=False,
139 139 )
140 140 coreconfigitem(
141 141 section,
142 142 configprefix + b'showfunc',
143 143 default=False,
144 144 )
145 145 coreconfigitem(
146 146 section,
147 147 configprefix + b'unified',
148 148 default=None,
149 149 )
150 150 coreconfigitem(
151 151 section,
152 152 configprefix + b'git',
153 153 default=False,
154 154 )
155 155 coreconfigitem(
156 156 section,
157 157 configprefix + b'ignorews',
158 158 default=False,
159 159 )
160 160 coreconfigitem(
161 161 section,
162 162 configprefix + b'ignorewsamount',
163 163 default=False,
164 164 )
165 165 coreconfigitem(
166 166 section,
167 167 configprefix + b'ignoreblanklines',
168 168 default=False,
169 169 )
170 170 coreconfigitem(
171 171 section,
172 172 configprefix + b'ignorewseol',
173 173 default=False,
174 174 )
175 175 coreconfigitem(
176 176 section,
177 177 configprefix + b'nobinary',
178 178 default=False,
179 179 )
180 180 coreconfigitem(
181 181 section,
182 182 configprefix + b'noprefix',
183 183 default=False,
184 184 )
185 185 coreconfigitem(
186 186 section,
187 187 configprefix + b'word-diff',
188 188 default=False,
189 189 )
190 190
191 191
192 192 coreconfigitem(
193 193 b'alias',
194 194 b'.*',
195 195 default=dynamicdefault,
196 196 generic=True,
197 197 )
198 198 coreconfigitem(
199 199 b'auth',
200 200 b'cookiefile',
201 201 default=None,
202 202 )
203 203 _registerdiffopts(section=b'annotate')
204 204 # bookmarks.pushing: internal hack for discovery
205 205 coreconfigitem(
206 206 b'bookmarks',
207 207 b'pushing',
208 208 default=list,
209 209 )
210 210 # bundle.mainreporoot: internal hack for bundlerepo
211 211 coreconfigitem(
212 212 b'bundle',
213 213 b'mainreporoot',
214 214 default=b'',
215 215 )
216 216 coreconfigitem(
217 217 b'censor',
218 218 b'policy',
219 219 default=b'abort',
220 220 experimental=True,
221 221 )
222 222 coreconfigitem(
223 223 b'chgserver',
224 224 b'idletimeout',
225 225 default=3600,
226 226 )
227 227 coreconfigitem(
228 228 b'chgserver',
229 229 b'skiphash',
230 230 default=False,
231 231 )
232 232 coreconfigitem(
233 233 b'cmdserver',
234 234 b'log',
235 235 default=None,
236 236 )
237 237 coreconfigitem(
238 238 b'cmdserver',
239 239 b'max-log-files',
240 240 default=7,
241 241 )
242 242 coreconfigitem(
243 243 b'cmdserver',
244 244 b'max-log-size',
245 245 default=b'1 MB',
246 246 )
247 247 coreconfigitem(
248 248 b'cmdserver',
249 249 b'max-repo-cache',
250 250 default=0,
251 251 experimental=True,
252 252 )
253 253 coreconfigitem(
254 254 b'cmdserver',
255 255 b'message-encodings',
256 256 default=list,
257 257 )
258 258 coreconfigitem(
259 259 b'cmdserver',
260 260 b'track-log',
261 261 default=lambda: [b'chgserver', b'cmdserver', b'repocache'],
262 262 )
263 263 coreconfigitem(
264 264 b'cmdserver',
265 265 b'shutdown-on-interrupt',
266 266 default=True,
267 267 )
268 268 coreconfigitem(
269 269 b'color',
270 270 b'.*',
271 271 default=None,
272 272 generic=True,
273 273 )
274 274 coreconfigitem(
275 275 b'color',
276 276 b'mode',
277 277 default=b'auto',
278 278 )
279 279 coreconfigitem(
280 280 b'color',
281 281 b'pagermode',
282 282 default=dynamicdefault,
283 283 )
284 284 coreconfigitem(
285 285 b'command-templates',
286 286 b'graphnode',
287 287 default=None,
288 288 alias=[(b'ui', b'graphnodetemplate')],
289 289 )
290 290 coreconfigitem(
291 291 b'command-templates',
292 292 b'log',
293 293 default=None,
294 294 alias=[(b'ui', b'logtemplate')],
295 295 )
296 296 coreconfigitem(
297 297 b'command-templates',
298 298 b'mergemarker',
299 299 default=(
300 300 b'{node|short} '
301 301 b'{ifeq(tags, "tip", "", '
302 302 b'ifeq(tags, "", "", "{tags} "))}'
303 303 b'{if(bookmarks, "{bookmarks} ")}'
304 304 b'{ifeq(branch, "default", "", "{branch} ")}'
305 305 b'- {author|user}: {desc|firstline}'
306 306 ),
307 307 alias=[(b'ui', b'mergemarkertemplate')],
308 308 )
309 309 coreconfigitem(
310 310 b'command-templates',
311 311 b'pre-merge-tool-output',
312 312 default=None,
313 313 alias=[(b'ui', b'pre-merge-tool-output-template')],
314 314 )
315 315 coreconfigitem(
316 316 b'command-templates',
317 317 b'oneline-summary',
318 318 default=None,
319 319 )
320 320 coreconfigitem(
321 321 b'command-templates',
322 322 b'oneline-summary.*',
323 323 default=dynamicdefault,
324 324 generic=True,
325 325 )
326 326 _registerdiffopts(section=b'commands', configprefix=b'commit.interactive.')
327 327 coreconfigitem(
328 328 b'commands',
329 329 b'commit.post-status',
330 330 default=False,
331 331 )
332 332 coreconfigitem(
333 333 b'commands',
334 334 b'grep.all-files',
335 335 default=False,
336 336 experimental=True,
337 337 )
338 338 coreconfigitem(
339 339 b'commands',
340 340 b'merge.require-rev',
341 341 default=False,
342 342 )
343 343 coreconfigitem(
344 344 b'commands',
345 345 b'push.require-revs',
346 346 default=False,
347 347 )
348 348 coreconfigitem(
349 349 b'commands',
350 350 b'resolve.confirm',
351 351 default=False,
352 352 )
353 353 coreconfigitem(
354 354 b'commands',
355 355 b'resolve.explicit-re-merge',
356 356 default=False,
357 357 )
358 358 coreconfigitem(
359 359 b'commands',
360 360 b'resolve.mark-check',
361 361 default=b'none',
362 362 )
363 363 _registerdiffopts(section=b'commands', configprefix=b'revert.interactive.')
364 364 coreconfigitem(
365 365 b'commands',
366 366 b'show.aliasprefix',
367 367 default=list,
368 368 )
369 369 coreconfigitem(
370 370 b'commands',
371 371 b'status.relative',
372 372 default=False,
373 373 )
374 374 coreconfigitem(
375 375 b'commands',
376 376 b'status.skipstates',
377 377 default=[],
378 378 experimental=True,
379 379 )
380 380 coreconfigitem(
381 381 b'commands',
382 382 b'status.terse',
383 383 default=b'',
384 384 )
385 385 coreconfigitem(
386 386 b'commands',
387 387 b'status.verbose',
388 388 default=False,
389 389 )
390 390 coreconfigitem(
391 391 b'commands',
392 392 b'update.check',
393 393 default=None,
394 394 )
395 395 coreconfigitem(
396 396 b'commands',
397 397 b'update.requiredest',
398 398 default=False,
399 399 )
400 400 coreconfigitem(
401 401 b'committemplate',
402 402 b'.*',
403 403 default=None,
404 404 generic=True,
405 405 )
406 406 coreconfigitem(
407 407 b'convert',
408 408 b'bzr.saverev',
409 409 default=True,
410 410 )
411 411 coreconfigitem(
412 412 b'convert',
413 413 b'cvsps.cache',
414 414 default=True,
415 415 )
416 416 coreconfigitem(
417 417 b'convert',
418 418 b'cvsps.fuzz',
419 419 default=60,
420 420 )
421 421 coreconfigitem(
422 422 b'convert',
423 423 b'cvsps.logencoding',
424 424 default=None,
425 425 )
426 426 coreconfigitem(
427 427 b'convert',
428 428 b'cvsps.mergefrom',
429 429 default=None,
430 430 )
431 431 coreconfigitem(
432 432 b'convert',
433 433 b'cvsps.mergeto',
434 434 default=None,
435 435 )
436 436 coreconfigitem(
437 437 b'convert',
438 438 b'git.committeractions',
439 439 default=lambda: [b'messagedifferent'],
440 440 )
441 441 coreconfigitem(
442 442 b'convert',
443 443 b'git.extrakeys',
444 444 default=list,
445 445 )
446 446 coreconfigitem(
447 447 b'convert',
448 448 b'git.findcopiesharder',
449 449 default=False,
450 450 )
451 451 coreconfigitem(
452 452 b'convert',
453 453 b'git.remoteprefix',
454 454 default=b'remote',
455 455 )
456 456 coreconfigitem(
457 457 b'convert',
458 458 b'git.renamelimit',
459 459 default=400,
460 460 )
461 461 coreconfigitem(
462 462 b'convert',
463 463 b'git.saverev',
464 464 default=True,
465 465 )
466 466 coreconfigitem(
467 467 b'convert',
468 468 b'git.similarity',
469 469 default=50,
470 470 )
471 471 coreconfigitem(
472 472 b'convert',
473 473 b'git.skipsubmodules',
474 474 default=False,
475 475 )
476 476 coreconfigitem(
477 477 b'convert',
478 478 b'hg.clonebranches',
479 479 default=False,
480 480 )
481 481 coreconfigitem(
482 482 b'convert',
483 483 b'hg.ignoreerrors',
484 484 default=False,
485 485 )
486 486 coreconfigitem(
487 487 b'convert',
488 488 b'hg.preserve-hash',
489 489 default=False,
490 490 )
491 491 coreconfigitem(
492 492 b'convert',
493 493 b'hg.revs',
494 494 default=None,
495 495 )
496 496 coreconfigitem(
497 497 b'convert',
498 498 b'hg.saverev',
499 499 default=False,
500 500 )
501 501 coreconfigitem(
502 502 b'convert',
503 503 b'hg.sourcename',
504 504 default=None,
505 505 )
506 506 coreconfigitem(
507 507 b'convert',
508 508 b'hg.startrev',
509 509 default=None,
510 510 )
511 511 coreconfigitem(
512 512 b'convert',
513 513 b'hg.tagsbranch',
514 514 default=b'default',
515 515 )
516 516 coreconfigitem(
517 517 b'convert',
518 518 b'hg.usebranchnames',
519 519 default=True,
520 520 )
521 521 coreconfigitem(
522 522 b'convert',
523 523 b'ignoreancestorcheck',
524 524 default=False,
525 525 experimental=True,
526 526 )
527 527 coreconfigitem(
528 528 b'convert',
529 529 b'localtimezone',
530 530 default=False,
531 531 )
532 532 coreconfigitem(
533 533 b'convert',
534 534 b'p4.encoding',
535 535 default=dynamicdefault,
536 536 )
537 537 coreconfigitem(
538 538 b'convert',
539 539 b'p4.startrev',
540 540 default=0,
541 541 )
542 542 coreconfigitem(
543 543 b'convert',
544 544 b'skiptags',
545 545 default=False,
546 546 )
547 547 coreconfigitem(
548 548 b'convert',
549 549 b'svn.debugsvnlog',
550 550 default=True,
551 551 )
552 552 coreconfigitem(
553 553 b'convert',
554 554 b'svn.trunk',
555 555 default=None,
556 556 )
557 557 coreconfigitem(
558 558 b'convert',
559 559 b'svn.tags',
560 560 default=None,
561 561 )
562 562 coreconfigitem(
563 563 b'convert',
564 564 b'svn.branches',
565 565 default=None,
566 566 )
567 567 coreconfigitem(
568 568 b'convert',
569 569 b'svn.startrev',
570 570 default=0,
571 571 )
572 572 coreconfigitem(
573 573 b'debug',
574 574 b'dirstate.delaywrite',
575 575 default=0,
576 576 )
577 577 coreconfigitem(
578 578 b'defaults',
579 579 b'.*',
580 580 default=None,
581 581 generic=True,
582 582 )
583 583 coreconfigitem(
584 584 b'devel',
585 585 b'all-warnings',
586 586 default=False,
587 587 )
588 588 coreconfigitem(
589 589 b'devel',
590 590 b'bundle2.debug',
591 591 default=False,
592 592 )
593 593 coreconfigitem(
594 594 b'devel',
595 595 b'bundle.delta',
596 596 default=b'',
597 597 )
598 598 coreconfigitem(
599 599 b'devel',
600 600 b'cache-vfs',
601 601 default=None,
602 602 )
603 603 coreconfigitem(
604 604 b'devel',
605 605 b'check-locks',
606 606 default=False,
607 607 )
608 608 coreconfigitem(
609 609 b'devel',
610 610 b'check-relroot',
611 611 default=False,
612 612 )
613 613 coreconfigitem(
614 614 b'devel',
615 615 b'default-date',
616 616 default=None,
617 617 )
618 618 coreconfigitem(
619 619 b'devel',
620 620 b'deprec-warn',
621 621 default=False,
622 622 )
623 623 coreconfigitem(
624 624 b'devel',
625 625 b'disableloaddefaultcerts',
626 626 default=False,
627 627 )
628 628 coreconfigitem(
629 629 b'devel',
630 630 b'warn-empty-changegroup',
631 631 default=False,
632 632 )
633 633 coreconfigitem(
634 634 b'devel',
635 635 b'legacy.exchange',
636 636 default=list,
637 637 )
638 638 coreconfigitem(
639 639 b'devel',
640 640 b'persistent-nodemap',
641 641 default=False,
642 642 )
643 643 coreconfigitem(
644 644 b'devel',
645 645 b'servercafile',
646 646 default=b'',
647 647 )
648 648 coreconfigitem(
649 649 b'devel',
650 650 b'serverexactprotocol',
651 651 default=b'',
652 652 )
653 653 coreconfigitem(
654 654 b'devel',
655 655 b'serverrequirecert',
656 656 default=False,
657 657 )
658 658 coreconfigitem(
659 659 b'devel',
660 660 b'strip-obsmarkers',
661 661 default=True,
662 662 )
663 663 coreconfigitem(
664 664 b'devel',
665 665 b'warn-config',
666 666 default=None,
667 667 )
668 668 coreconfigitem(
669 669 b'devel',
670 670 b'warn-config-default',
671 671 default=None,
672 672 )
673 673 coreconfigitem(
674 674 b'devel',
675 675 b'user.obsmarker',
676 676 default=None,
677 677 )
678 678 coreconfigitem(
679 679 b'devel',
680 680 b'warn-config-unknown',
681 681 default=None,
682 682 )
683 683 coreconfigitem(
684 684 b'devel',
685 685 b'debug.copies',
686 686 default=False,
687 687 )
688 688 coreconfigitem(
689 689 b'devel',
690 690 b'debug.extensions',
691 691 default=False,
692 692 )
693 693 coreconfigitem(
694 694 b'devel',
695 695 b'debug.repo-filters',
696 696 default=False,
697 697 )
698 698 coreconfigitem(
699 699 b'devel',
700 700 b'debug.peer-request',
701 701 default=False,
702 702 )
703 703 coreconfigitem(
704 704 b'devel',
705 705 b'discovery.randomize',
706 706 default=True,
707 707 )
708 708 _registerdiffopts(section=b'diff')
709 709 coreconfigitem(
710 710 b'email',
711 711 b'bcc',
712 712 default=None,
713 713 )
714 714 coreconfigitem(
715 715 b'email',
716 716 b'cc',
717 717 default=None,
718 718 )
719 719 coreconfigitem(
720 720 b'email',
721 721 b'charsets',
722 722 default=list,
723 723 )
724 724 coreconfigitem(
725 725 b'email',
726 726 b'from',
727 727 default=None,
728 728 )
729 729 coreconfigitem(
730 730 b'email',
731 731 b'method',
732 732 default=b'smtp',
733 733 )
734 734 coreconfigitem(
735 735 b'email',
736 736 b'reply-to',
737 737 default=None,
738 738 )
739 739 coreconfigitem(
740 740 b'email',
741 741 b'to',
742 742 default=None,
743 743 )
744 744 coreconfigitem(
745 745 b'experimental',
746 746 b'archivemetatemplate',
747 747 default=dynamicdefault,
748 748 )
749 749 coreconfigitem(
750 750 b'experimental',
751 751 b'auto-publish',
752 752 default=b'publish',
753 753 )
754 754 coreconfigitem(
755 755 b'experimental',
756 756 b'bundle-phases',
757 757 default=False,
758 758 )
759 759 coreconfigitem(
760 760 b'experimental',
761 761 b'bundle2-advertise',
762 762 default=True,
763 763 )
764 764 coreconfigitem(
765 765 b'experimental',
766 766 b'bundle2-output-capture',
767 767 default=False,
768 768 )
769 769 coreconfigitem(
770 770 b'experimental',
771 771 b'bundle2.pushback',
772 772 default=False,
773 773 )
774 774 coreconfigitem(
775 775 b'experimental',
776 776 b'bundle2lazylocking',
777 777 default=False,
778 778 )
779 779 coreconfigitem(
780 780 b'experimental',
781 781 b'bundlecomplevel',
782 782 default=None,
783 783 )
784 784 coreconfigitem(
785 785 b'experimental',
786 786 b'bundlecomplevel.bzip2',
787 787 default=None,
788 788 )
789 789 coreconfigitem(
790 790 b'experimental',
791 791 b'bundlecomplevel.gzip',
792 792 default=None,
793 793 )
794 794 coreconfigitem(
795 795 b'experimental',
796 796 b'bundlecomplevel.none',
797 797 default=None,
798 798 )
799 799 coreconfigitem(
800 800 b'experimental',
801 801 b'bundlecomplevel.zstd',
802 802 default=None,
803 803 )
804 804 coreconfigitem(
805 805 b'experimental',
806 806 b'changegroup3',
807 807 default=False,
808 808 )
809 809 coreconfigitem(
810 810 b'experimental',
811 811 b'cleanup-as-archived',
812 812 default=False,
813 813 )
814 814 coreconfigitem(
815 815 b'experimental',
816 816 b'clientcompressionengines',
817 817 default=list,
818 818 )
819 819 coreconfigitem(
820 820 b'experimental',
821 821 b'copytrace',
822 822 default=b'on',
823 823 )
824 824 coreconfigitem(
825 825 b'experimental',
826 826 b'copytrace.movecandidateslimit',
827 827 default=100,
828 828 )
829 829 coreconfigitem(
830 830 b'experimental',
831 831 b'copytrace.sourcecommitlimit',
832 832 default=100,
833 833 )
834 834 coreconfigitem(
835 835 b'experimental',
836 836 b'copies.read-from',
837 837 default=b"filelog-only",
838 838 )
839 839 coreconfigitem(
840 840 b'experimental',
841 841 b'copies.write-to',
842 842 default=b'filelog-only',
843 843 )
844 844 coreconfigitem(
845 845 b'experimental',
846 846 b'crecordtest',
847 847 default=None,
848 848 )
849 849 coreconfigitem(
850 850 b'experimental',
851 851 b'directaccess',
852 852 default=False,
853 853 )
854 854 coreconfigitem(
855 855 b'experimental',
856 856 b'directaccess.revnums',
857 857 default=False,
858 858 )
859 859 coreconfigitem(
860 860 b'experimental',
861 861 b'editortmpinhg',
862 862 default=False,
863 863 )
864 864 coreconfigitem(
865 865 b'experimental',
866 866 b'evolution',
867 867 default=list,
868 868 )
869 869 coreconfigitem(
870 870 b'experimental',
871 871 b'evolution.allowdivergence',
872 872 default=False,
873 873 alias=[(b'experimental', b'allowdivergence')],
874 874 )
875 875 coreconfigitem(
876 876 b'experimental',
877 877 b'evolution.allowunstable',
878 878 default=None,
879 879 )
880 880 coreconfigitem(
881 881 b'experimental',
882 882 b'evolution.createmarkers',
883 883 default=None,
884 884 )
885 885 coreconfigitem(
886 886 b'experimental',
887 887 b'evolution.effect-flags',
888 888 default=True,
889 889 alias=[(b'experimental', b'effect-flags')],
890 890 )
891 891 coreconfigitem(
892 892 b'experimental',
893 893 b'evolution.exchange',
894 894 default=None,
895 895 )
896 896 coreconfigitem(
897 897 b'experimental',
898 898 b'evolution.bundle-obsmarker',
899 899 default=False,
900 900 )
901 901 coreconfigitem(
902 902 b'experimental',
903 903 b'evolution.bundle-obsmarker:mandatory',
904 904 default=True,
905 905 )
906 906 coreconfigitem(
907 907 b'experimental',
908 908 b'log.topo',
909 909 default=False,
910 910 )
911 911 coreconfigitem(
912 912 b'experimental',
913 913 b'evolution.report-instabilities',
914 914 default=True,
915 915 )
916 916 coreconfigitem(
917 917 b'experimental',
918 918 b'evolution.track-operation',
919 919 default=True,
920 920 )
921 921 # repo-level config to exclude a revset visibility
922 922 #
923 923 # The target use case is to use `share` to expose different subset of the same
924 924 # repository, especially server side. See also `server.view`.
925 925 coreconfigitem(
926 926 b'experimental',
927 927 b'extra-filter-revs',
928 928 default=None,
929 929 )
930 930 coreconfigitem(
931 931 b'experimental',
932 932 b'maxdeltachainspan',
933 933 default=-1,
934 934 )
935 935 # tracks files which were undeleted (merge might delete them but we explicitly
936 936 # kept/undeleted them) and creates new filenodes for them
937 937 coreconfigitem(
938 938 b'experimental',
939 939 b'merge-track-salvaged',
940 940 default=False,
941 941 )
942 942 coreconfigitem(
943 943 b'experimental',
944 944 b'mergetempdirprefix',
945 945 default=None,
946 946 )
947 947 coreconfigitem(
948 948 b'experimental',
949 949 b'mmapindexthreshold',
950 950 default=None,
951 951 )
952 952 coreconfigitem(
953 953 b'experimental',
954 954 b'narrow',
955 955 default=False,
956 956 )
957 957 coreconfigitem(
958 958 b'experimental',
959 959 b'nonnormalparanoidcheck',
960 960 default=False,
961 961 )
962 962 coreconfigitem(
963 963 b'experimental',
964 964 b'exportableenviron',
965 965 default=list,
966 966 )
967 967 coreconfigitem(
968 968 b'experimental',
969 969 b'extendedheader.index',
970 970 default=None,
971 971 )
972 972 coreconfigitem(
973 973 b'experimental',
974 974 b'extendedheader.similarity',
975 975 default=False,
976 976 )
977 977 coreconfigitem(
978 978 b'experimental',
979 979 b'graphshorten',
980 980 default=False,
981 981 )
982 982 coreconfigitem(
983 983 b'experimental',
984 984 b'graphstyle.parent',
985 985 default=dynamicdefault,
986 986 )
987 987 coreconfigitem(
988 988 b'experimental',
989 989 b'graphstyle.missing',
990 990 default=dynamicdefault,
991 991 )
992 992 coreconfigitem(
993 993 b'experimental',
994 994 b'graphstyle.grandparent',
995 995 default=dynamicdefault,
996 996 )
997 997 coreconfigitem(
998 998 b'experimental',
999 999 b'hook-track-tags',
1000 1000 default=False,
1001 1001 )
1002 1002 coreconfigitem(
1003 1003 b'experimental',
1004 1004 b'httppeer.advertise-v2',
1005 1005 default=False,
1006 1006 )
1007 1007 coreconfigitem(
1008 1008 b'experimental',
1009 1009 b'httppeer.v2-encoder-order',
1010 1010 default=None,
1011 1011 )
1012 1012 coreconfigitem(
1013 1013 b'experimental',
1014 1014 b'httppostargs',
1015 1015 default=False,
1016 1016 )
1017 1017 coreconfigitem(b'experimental', b'nointerrupt', default=False)
1018 1018 coreconfigitem(b'experimental', b'nointerrupt-interactiveonly', default=True)
1019 1019
1020 1020 coreconfigitem(
1021 1021 b'experimental',
1022 1022 b'obsmarkers-exchange-debug',
1023 1023 default=False,
1024 1024 )
1025 1025 coreconfigitem(
1026 1026 b'experimental',
1027 1027 b'remotenames',
1028 1028 default=False,
1029 1029 )
1030 1030 coreconfigitem(
1031 1031 b'experimental',
1032 1032 b'removeemptydirs',
1033 1033 default=True,
1034 1034 )
1035 1035 coreconfigitem(
1036 1036 b'experimental',
1037 1037 b'revert.interactive.select-to-keep',
1038 1038 default=False,
1039 1039 )
1040 1040 coreconfigitem(
1041 1041 b'experimental',
1042 1042 b'revisions.prefixhexnode',
1043 1043 default=False,
1044 1044 )
1045 1045 coreconfigitem(
1046 1046 b'experimental',
1047 1047 b'revlogv2',
1048 1048 default=None,
1049 1049 )
1050 1050 coreconfigitem(
1051 1051 b'experimental',
1052 1052 b'revisions.disambiguatewithin',
1053 1053 default=None,
1054 1054 )
1055 1055 coreconfigitem(
1056 1056 b'experimental',
1057 1057 b'rust.index',
1058 1058 default=False,
1059 1059 )
1060 1060 coreconfigitem(
1061 1061 b'experimental',
1062 1062 b'server.filesdata.recommended-batch-size',
1063 1063 default=50000,
1064 1064 )
1065 1065 coreconfigitem(
1066 1066 b'experimental',
1067 1067 b'server.manifestdata.recommended-batch-size',
1068 1068 default=100000,
1069 1069 )
1070 1070 coreconfigitem(
1071 1071 b'experimental',
1072 1072 b'server.stream-narrow-clones',
1073 1073 default=False,
1074 1074 )
1075 1075 coreconfigitem(
1076 1076 b'experimental',
1077 1077 b'sharesafe-auto-downgrade-shares',
1078 1078 default=False,
1079 1079 )
1080 1080 coreconfigitem(
1081 1081 b'experimental',
1082 1082 b'sharesafe-auto-upgrade-shares',
1083 1083 default=False,
1084 1084 )
1085 1085 coreconfigitem(
1086 1086 b'experimental',
1087 b'sharesafe-auto-upgrade-fail-error',
1088 default=False,
1089 )
1090 coreconfigitem(
1091 b'experimental',
1087 1092 b'sharesafe-warn-outdated-shares',
1088 1093 default=True,
1089 1094 )
1090 1095 coreconfigitem(
1091 1096 b'experimental',
1092 1097 b'single-head-per-branch',
1093 1098 default=False,
1094 1099 )
1095 1100 coreconfigitem(
1096 1101 b'experimental',
1097 1102 b'single-head-per-branch:account-closed-heads',
1098 1103 default=False,
1099 1104 )
1100 1105 coreconfigitem(
1101 1106 b'experimental',
1102 1107 b'single-head-per-branch:public-changes-only',
1103 1108 default=False,
1104 1109 )
1105 1110 coreconfigitem(
1106 1111 b'experimental',
1107 1112 b'sshserver.support-v2',
1108 1113 default=False,
1109 1114 )
1110 1115 coreconfigitem(
1111 1116 b'experimental',
1112 1117 b'sparse-read',
1113 1118 default=False,
1114 1119 )
1115 1120 coreconfigitem(
1116 1121 b'experimental',
1117 1122 b'sparse-read.density-threshold',
1118 1123 default=0.50,
1119 1124 )
1120 1125 coreconfigitem(
1121 1126 b'experimental',
1122 1127 b'sparse-read.min-gap-size',
1123 1128 default=b'65K',
1124 1129 )
1125 1130 coreconfigitem(
1126 1131 b'experimental',
1127 1132 b'treemanifest',
1128 1133 default=False,
1129 1134 )
1130 1135 coreconfigitem(
1131 1136 b'experimental',
1132 1137 b'update.atomic-file',
1133 1138 default=False,
1134 1139 )
1135 1140 coreconfigitem(
1136 1141 b'experimental',
1137 1142 b'sshpeer.advertise-v2',
1138 1143 default=False,
1139 1144 )
1140 1145 coreconfigitem(
1141 1146 b'experimental',
1142 1147 b'web.apiserver',
1143 1148 default=False,
1144 1149 )
1145 1150 coreconfigitem(
1146 1151 b'experimental',
1147 1152 b'web.api.http-v2',
1148 1153 default=False,
1149 1154 )
1150 1155 coreconfigitem(
1151 1156 b'experimental',
1152 1157 b'web.api.debugreflect',
1153 1158 default=False,
1154 1159 )
1155 1160 coreconfigitem(
1156 1161 b'experimental',
1157 1162 b'worker.wdir-get-thread-safe',
1158 1163 default=False,
1159 1164 )
1160 1165 coreconfigitem(
1161 1166 b'experimental',
1162 1167 b'worker.repository-upgrade',
1163 1168 default=False,
1164 1169 )
1165 1170 coreconfigitem(
1166 1171 b'experimental',
1167 1172 b'xdiff',
1168 1173 default=False,
1169 1174 )
1170 1175 coreconfigitem(
1171 1176 b'extensions',
1172 1177 b'.*',
1173 1178 default=None,
1174 1179 generic=True,
1175 1180 )
1176 1181 coreconfigitem(
1177 1182 b'extdata',
1178 1183 b'.*',
1179 1184 default=None,
1180 1185 generic=True,
1181 1186 )
1182 1187 coreconfigitem(
1183 1188 b'format',
1184 1189 b'bookmarks-in-store',
1185 1190 default=False,
1186 1191 )
1187 1192 coreconfigitem(
1188 1193 b'format',
1189 1194 b'chunkcachesize',
1190 1195 default=None,
1191 1196 experimental=True,
1192 1197 )
1193 1198 coreconfigitem(
1194 1199 b'format',
1195 1200 b'dotencode',
1196 1201 default=True,
1197 1202 )
1198 1203 coreconfigitem(
1199 1204 b'format',
1200 1205 b'generaldelta',
1201 1206 default=False,
1202 1207 experimental=True,
1203 1208 )
1204 1209 coreconfigitem(
1205 1210 b'format',
1206 1211 b'manifestcachesize',
1207 1212 default=None,
1208 1213 experimental=True,
1209 1214 )
1210 1215 coreconfigitem(
1211 1216 b'format',
1212 1217 b'maxchainlen',
1213 1218 default=dynamicdefault,
1214 1219 experimental=True,
1215 1220 )
1216 1221 coreconfigitem(
1217 1222 b'format',
1218 1223 b'obsstore-version',
1219 1224 default=None,
1220 1225 )
1221 1226 coreconfigitem(
1222 1227 b'format',
1223 1228 b'sparse-revlog',
1224 1229 default=True,
1225 1230 )
1226 1231 coreconfigitem(
1227 1232 b'format',
1228 1233 b'revlog-compression',
1229 1234 default=lambda: [b'zlib'],
1230 1235 alias=[(b'experimental', b'format.compression')],
1231 1236 )
1232 1237 coreconfigitem(
1233 1238 b'format',
1234 1239 b'usefncache',
1235 1240 default=True,
1236 1241 )
1237 1242 coreconfigitem(
1238 1243 b'format',
1239 1244 b'usegeneraldelta',
1240 1245 default=True,
1241 1246 )
1242 1247 coreconfigitem(
1243 1248 b'format',
1244 1249 b'usestore',
1245 1250 default=True,
1246 1251 )
1247 1252 # Right now, the only efficient implement of the nodemap logic is in Rust, so
1248 1253 # the persistent nodemap feature needs to stay experimental as long as the Rust
1249 1254 # extensions are an experimental feature.
1250 1255 coreconfigitem(
1251 1256 b'format', b'use-persistent-nodemap', default=False, experimental=True
1252 1257 )
1253 1258 coreconfigitem(
1254 1259 b'format',
1255 1260 b'exp-use-copies-side-data-changeset',
1256 1261 default=False,
1257 1262 experimental=True,
1258 1263 )
1259 1264 coreconfigitem(
1260 1265 b'format',
1261 1266 b'exp-use-side-data',
1262 1267 default=False,
1263 1268 experimental=True,
1264 1269 )
1265 1270 coreconfigitem(
1266 1271 b'format',
1267 1272 b'exp-share-safe',
1268 1273 default=False,
1269 1274 experimental=True,
1270 1275 )
1271 1276 coreconfigitem(
1272 1277 b'format',
1273 1278 b'internal-phase',
1274 1279 default=False,
1275 1280 experimental=True,
1276 1281 )
1277 1282 coreconfigitem(
1278 1283 b'fsmonitor',
1279 1284 b'warn_when_unused',
1280 1285 default=True,
1281 1286 )
1282 1287 coreconfigitem(
1283 1288 b'fsmonitor',
1284 1289 b'warn_update_file_count',
1285 1290 default=50000,
1286 1291 )
1287 1292 coreconfigitem(
1288 1293 b'fsmonitor',
1289 1294 b'warn_update_file_count_rust',
1290 1295 default=400000,
1291 1296 )
1292 1297 coreconfigitem(
1293 1298 b'help',
1294 1299 br'hidden-command\..*',
1295 1300 default=False,
1296 1301 generic=True,
1297 1302 )
1298 1303 coreconfigitem(
1299 1304 b'help',
1300 1305 br'hidden-topic\..*',
1301 1306 default=False,
1302 1307 generic=True,
1303 1308 )
1304 1309 coreconfigitem(
1305 1310 b'hooks',
1306 1311 b'.*',
1307 1312 default=dynamicdefault,
1308 1313 generic=True,
1309 1314 )
1310 1315 coreconfigitem(
1311 1316 b'hgweb-paths',
1312 1317 b'.*',
1313 1318 default=list,
1314 1319 generic=True,
1315 1320 )
1316 1321 coreconfigitem(
1317 1322 b'hostfingerprints',
1318 1323 b'.*',
1319 1324 default=list,
1320 1325 generic=True,
1321 1326 )
1322 1327 coreconfigitem(
1323 1328 b'hostsecurity',
1324 1329 b'ciphers',
1325 1330 default=None,
1326 1331 )
1327 1332 coreconfigitem(
1328 1333 b'hostsecurity',
1329 1334 b'minimumprotocol',
1330 1335 default=dynamicdefault,
1331 1336 )
1332 1337 coreconfigitem(
1333 1338 b'hostsecurity',
1334 1339 b'.*:minimumprotocol$',
1335 1340 default=dynamicdefault,
1336 1341 generic=True,
1337 1342 )
1338 1343 coreconfigitem(
1339 1344 b'hostsecurity',
1340 1345 b'.*:ciphers$',
1341 1346 default=dynamicdefault,
1342 1347 generic=True,
1343 1348 )
1344 1349 coreconfigitem(
1345 1350 b'hostsecurity',
1346 1351 b'.*:fingerprints$',
1347 1352 default=list,
1348 1353 generic=True,
1349 1354 )
1350 1355 coreconfigitem(
1351 1356 b'hostsecurity',
1352 1357 b'.*:verifycertsfile$',
1353 1358 default=None,
1354 1359 generic=True,
1355 1360 )
1356 1361
1357 1362 coreconfigitem(
1358 1363 b'http_proxy',
1359 1364 b'always',
1360 1365 default=False,
1361 1366 )
1362 1367 coreconfigitem(
1363 1368 b'http_proxy',
1364 1369 b'host',
1365 1370 default=None,
1366 1371 )
1367 1372 coreconfigitem(
1368 1373 b'http_proxy',
1369 1374 b'no',
1370 1375 default=list,
1371 1376 )
1372 1377 coreconfigitem(
1373 1378 b'http_proxy',
1374 1379 b'passwd',
1375 1380 default=None,
1376 1381 )
1377 1382 coreconfigitem(
1378 1383 b'http_proxy',
1379 1384 b'user',
1380 1385 default=None,
1381 1386 )
1382 1387
1383 1388 coreconfigitem(
1384 1389 b'http',
1385 1390 b'timeout',
1386 1391 default=None,
1387 1392 )
1388 1393
1389 1394 coreconfigitem(
1390 1395 b'logtoprocess',
1391 1396 b'commandexception',
1392 1397 default=None,
1393 1398 )
1394 1399 coreconfigitem(
1395 1400 b'logtoprocess',
1396 1401 b'commandfinish',
1397 1402 default=None,
1398 1403 )
1399 1404 coreconfigitem(
1400 1405 b'logtoprocess',
1401 1406 b'command',
1402 1407 default=None,
1403 1408 )
1404 1409 coreconfigitem(
1405 1410 b'logtoprocess',
1406 1411 b'develwarn',
1407 1412 default=None,
1408 1413 )
1409 1414 coreconfigitem(
1410 1415 b'logtoprocess',
1411 1416 b'uiblocked',
1412 1417 default=None,
1413 1418 )
1414 1419 coreconfigitem(
1415 1420 b'merge',
1416 1421 b'checkunknown',
1417 1422 default=b'abort',
1418 1423 )
1419 1424 coreconfigitem(
1420 1425 b'merge',
1421 1426 b'checkignored',
1422 1427 default=b'abort',
1423 1428 )
1424 1429 coreconfigitem(
1425 1430 b'experimental',
1426 1431 b'merge.checkpathconflicts',
1427 1432 default=False,
1428 1433 )
1429 1434 coreconfigitem(
1430 1435 b'merge',
1431 1436 b'followcopies',
1432 1437 default=True,
1433 1438 )
1434 1439 coreconfigitem(
1435 1440 b'merge',
1436 1441 b'on-failure',
1437 1442 default=b'continue',
1438 1443 )
1439 1444 coreconfigitem(
1440 1445 b'merge',
1441 1446 b'preferancestor',
1442 1447 default=lambda: [b'*'],
1443 1448 experimental=True,
1444 1449 )
1445 1450 coreconfigitem(
1446 1451 b'merge',
1447 1452 b'strict-capability-check',
1448 1453 default=False,
1449 1454 )
1450 1455 coreconfigitem(
1451 1456 b'merge-tools',
1452 1457 b'.*',
1453 1458 default=None,
1454 1459 generic=True,
1455 1460 )
1456 1461 coreconfigitem(
1457 1462 b'merge-tools',
1458 1463 br'.*\.args$',
1459 1464 default=b"$local $base $other",
1460 1465 generic=True,
1461 1466 priority=-1,
1462 1467 )
1463 1468 coreconfigitem(
1464 1469 b'merge-tools',
1465 1470 br'.*\.binary$',
1466 1471 default=False,
1467 1472 generic=True,
1468 1473 priority=-1,
1469 1474 )
1470 1475 coreconfigitem(
1471 1476 b'merge-tools',
1472 1477 br'.*\.check$',
1473 1478 default=list,
1474 1479 generic=True,
1475 1480 priority=-1,
1476 1481 )
1477 1482 coreconfigitem(
1478 1483 b'merge-tools',
1479 1484 br'.*\.checkchanged$',
1480 1485 default=False,
1481 1486 generic=True,
1482 1487 priority=-1,
1483 1488 )
1484 1489 coreconfigitem(
1485 1490 b'merge-tools',
1486 1491 br'.*\.executable$',
1487 1492 default=dynamicdefault,
1488 1493 generic=True,
1489 1494 priority=-1,
1490 1495 )
1491 1496 coreconfigitem(
1492 1497 b'merge-tools',
1493 1498 br'.*\.fixeol$',
1494 1499 default=False,
1495 1500 generic=True,
1496 1501 priority=-1,
1497 1502 )
1498 1503 coreconfigitem(
1499 1504 b'merge-tools',
1500 1505 br'.*\.gui$',
1501 1506 default=False,
1502 1507 generic=True,
1503 1508 priority=-1,
1504 1509 )
1505 1510 coreconfigitem(
1506 1511 b'merge-tools',
1507 1512 br'.*\.mergemarkers$',
1508 1513 default=b'basic',
1509 1514 generic=True,
1510 1515 priority=-1,
1511 1516 )
1512 1517 coreconfigitem(
1513 1518 b'merge-tools',
1514 1519 br'.*\.mergemarkertemplate$',
1515 1520 default=dynamicdefault, # take from command-templates.mergemarker
1516 1521 generic=True,
1517 1522 priority=-1,
1518 1523 )
1519 1524 coreconfigitem(
1520 1525 b'merge-tools',
1521 1526 br'.*\.priority$',
1522 1527 default=0,
1523 1528 generic=True,
1524 1529 priority=-1,
1525 1530 )
1526 1531 coreconfigitem(
1527 1532 b'merge-tools',
1528 1533 br'.*\.premerge$',
1529 1534 default=dynamicdefault,
1530 1535 generic=True,
1531 1536 priority=-1,
1532 1537 )
1533 1538 coreconfigitem(
1534 1539 b'merge-tools',
1535 1540 br'.*\.symlink$',
1536 1541 default=False,
1537 1542 generic=True,
1538 1543 priority=-1,
1539 1544 )
1540 1545 coreconfigitem(
1541 1546 b'pager',
1542 1547 b'attend-.*',
1543 1548 default=dynamicdefault,
1544 1549 generic=True,
1545 1550 )
1546 1551 coreconfigitem(
1547 1552 b'pager',
1548 1553 b'ignore',
1549 1554 default=list,
1550 1555 )
1551 1556 coreconfigitem(
1552 1557 b'pager',
1553 1558 b'pager',
1554 1559 default=dynamicdefault,
1555 1560 )
1556 1561 coreconfigitem(
1557 1562 b'patch',
1558 1563 b'eol',
1559 1564 default=b'strict',
1560 1565 )
1561 1566 coreconfigitem(
1562 1567 b'patch',
1563 1568 b'fuzz',
1564 1569 default=2,
1565 1570 )
1566 1571 coreconfigitem(
1567 1572 b'paths',
1568 1573 b'default',
1569 1574 default=None,
1570 1575 )
1571 1576 coreconfigitem(
1572 1577 b'paths',
1573 1578 b'default-push',
1574 1579 default=None,
1575 1580 )
1576 1581 coreconfigitem(
1577 1582 b'paths',
1578 1583 b'.*',
1579 1584 default=None,
1580 1585 generic=True,
1581 1586 )
1582 1587 coreconfigitem(
1583 1588 b'phases',
1584 1589 b'checksubrepos',
1585 1590 default=b'follow',
1586 1591 )
1587 1592 coreconfigitem(
1588 1593 b'phases',
1589 1594 b'new-commit',
1590 1595 default=b'draft',
1591 1596 )
1592 1597 coreconfigitem(
1593 1598 b'phases',
1594 1599 b'publish',
1595 1600 default=True,
1596 1601 )
1597 1602 coreconfigitem(
1598 1603 b'profiling',
1599 1604 b'enabled',
1600 1605 default=False,
1601 1606 )
1602 1607 coreconfigitem(
1603 1608 b'profiling',
1604 1609 b'format',
1605 1610 default=b'text',
1606 1611 )
1607 1612 coreconfigitem(
1608 1613 b'profiling',
1609 1614 b'freq',
1610 1615 default=1000,
1611 1616 )
1612 1617 coreconfigitem(
1613 1618 b'profiling',
1614 1619 b'limit',
1615 1620 default=30,
1616 1621 )
1617 1622 coreconfigitem(
1618 1623 b'profiling',
1619 1624 b'nested',
1620 1625 default=0,
1621 1626 )
1622 1627 coreconfigitem(
1623 1628 b'profiling',
1624 1629 b'output',
1625 1630 default=None,
1626 1631 )
1627 1632 coreconfigitem(
1628 1633 b'profiling',
1629 1634 b'showmax',
1630 1635 default=0.999,
1631 1636 )
1632 1637 coreconfigitem(
1633 1638 b'profiling',
1634 1639 b'showmin',
1635 1640 default=dynamicdefault,
1636 1641 )
1637 1642 coreconfigitem(
1638 1643 b'profiling',
1639 1644 b'showtime',
1640 1645 default=True,
1641 1646 )
1642 1647 coreconfigitem(
1643 1648 b'profiling',
1644 1649 b'sort',
1645 1650 default=b'inlinetime',
1646 1651 )
1647 1652 coreconfigitem(
1648 1653 b'profiling',
1649 1654 b'statformat',
1650 1655 default=b'hotpath',
1651 1656 )
1652 1657 coreconfigitem(
1653 1658 b'profiling',
1654 1659 b'time-track',
1655 1660 default=dynamicdefault,
1656 1661 )
1657 1662 coreconfigitem(
1658 1663 b'profiling',
1659 1664 b'type',
1660 1665 default=b'stat',
1661 1666 )
1662 1667 coreconfigitem(
1663 1668 b'progress',
1664 1669 b'assume-tty',
1665 1670 default=False,
1666 1671 )
1667 1672 coreconfigitem(
1668 1673 b'progress',
1669 1674 b'changedelay',
1670 1675 default=1,
1671 1676 )
1672 1677 coreconfigitem(
1673 1678 b'progress',
1674 1679 b'clear-complete',
1675 1680 default=True,
1676 1681 )
1677 1682 coreconfigitem(
1678 1683 b'progress',
1679 1684 b'debug',
1680 1685 default=False,
1681 1686 )
1682 1687 coreconfigitem(
1683 1688 b'progress',
1684 1689 b'delay',
1685 1690 default=3,
1686 1691 )
1687 1692 coreconfigitem(
1688 1693 b'progress',
1689 1694 b'disable',
1690 1695 default=False,
1691 1696 )
1692 1697 coreconfigitem(
1693 1698 b'progress',
1694 1699 b'estimateinterval',
1695 1700 default=60.0,
1696 1701 )
1697 1702 coreconfigitem(
1698 1703 b'progress',
1699 1704 b'format',
1700 1705 default=lambda: [b'topic', b'bar', b'number', b'estimate'],
1701 1706 )
1702 1707 coreconfigitem(
1703 1708 b'progress',
1704 1709 b'refresh',
1705 1710 default=0.1,
1706 1711 )
1707 1712 coreconfigitem(
1708 1713 b'progress',
1709 1714 b'width',
1710 1715 default=dynamicdefault,
1711 1716 )
1712 1717 coreconfigitem(
1713 1718 b'pull',
1714 1719 b'confirm',
1715 1720 default=False,
1716 1721 )
1717 1722 coreconfigitem(
1718 1723 b'push',
1719 1724 b'pushvars.server',
1720 1725 default=False,
1721 1726 )
1722 1727 coreconfigitem(
1723 1728 b'rewrite',
1724 1729 b'backup-bundle',
1725 1730 default=True,
1726 1731 alias=[(b'ui', b'history-editing-backup')],
1727 1732 )
1728 1733 coreconfigitem(
1729 1734 b'rewrite',
1730 1735 b'update-timestamp',
1731 1736 default=False,
1732 1737 )
1733 1738 coreconfigitem(
1734 1739 b'rewrite',
1735 1740 b'empty-successor',
1736 1741 default=b'skip',
1737 1742 experimental=True,
1738 1743 )
1739 1744 coreconfigitem(
1740 1745 b'storage',
1741 1746 b'new-repo-backend',
1742 1747 default=b'revlogv1',
1743 1748 experimental=True,
1744 1749 )
1745 1750 coreconfigitem(
1746 1751 b'storage',
1747 1752 b'revlog.optimize-delta-parent-choice',
1748 1753 default=True,
1749 1754 alias=[(b'format', b'aggressivemergedeltas')],
1750 1755 )
1751 1756 # experimental as long as rust is experimental (or a C version is implemented)
1752 1757 coreconfigitem(
1753 1758 b'storage', b'revlog.nodemap.mmap', default=True, experimental=True
1754 1759 )
1755 1760 # experimental as long as format.use-persistent-nodemap is.
1756 1761 coreconfigitem(
1757 1762 b'storage', b'revlog.nodemap.mode', default=b'compat', experimental=True
1758 1763 )
1759 1764 coreconfigitem(
1760 1765 b'storage',
1761 1766 b'revlog.reuse-external-delta',
1762 1767 default=True,
1763 1768 )
1764 1769 coreconfigitem(
1765 1770 b'storage',
1766 1771 b'revlog.reuse-external-delta-parent',
1767 1772 default=None,
1768 1773 )
1769 1774 coreconfigitem(
1770 1775 b'storage',
1771 1776 b'revlog.zlib.level',
1772 1777 default=None,
1773 1778 )
1774 1779 coreconfigitem(
1775 1780 b'storage',
1776 1781 b'revlog.zstd.level',
1777 1782 default=None,
1778 1783 )
1779 1784 coreconfigitem(
1780 1785 b'server',
1781 1786 b'bookmarks-pushkey-compat',
1782 1787 default=True,
1783 1788 )
1784 1789 coreconfigitem(
1785 1790 b'server',
1786 1791 b'bundle1',
1787 1792 default=True,
1788 1793 )
1789 1794 coreconfigitem(
1790 1795 b'server',
1791 1796 b'bundle1gd',
1792 1797 default=None,
1793 1798 )
1794 1799 coreconfigitem(
1795 1800 b'server',
1796 1801 b'bundle1.pull',
1797 1802 default=None,
1798 1803 )
1799 1804 coreconfigitem(
1800 1805 b'server',
1801 1806 b'bundle1gd.pull',
1802 1807 default=None,
1803 1808 )
1804 1809 coreconfigitem(
1805 1810 b'server',
1806 1811 b'bundle1.push',
1807 1812 default=None,
1808 1813 )
1809 1814 coreconfigitem(
1810 1815 b'server',
1811 1816 b'bundle1gd.push',
1812 1817 default=None,
1813 1818 )
1814 1819 coreconfigitem(
1815 1820 b'server',
1816 1821 b'bundle2.stream',
1817 1822 default=True,
1818 1823 alias=[(b'experimental', b'bundle2.stream')],
1819 1824 )
1820 1825 coreconfigitem(
1821 1826 b'server',
1822 1827 b'compressionengines',
1823 1828 default=list,
1824 1829 )
1825 1830 coreconfigitem(
1826 1831 b'server',
1827 1832 b'concurrent-push-mode',
1828 1833 default=b'check-related',
1829 1834 )
1830 1835 coreconfigitem(
1831 1836 b'server',
1832 1837 b'disablefullbundle',
1833 1838 default=False,
1834 1839 )
1835 1840 coreconfigitem(
1836 1841 b'server',
1837 1842 b'maxhttpheaderlen',
1838 1843 default=1024,
1839 1844 )
1840 1845 coreconfigitem(
1841 1846 b'server',
1842 1847 b'pullbundle',
1843 1848 default=False,
1844 1849 )
1845 1850 coreconfigitem(
1846 1851 b'server',
1847 1852 b'preferuncompressed',
1848 1853 default=False,
1849 1854 )
1850 1855 coreconfigitem(
1851 1856 b'server',
1852 1857 b'streamunbundle',
1853 1858 default=False,
1854 1859 )
1855 1860 coreconfigitem(
1856 1861 b'server',
1857 1862 b'uncompressed',
1858 1863 default=True,
1859 1864 )
1860 1865 coreconfigitem(
1861 1866 b'server',
1862 1867 b'uncompressedallowsecret',
1863 1868 default=False,
1864 1869 )
1865 1870 coreconfigitem(
1866 1871 b'server',
1867 1872 b'view',
1868 1873 default=b'served',
1869 1874 )
1870 1875 coreconfigitem(
1871 1876 b'server',
1872 1877 b'validate',
1873 1878 default=False,
1874 1879 )
1875 1880 coreconfigitem(
1876 1881 b'server',
1877 1882 b'zliblevel',
1878 1883 default=-1,
1879 1884 )
1880 1885 coreconfigitem(
1881 1886 b'server',
1882 1887 b'zstdlevel',
1883 1888 default=3,
1884 1889 )
1885 1890 coreconfigitem(
1886 1891 b'share',
1887 1892 b'pool',
1888 1893 default=None,
1889 1894 )
1890 1895 coreconfigitem(
1891 1896 b'share',
1892 1897 b'poolnaming',
1893 1898 default=b'identity',
1894 1899 )
1895 1900 coreconfigitem(
1896 1901 b'shelve',
1897 1902 b'maxbackups',
1898 1903 default=10,
1899 1904 )
1900 1905 coreconfigitem(
1901 1906 b'smtp',
1902 1907 b'host',
1903 1908 default=None,
1904 1909 )
1905 1910 coreconfigitem(
1906 1911 b'smtp',
1907 1912 b'local_hostname',
1908 1913 default=None,
1909 1914 )
1910 1915 coreconfigitem(
1911 1916 b'smtp',
1912 1917 b'password',
1913 1918 default=None,
1914 1919 )
1915 1920 coreconfigitem(
1916 1921 b'smtp',
1917 1922 b'port',
1918 1923 default=dynamicdefault,
1919 1924 )
1920 1925 coreconfigitem(
1921 1926 b'smtp',
1922 1927 b'tls',
1923 1928 default=b'none',
1924 1929 )
1925 1930 coreconfigitem(
1926 1931 b'smtp',
1927 1932 b'username',
1928 1933 default=None,
1929 1934 )
1930 1935 coreconfigitem(
1931 1936 b'sparse',
1932 1937 b'missingwarning',
1933 1938 default=True,
1934 1939 experimental=True,
1935 1940 )
1936 1941 coreconfigitem(
1937 1942 b'subrepos',
1938 1943 b'allowed',
1939 1944 default=dynamicdefault, # to make backporting simpler
1940 1945 )
1941 1946 coreconfigitem(
1942 1947 b'subrepos',
1943 1948 b'hg:allowed',
1944 1949 default=dynamicdefault,
1945 1950 )
1946 1951 coreconfigitem(
1947 1952 b'subrepos',
1948 1953 b'git:allowed',
1949 1954 default=dynamicdefault,
1950 1955 )
1951 1956 coreconfigitem(
1952 1957 b'subrepos',
1953 1958 b'svn:allowed',
1954 1959 default=dynamicdefault,
1955 1960 )
1956 1961 coreconfigitem(
1957 1962 b'templates',
1958 1963 b'.*',
1959 1964 default=None,
1960 1965 generic=True,
1961 1966 )
1962 1967 coreconfigitem(
1963 1968 b'templateconfig',
1964 1969 b'.*',
1965 1970 default=dynamicdefault,
1966 1971 generic=True,
1967 1972 )
1968 1973 coreconfigitem(
1969 1974 b'trusted',
1970 1975 b'groups',
1971 1976 default=list,
1972 1977 )
1973 1978 coreconfigitem(
1974 1979 b'trusted',
1975 1980 b'users',
1976 1981 default=list,
1977 1982 )
1978 1983 coreconfigitem(
1979 1984 b'ui',
1980 1985 b'_usedassubrepo',
1981 1986 default=False,
1982 1987 )
1983 1988 coreconfigitem(
1984 1989 b'ui',
1985 1990 b'allowemptycommit',
1986 1991 default=False,
1987 1992 )
1988 1993 coreconfigitem(
1989 1994 b'ui',
1990 1995 b'archivemeta',
1991 1996 default=True,
1992 1997 )
1993 1998 coreconfigitem(
1994 1999 b'ui',
1995 2000 b'askusername',
1996 2001 default=False,
1997 2002 )
1998 2003 coreconfigitem(
1999 2004 b'ui',
2000 2005 b'available-memory',
2001 2006 default=None,
2002 2007 )
2003 2008
2004 2009 coreconfigitem(
2005 2010 b'ui',
2006 2011 b'clonebundlefallback',
2007 2012 default=False,
2008 2013 )
2009 2014 coreconfigitem(
2010 2015 b'ui',
2011 2016 b'clonebundleprefers',
2012 2017 default=list,
2013 2018 )
2014 2019 coreconfigitem(
2015 2020 b'ui',
2016 2021 b'clonebundles',
2017 2022 default=True,
2018 2023 )
2019 2024 coreconfigitem(
2020 2025 b'ui',
2021 2026 b'color',
2022 2027 default=b'auto',
2023 2028 )
2024 2029 coreconfigitem(
2025 2030 b'ui',
2026 2031 b'commitsubrepos',
2027 2032 default=False,
2028 2033 )
2029 2034 coreconfigitem(
2030 2035 b'ui',
2031 2036 b'debug',
2032 2037 default=False,
2033 2038 )
2034 2039 coreconfigitem(
2035 2040 b'ui',
2036 2041 b'debugger',
2037 2042 default=None,
2038 2043 )
2039 2044 coreconfigitem(
2040 2045 b'ui',
2041 2046 b'editor',
2042 2047 default=dynamicdefault,
2043 2048 )
2044 2049 coreconfigitem(
2045 2050 b'ui',
2046 2051 b'detailed-exit-code',
2047 2052 default=False,
2048 2053 experimental=True,
2049 2054 )
2050 2055 coreconfigitem(
2051 2056 b'ui',
2052 2057 b'fallbackencoding',
2053 2058 default=None,
2054 2059 )
2055 2060 coreconfigitem(
2056 2061 b'ui',
2057 2062 b'forcecwd',
2058 2063 default=None,
2059 2064 )
2060 2065 coreconfigitem(
2061 2066 b'ui',
2062 2067 b'forcemerge',
2063 2068 default=None,
2064 2069 )
2065 2070 coreconfigitem(
2066 2071 b'ui',
2067 2072 b'formatdebug',
2068 2073 default=False,
2069 2074 )
2070 2075 coreconfigitem(
2071 2076 b'ui',
2072 2077 b'formatjson',
2073 2078 default=False,
2074 2079 )
2075 2080 coreconfigitem(
2076 2081 b'ui',
2077 2082 b'formatted',
2078 2083 default=None,
2079 2084 )
2080 2085 coreconfigitem(
2081 2086 b'ui',
2082 2087 b'interactive',
2083 2088 default=None,
2084 2089 )
2085 2090 coreconfigitem(
2086 2091 b'ui',
2087 2092 b'interface',
2088 2093 default=None,
2089 2094 )
2090 2095 coreconfigitem(
2091 2096 b'ui',
2092 2097 b'interface.chunkselector',
2093 2098 default=None,
2094 2099 )
2095 2100 coreconfigitem(
2096 2101 b'ui',
2097 2102 b'large-file-limit',
2098 2103 default=10000000,
2099 2104 )
2100 2105 coreconfigitem(
2101 2106 b'ui',
2102 2107 b'logblockedtimes',
2103 2108 default=False,
2104 2109 )
2105 2110 coreconfigitem(
2106 2111 b'ui',
2107 2112 b'merge',
2108 2113 default=None,
2109 2114 )
2110 2115 coreconfigitem(
2111 2116 b'ui',
2112 2117 b'mergemarkers',
2113 2118 default=b'basic',
2114 2119 )
2115 2120 coreconfigitem(
2116 2121 b'ui',
2117 2122 b'message-output',
2118 2123 default=b'stdio',
2119 2124 )
2120 2125 coreconfigitem(
2121 2126 b'ui',
2122 2127 b'nontty',
2123 2128 default=False,
2124 2129 )
2125 2130 coreconfigitem(
2126 2131 b'ui',
2127 2132 b'origbackuppath',
2128 2133 default=None,
2129 2134 )
2130 2135 coreconfigitem(
2131 2136 b'ui',
2132 2137 b'paginate',
2133 2138 default=True,
2134 2139 )
2135 2140 coreconfigitem(
2136 2141 b'ui',
2137 2142 b'patch',
2138 2143 default=None,
2139 2144 )
2140 2145 coreconfigitem(
2141 2146 b'ui',
2142 2147 b'portablefilenames',
2143 2148 default=b'warn',
2144 2149 )
2145 2150 coreconfigitem(
2146 2151 b'ui',
2147 2152 b'promptecho',
2148 2153 default=False,
2149 2154 )
2150 2155 coreconfigitem(
2151 2156 b'ui',
2152 2157 b'quiet',
2153 2158 default=False,
2154 2159 )
2155 2160 coreconfigitem(
2156 2161 b'ui',
2157 2162 b'quietbookmarkmove',
2158 2163 default=False,
2159 2164 )
2160 2165 coreconfigitem(
2161 2166 b'ui',
2162 2167 b'relative-paths',
2163 2168 default=b'legacy',
2164 2169 )
2165 2170 coreconfigitem(
2166 2171 b'ui',
2167 2172 b'remotecmd',
2168 2173 default=b'hg',
2169 2174 )
2170 2175 coreconfigitem(
2171 2176 b'ui',
2172 2177 b'report_untrusted',
2173 2178 default=True,
2174 2179 )
2175 2180 coreconfigitem(
2176 2181 b'ui',
2177 2182 b'rollback',
2178 2183 default=True,
2179 2184 )
2180 2185 coreconfigitem(
2181 2186 b'ui',
2182 2187 b'signal-safe-lock',
2183 2188 default=True,
2184 2189 )
2185 2190 coreconfigitem(
2186 2191 b'ui',
2187 2192 b'slash',
2188 2193 default=False,
2189 2194 )
2190 2195 coreconfigitem(
2191 2196 b'ui',
2192 2197 b'ssh',
2193 2198 default=b'ssh',
2194 2199 )
2195 2200 coreconfigitem(
2196 2201 b'ui',
2197 2202 b'ssherrorhint',
2198 2203 default=None,
2199 2204 )
2200 2205 coreconfigitem(
2201 2206 b'ui',
2202 2207 b'statuscopies',
2203 2208 default=False,
2204 2209 )
2205 2210 coreconfigitem(
2206 2211 b'ui',
2207 2212 b'strict',
2208 2213 default=False,
2209 2214 )
2210 2215 coreconfigitem(
2211 2216 b'ui',
2212 2217 b'style',
2213 2218 default=b'',
2214 2219 )
2215 2220 coreconfigitem(
2216 2221 b'ui',
2217 2222 b'supportcontact',
2218 2223 default=None,
2219 2224 )
2220 2225 coreconfigitem(
2221 2226 b'ui',
2222 2227 b'textwidth',
2223 2228 default=78,
2224 2229 )
2225 2230 coreconfigitem(
2226 2231 b'ui',
2227 2232 b'timeout',
2228 2233 default=b'600',
2229 2234 )
2230 2235 coreconfigitem(
2231 2236 b'ui',
2232 2237 b'timeout.warn',
2233 2238 default=0,
2234 2239 )
2235 2240 coreconfigitem(
2236 2241 b'ui',
2237 2242 b'timestamp-output',
2238 2243 default=False,
2239 2244 )
2240 2245 coreconfigitem(
2241 2246 b'ui',
2242 2247 b'traceback',
2243 2248 default=False,
2244 2249 )
2245 2250 coreconfigitem(
2246 2251 b'ui',
2247 2252 b'tweakdefaults',
2248 2253 default=False,
2249 2254 )
2250 2255 coreconfigitem(b'ui', b'username', alias=[(b'ui', b'user')])
2251 2256 coreconfigitem(
2252 2257 b'ui',
2253 2258 b'verbose',
2254 2259 default=False,
2255 2260 )
2256 2261 coreconfigitem(
2257 2262 b'verify',
2258 2263 b'skipflags',
2259 2264 default=None,
2260 2265 )
2261 2266 coreconfigitem(
2262 2267 b'web',
2263 2268 b'allowbz2',
2264 2269 default=False,
2265 2270 )
2266 2271 coreconfigitem(
2267 2272 b'web',
2268 2273 b'allowgz',
2269 2274 default=False,
2270 2275 )
2271 2276 coreconfigitem(
2272 2277 b'web',
2273 2278 b'allow-pull',
2274 2279 alias=[(b'web', b'allowpull')],
2275 2280 default=True,
2276 2281 )
2277 2282 coreconfigitem(
2278 2283 b'web',
2279 2284 b'allow-push',
2280 2285 alias=[(b'web', b'allow_push')],
2281 2286 default=list,
2282 2287 )
2283 2288 coreconfigitem(
2284 2289 b'web',
2285 2290 b'allowzip',
2286 2291 default=False,
2287 2292 )
2288 2293 coreconfigitem(
2289 2294 b'web',
2290 2295 b'archivesubrepos',
2291 2296 default=False,
2292 2297 )
2293 2298 coreconfigitem(
2294 2299 b'web',
2295 2300 b'cache',
2296 2301 default=True,
2297 2302 )
2298 2303 coreconfigitem(
2299 2304 b'web',
2300 2305 b'comparisoncontext',
2301 2306 default=5,
2302 2307 )
2303 2308 coreconfigitem(
2304 2309 b'web',
2305 2310 b'contact',
2306 2311 default=None,
2307 2312 )
2308 2313 coreconfigitem(
2309 2314 b'web',
2310 2315 b'deny_push',
2311 2316 default=list,
2312 2317 )
2313 2318 coreconfigitem(
2314 2319 b'web',
2315 2320 b'guessmime',
2316 2321 default=False,
2317 2322 )
2318 2323 coreconfigitem(
2319 2324 b'web',
2320 2325 b'hidden',
2321 2326 default=False,
2322 2327 )
2323 2328 coreconfigitem(
2324 2329 b'web',
2325 2330 b'labels',
2326 2331 default=list,
2327 2332 )
2328 2333 coreconfigitem(
2329 2334 b'web',
2330 2335 b'logoimg',
2331 2336 default=b'hglogo.png',
2332 2337 )
2333 2338 coreconfigitem(
2334 2339 b'web',
2335 2340 b'logourl',
2336 2341 default=b'https://mercurial-scm.org/',
2337 2342 )
2338 2343 coreconfigitem(
2339 2344 b'web',
2340 2345 b'accesslog',
2341 2346 default=b'-',
2342 2347 )
2343 2348 coreconfigitem(
2344 2349 b'web',
2345 2350 b'address',
2346 2351 default=b'',
2347 2352 )
2348 2353 coreconfigitem(
2349 2354 b'web',
2350 2355 b'allow-archive',
2351 2356 alias=[(b'web', b'allow_archive')],
2352 2357 default=list,
2353 2358 )
2354 2359 coreconfigitem(
2355 2360 b'web',
2356 2361 b'allow_read',
2357 2362 default=list,
2358 2363 )
2359 2364 coreconfigitem(
2360 2365 b'web',
2361 2366 b'baseurl',
2362 2367 default=None,
2363 2368 )
2364 2369 coreconfigitem(
2365 2370 b'web',
2366 2371 b'cacerts',
2367 2372 default=None,
2368 2373 )
2369 2374 coreconfigitem(
2370 2375 b'web',
2371 2376 b'certificate',
2372 2377 default=None,
2373 2378 )
2374 2379 coreconfigitem(
2375 2380 b'web',
2376 2381 b'collapse',
2377 2382 default=False,
2378 2383 )
2379 2384 coreconfigitem(
2380 2385 b'web',
2381 2386 b'csp',
2382 2387 default=None,
2383 2388 )
2384 2389 coreconfigitem(
2385 2390 b'web',
2386 2391 b'deny_read',
2387 2392 default=list,
2388 2393 )
2389 2394 coreconfigitem(
2390 2395 b'web',
2391 2396 b'descend',
2392 2397 default=True,
2393 2398 )
2394 2399 coreconfigitem(
2395 2400 b'web',
2396 2401 b'description',
2397 2402 default=b"",
2398 2403 )
2399 2404 coreconfigitem(
2400 2405 b'web',
2401 2406 b'encoding',
2402 2407 default=lambda: encoding.encoding,
2403 2408 )
2404 2409 coreconfigitem(
2405 2410 b'web',
2406 2411 b'errorlog',
2407 2412 default=b'-',
2408 2413 )
2409 2414 coreconfigitem(
2410 2415 b'web',
2411 2416 b'ipv6',
2412 2417 default=False,
2413 2418 )
2414 2419 coreconfigitem(
2415 2420 b'web',
2416 2421 b'maxchanges',
2417 2422 default=10,
2418 2423 )
2419 2424 coreconfigitem(
2420 2425 b'web',
2421 2426 b'maxfiles',
2422 2427 default=10,
2423 2428 )
2424 2429 coreconfigitem(
2425 2430 b'web',
2426 2431 b'maxshortchanges',
2427 2432 default=60,
2428 2433 )
2429 2434 coreconfigitem(
2430 2435 b'web',
2431 2436 b'motd',
2432 2437 default=b'',
2433 2438 )
2434 2439 coreconfigitem(
2435 2440 b'web',
2436 2441 b'name',
2437 2442 default=dynamicdefault,
2438 2443 )
2439 2444 coreconfigitem(
2440 2445 b'web',
2441 2446 b'port',
2442 2447 default=8000,
2443 2448 )
2444 2449 coreconfigitem(
2445 2450 b'web',
2446 2451 b'prefix',
2447 2452 default=b'',
2448 2453 )
2449 2454 coreconfigitem(
2450 2455 b'web',
2451 2456 b'push_ssl',
2452 2457 default=True,
2453 2458 )
2454 2459 coreconfigitem(
2455 2460 b'web',
2456 2461 b'refreshinterval',
2457 2462 default=20,
2458 2463 )
2459 2464 coreconfigitem(
2460 2465 b'web',
2461 2466 b'server-header',
2462 2467 default=None,
2463 2468 )
2464 2469 coreconfigitem(
2465 2470 b'web',
2466 2471 b'static',
2467 2472 default=None,
2468 2473 )
2469 2474 coreconfigitem(
2470 2475 b'web',
2471 2476 b'staticurl',
2472 2477 default=None,
2473 2478 )
2474 2479 coreconfigitem(
2475 2480 b'web',
2476 2481 b'stripes',
2477 2482 default=1,
2478 2483 )
2479 2484 coreconfigitem(
2480 2485 b'web',
2481 2486 b'style',
2482 2487 default=b'paper',
2483 2488 )
2484 2489 coreconfigitem(
2485 2490 b'web',
2486 2491 b'templates',
2487 2492 default=None,
2488 2493 )
2489 2494 coreconfigitem(
2490 2495 b'web',
2491 2496 b'view',
2492 2497 default=b'served',
2493 2498 experimental=True,
2494 2499 )
2495 2500 coreconfigitem(
2496 2501 b'worker',
2497 2502 b'backgroundclose',
2498 2503 default=dynamicdefault,
2499 2504 )
2500 2505 # Windows defaults to a limit of 512 open files. A buffer of 128
2501 2506 # should give us enough headway.
2502 2507 coreconfigitem(
2503 2508 b'worker',
2504 2509 b'backgroundclosemaxqueue',
2505 2510 default=384,
2506 2511 )
2507 2512 coreconfigitem(
2508 2513 b'worker',
2509 2514 b'backgroundcloseminfilecount',
2510 2515 default=2048,
2511 2516 )
2512 2517 coreconfigitem(
2513 2518 b'worker',
2514 2519 b'backgroundclosethreadcount',
2515 2520 default=4,
2516 2521 )
2517 2522 coreconfigitem(
2518 2523 b'worker',
2519 2524 b'enabled',
2520 2525 default=True,
2521 2526 )
2522 2527 coreconfigitem(
2523 2528 b'worker',
2524 2529 b'numcpus',
2525 2530 default=None,
2526 2531 )
2527 2532
2528 2533 # Rebase related configuration moved to core because other extension are doing
2529 2534 # strange things. For example, shelve import the extensions to reuse some bit
2530 2535 # without formally loading it.
2531 2536 coreconfigitem(
2532 2537 b'commands',
2533 2538 b'rebase.requiredest',
2534 2539 default=False,
2535 2540 )
2536 2541 coreconfigitem(
2537 2542 b'experimental',
2538 2543 b'rebaseskipobsolete',
2539 2544 default=True,
2540 2545 )
2541 2546 coreconfigitem(
2542 2547 b'rebase',
2543 2548 b'singletransaction',
2544 2549 default=False,
2545 2550 )
2546 2551 coreconfigitem(
2547 2552 b'rebase',
2548 2553 b'experimental.inmemory',
2549 2554 default=False,
2550 2555 )
@@ -1,298 +1,303 b''
1 1 # upgrade.py - functions for in place upgrade of Mercurial repository
2 2 #
3 3 # Copyright (c) 2016-present, Gregory Szorc
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 from __future__ import absolute_import
9 9
10 10 from .i18n import _
11 11 from . import (
12 12 error,
13 13 hg,
14 14 localrepo,
15 15 lock as lockmod,
16 16 pycompat,
17 17 requirements as requirementsmod,
18 18 scmutil,
19 19 )
20 20
21 21 from .upgrade_utils import (
22 22 actions as upgrade_actions,
23 23 engine as upgrade_engine,
24 24 )
25 25
26 26 from .utils import (
27 27 stringutil,
28 28 )
29 29
30 30 allformatvariant = upgrade_actions.allformatvariant
31 31
32 32
33 33 def upgraderepo(
34 34 ui,
35 35 repo,
36 36 run=False,
37 37 optimize=None,
38 38 backup=True,
39 39 manifest=None,
40 40 changelog=None,
41 41 filelogs=None,
42 42 ):
43 43 """Upgrade a repository in place."""
44 44 if optimize is None:
45 45 optimize = {}
46 46 repo = repo.unfiltered()
47 47
48 48 revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
49 49 specentries = (
50 50 (upgrade_engine.UPGRADE_CHANGELOG, changelog),
51 51 (upgrade_engine.UPGRADE_MANIFEST, manifest),
52 52 (upgrade_engine.UPGRADE_FILELOGS, filelogs),
53 53 )
54 54 specified = [(y, x) for (y, x) in specentries if x is not None]
55 55 if specified:
56 56 # we have some limitation on revlogs to be recloned
57 57 if any(x for y, x in specified):
58 58 revlogs = set()
59 59 for upgrade, enabled in specified:
60 60 if enabled:
61 61 revlogs.add(upgrade)
62 62 else:
63 63 # none are enabled
64 64 for upgrade, __ in specified:
65 65 revlogs.discard(upgrade)
66 66
67 67 # Ensure the repository can be upgraded.
68 68 upgrade_actions.check_source_requirements(repo)
69 69
70 70 default_options = localrepo.defaultcreateopts(repo.ui)
71 71 newreqs = localrepo.newreporequirements(repo.ui, default_options)
72 72 newreqs.update(upgrade_actions.preservedrequirements(repo))
73 73
74 74 upgrade_actions.check_requirements_changes(repo, newreqs)
75 75
76 76 # Find and validate all improvements that can be made.
77 77 alloptimizations = upgrade_actions.findoptimizations(repo)
78 78
79 79 # Apply and Validate arguments.
80 80 optimizations = []
81 81 for o in alloptimizations:
82 82 if o.name in optimize:
83 83 optimizations.append(o)
84 84 optimize.discard(o.name)
85 85
86 86 if optimize: # anything left is unknown
87 87 raise error.Abort(
88 88 _(b'unknown optimization action requested: %s')
89 89 % b', '.join(sorted(optimize)),
90 90 hint=_(b'run without arguments to see valid optimizations'),
91 91 )
92 92
93 93 format_upgrades = upgrade_actions.find_format_upgrades(repo)
94 94 up_actions = upgrade_actions.determine_upgrade_actions(
95 95 repo, format_upgrades, optimizations, repo.requirements, newreqs
96 96 )
97 97 removed_actions = upgrade_actions.find_format_downgrades(repo)
98 98
99 99 removedreqs = repo.requirements - newreqs
100 100 addedreqs = newreqs - repo.requirements
101 101
102 102 if revlogs != upgrade_engine.UPGRADE_ALL_REVLOGS:
103 103 incompatible = upgrade_actions.RECLONES_REQUIREMENTS & (
104 104 removedreqs | addedreqs
105 105 )
106 106 if incompatible:
107 107 msg = _(
108 108 b'ignoring revlogs selection flags, format requirements '
109 109 b'change: %s\n'
110 110 )
111 111 ui.warn(msg % b', '.join(sorted(incompatible)))
112 112 revlogs = upgrade_engine.UPGRADE_ALL_REVLOGS
113 113
114 114 upgrade_op = upgrade_actions.UpgradeOperation(
115 115 ui,
116 116 newreqs,
117 117 repo.requirements,
118 118 up_actions,
119 119 removed_actions,
120 120 revlogs,
121 121 )
122 122
123 123 if not run:
124 124 fromconfig = []
125 125 onlydefault = []
126 126
127 127 for d in format_upgrades:
128 128 if d.fromconfig(repo):
129 129 fromconfig.append(d)
130 130 elif d.default:
131 131 onlydefault.append(d)
132 132
133 133 if fromconfig or onlydefault:
134 134
135 135 if fromconfig:
136 136 ui.status(
137 137 _(
138 138 b'repository lacks features recommended by '
139 139 b'current config options:\n\n'
140 140 )
141 141 )
142 142 for i in fromconfig:
143 143 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
144 144
145 145 if onlydefault:
146 146 ui.status(
147 147 _(
148 148 b'repository lacks features used by the default '
149 149 b'config options:\n\n'
150 150 )
151 151 )
152 152 for i in onlydefault:
153 153 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
154 154
155 155 ui.status(b'\n')
156 156 else:
157 157 ui.status(_(b'(no format upgrades found in existing repository)\n'))
158 158
159 159 ui.status(
160 160 _(
161 161 b'performing an upgrade with "--run" will make the following '
162 162 b'changes:\n\n'
163 163 )
164 164 )
165 165
166 166 upgrade_op.print_requirements()
167 167 upgrade_op.print_optimisations()
168 168 upgrade_op.print_upgrade_actions()
169 169 upgrade_op.print_affected_revlogs()
170 170
171 171 if upgrade_op.unused_optimizations:
172 172 ui.status(
173 173 _(
174 174 b'additional optimizations are available by specifying '
175 175 b'"--optimize <name>":\n\n'
176 176 )
177 177 )
178 178 upgrade_op.print_unused_optimizations()
179 179 return
180 180
181 181 if not (upgrade_op.upgrade_actions or upgrade_op.removed_actions):
182 182 ui.status(_(b'nothing to do\n'))
183 183 return
184 184 # Else we're in the run=true case.
185 185 ui.write(_(b'upgrade will perform the following actions:\n\n'))
186 186 upgrade_op.print_requirements()
187 187 upgrade_op.print_optimisations()
188 188 upgrade_op.print_upgrade_actions()
189 189 upgrade_op.print_affected_revlogs()
190 190
191 191 ui.status(_(b'beginning upgrade...\n'))
192 192 with repo.wlock(), repo.lock():
193 193 ui.status(_(b'repository locked and read-only\n'))
194 194 # Our strategy for upgrading the repository is to create a new,
195 195 # temporary repository, write data to it, then do a swap of the
196 196 # data. There are less heavyweight ways to do this, but it is easier
197 197 # to create a new repo object than to instantiate all the components
198 198 # (like the store) separately.
199 199 tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path)
200 200 backuppath = None
201 201 try:
202 202 ui.status(
203 203 _(
204 204 b'creating temporary repository to stage upgraded '
205 205 b'data: %s\n'
206 206 )
207 207 % tmppath
208 208 )
209 209
210 210 # clone ui without using ui.copy because repo.ui is protected
211 211 repoui = repo.ui.__class__(repo.ui)
212 212 dstrepo = hg.repository(repoui, path=tmppath, create=True)
213 213
214 214 with dstrepo.wlock(), dstrepo.lock():
215 215 backuppath = upgrade_engine.upgrade(
216 216 ui, repo, dstrepo, upgrade_op
217 217 )
218 218 if not backup:
219 219 ui.status(
220 220 _(b'removing old repository content %s\n') % backuppath
221 221 )
222 222 repo.vfs.rmtree(backuppath, forcibly=True)
223 223 backuppath = None
224 224
225 225 finally:
226 226 ui.status(_(b'removing temporary repository %s\n') % tmppath)
227 227 repo.vfs.rmtree(tmppath, forcibly=True)
228 228
229 229 if backuppath and not ui.quiet:
230 230 ui.warn(
231 231 _(b'copy of old repository backed up at %s\n') % backuppath
232 232 )
233 233 ui.warn(
234 234 _(
235 235 b'the old repository will not be deleted; remove '
236 236 b'it to free up disk space once the upgraded '
237 237 b'repository is verified\n'
238 238 )
239 239 )
240 240
241 241 upgrade_op.print_post_op_messages()
242 242
243 243
244 244 def upgrade_share_to_safe(ui, hgvfs, storevfs, current_requirements):
245 245 """Upgrades a share to use share-safe mechanism"""
246 246 wlock = None
247 247 try:
248 248 wlock = lockmod.trylock(ui, hgvfs, b'wlock', 0, 0)
249 249 store_requirements = localrepo._readrequires(storevfs, False)
250 250 # after upgrade, store requires will be shared, so lets find
251 251 # the requirements which are not present in store and
252 252 # write them to share's .hg/requires
253 253 diffrequires = current_requirements - store_requirements
254 254 # add share-safe requirement as it will mark the share as share-safe
255 255 diffrequires.add(requirementsmod.SHARESAFE_REQUIREMENT)
256 256 scmutil.writerequires(hgvfs, diffrequires)
257 257 current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
258 258 ui.warn(_(b'repository upgraded to use share-safe mode\n'))
259 259 except error.LockError as e:
260 if ui.configbool(b'experimental', b'sharesafe-warn-outdated-shares'):
260 if ui.configbool(b'experimental', b'sharesafe-auto-upgrade-fail-error'):
261 raise error.Abort(
262 _(b'failed to upgrade share, got error: %s')
263 % stringutil.forcebytestr(e.strerror)
264 )
265 elif ui.configbool(b'experimental', b'sharesafe-warn-outdated-shares'):
261 266 ui.warn(
262 267 _(b'failed to upgrade share, got error: %s\n')
263 268 % stringutil.forcebytestr(e.strerror)
264 269 )
265 270 finally:
266 271 if wlock:
267 272 wlock.release()
268 273
269 274
270 275 def downgrade_share_to_non_safe(
271 276 ui,
272 277 hgvfs,
273 278 sharedvfs,
274 279 current_requirements,
275 280 ):
276 281 """Downgrades a share which use share-safe to not use it"""
277 282 wlock = None
278 283 try:
279 284 wlock = lockmod.trylock(ui, hgvfs, b'wlock', 0, 0)
280 285 source_requirements = localrepo._readrequires(sharedvfs, True)
281 286 # we cannot be 100% sure on which requirements were present in store when
282 287 # the source supported share-safe. However, we do know that working
283 288 # directory requirements were not there. Hence we remove them
284 289 source_requirements -= requirementsmod.WORKING_DIR_REQUIREMENTS
285 290 current_requirements |= source_requirements
286 291 current_requirements.remove(requirementsmod.SHARESAFE_REQUIREMENT)
287 292 scmutil.writerequires(hgvfs, current_requirements)
288 293 ui.warn(_(b'repository downgraded to not use share-safe mode\n'))
289 294 except error.LockError as e:
290 295 # raise error right away because if downgrade failed, we cannot load
291 296 # the repository because it does not have complete set of requirements
292 297 raise error.Abort(
293 298 _(b'failed to downgrade share, got error: %s')
294 299 % stringutil.forcebytestr(e.strerror)
295 300 )
296 301 finally:
297 302 if wlock:
298 303 wlock.release()
@@ -1,575 +1,579 b''
1 1 setup
2 2
3 3 $ cat >> $HGRCPATH <<EOF
4 4 > [extensions]
5 5 > share =
6 6 > [format]
7 7 > exp-share-safe = True
8 8 > EOF
9 9
10 10 prepare source repo
11 11
12 12 $ hg init source
13 13 $ cd source
14 14 $ cat .hg/requires
15 15 exp-sharesafe
16 16 $ cat .hg/store/requires
17 17 dotencode
18 18 fncache
19 19 generaldelta
20 20 revlogv1
21 21 sparserevlog
22 22 store
23 23 $ hg debugrequirements
24 24 dotencode
25 25 exp-sharesafe
26 26 fncache
27 27 generaldelta
28 28 revlogv1
29 29 sparserevlog
30 30 store
31 31
32 32 $ echo a > a
33 33 $ hg ci -Aqm "added a"
34 34 $ echo b > b
35 35 $ hg ci -Aqm "added b"
36 36
37 37 $ HGEDITOR=cat hg config --shared
38 38 abort: repository is not shared; can't use --shared
39 39 [10]
40 40 $ cd ..
41 41
42 42 Create a shared repo and check the requirements are shared and read correctly
43 43 $ hg share source shared1
44 44 updating working directory
45 45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 46 $ cd shared1
47 47 $ cat .hg/requires
48 48 exp-sharesafe
49 49 shared
50 50
51 51 $ hg debugrequirements -R ../source
52 52 dotencode
53 53 exp-sharesafe
54 54 fncache
55 55 generaldelta
56 56 revlogv1
57 57 sparserevlog
58 58 store
59 59
60 60 $ hg debugrequirements
61 61 dotencode
62 62 exp-sharesafe
63 63 fncache
64 64 generaldelta
65 65 revlogv1
66 66 shared
67 67 sparserevlog
68 68 store
69 69
70 70 $ echo c > c
71 71 $ hg ci -Aqm "added c"
72 72
73 73 Check that config of the source repository is also loaded
74 74
75 75 $ hg showconfig ui.curses
76 76 [1]
77 77
78 78 $ echo "[ui]" >> ../source/.hg/hgrc
79 79 $ echo "curses=true" >> ../source/.hg/hgrc
80 80
81 81 $ hg showconfig ui.curses
82 82 true
83 83
84 84 Test that extensions of source repository are also loaded
85 85
86 86 $ hg debugextensions
87 87 share
88 88 $ hg extdiff -p echo
89 89 hg: unknown command 'extdiff'
90 90 'extdiff' is provided by the following extension:
91 91
92 92 extdiff command to allow external programs to compare revisions
93 93
94 94 (use 'hg help extensions' for information on enabling extensions)
95 95 [255]
96 96
97 97 $ echo "[extensions]" >> ../source/.hg/hgrc
98 98 $ echo "extdiff=" >> ../source/.hg/hgrc
99 99
100 100 $ hg debugextensions -R ../source
101 101 extdiff
102 102 share
103 103 $ hg extdiff -R ../source -p echo
104 104
105 105 BROKEN: the command below will not work if config of shared source is not loaded
106 106 on dispatch but debugextensions says that extension
107 107 is loaded
108 108 $ hg debugextensions
109 109 extdiff
110 110 share
111 111
112 112 $ hg extdiff -p echo
113 113
114 114 However, local .hg/hgrc should override the config set by share source
115 115
116 116 $ echo "[ui]" >> .hg/hgrc
117 117 $ echo "curses=false" >> .hg/hgrc
118 118
119 119 $ hg showconfig ui.curses
120 120 false
121 121
122 122 $ HGEDITOR=cat hg config --shared
123 123 [ui]
124 124 curses=true
125 125 [extensions]
126 126 extdiff=
127 127
128 128 $ HGEDITOR=cat hg config --local
129 129 [ui]
130 130 curses=false
131 131
132 132 Testing that hooks set in source repository also runs in shared repo
133 133
134 134 $ cd ../source
135 135 $ cat <<EOF >> .hg/hgrc
136 136 > [extensions]
137 137 > hooklib=
138 138 > [hooks]
139 139 > pretxnchangegroup.reject_merge_commits = \
140 140 > python:hgext.hooklib.reject_merge_commits.hook
141 141 > EOF
142 142
143 143 $ cd ..
144 144 $ hg clone source cloned
145 145 updating to branch default
146 146 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 147 $ cd cloned
148 148 $ hg up 0
149 149 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
150 150 $ echo bar > bar
151 151 $ hg ci -Aqm "added bar"
152 152 $ hg merge
153 153 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
154 154 (branch merge, don't forget to commit)
155 155 $ hg ci -m "merge commit"
156 156
157 157 $ hg push ../source
158 158 pushing to ../source
159 159 searching for changes
160 160 adding changesets
161 161 adding manifests
162 162 adding file changes
163 163 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
164 164 transaction abort!
165 165 rollback completed
166 166 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
167 167 [255]
168 168
169 169 $ hg push ../shared1
170 170 pushing to ../shared1
171 171 searching for changes
172 172 adding changesets
173 173 adding manifests
174 174 adding file changes
175 175 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
176 176 transaction abort!
177 177 rollback completed
178 178 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
179 179 [255]
180 180
181 181 Test that if share source config is untrusted, we dont read it
182 182
183 183 $ cd ../shared1
184 184
185 185 $ cat << EOF > $TESTTMP/untrusted.py
186 186 > from mercurial import scmutil, util
187 187 > def uisetup(ui):
188 188 > class untrustedui(ui.__class__):
189 189 > def _trusted(self, fp, f):
190 190 > if util.normpath(fp.name).endswith(b'source/.hg/hgrc'):
191 191 > return False
192 192 > return super(untrustedui, self)._trusted(fp, f)
193 193 > ui.__class__ = untrustedui
194 194 > EOF
195 195
196 196 $ hg showconfig hooks
197 197 hooks.pretxnchangegroup.reject_merge_commits=python:hgext.hooklib.reject_merge_commits.hook
198 198
199 199 $ hg showconfig hooks --config extensions.untrusted=$TESTTMP/untrusted.py
200 200 [1]
201 201
202 202 Update the source repository format and check that shared repo works
203 203
204 204 $ cd ../source
205 205
206 206 Disable zstd related tests because its not present on pure version
207 207 #if zstd
208 208 $ echo "[format]" >> .hg/hgrc
209 209 $ echo "revlog-compression=zstd" >> .hg/hgrc
210 210
211 211 $ hg debugupgraderepo --run -q
212 212 upgrade will perform the following actions:
213 213
214 214 requirements
215 215 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store
216 216 added: revlog-compression-zstd
217 217
218 218 processed revlogs:
219 219 - all-filelogs
220 220 - changelog
221 221 - manifest
222 222
223 223 $ hg log -r .
224 224 changeset: 1:5f6d8a4bf34a
225 225 user: test
226 226 date: Thu Jan 01 00:00:00 1970 +0000
227 227 summary: added b
228 228
229 229 #endif
230 230 $ echo "[format]" >> .hg/hgrc
231 231 $ echo "use-persistent-nodemap=True" >> .hg/hgrc
232 232
233 233 $ hg debugupgraderepo --run -q -R ../shared1
234 234 abort: cannot upgrade repository; unsupported source requirement: shared
235 235 [255]
236 236
237 237 $ hg debugupgraderepo --run -q
238 238 upgrade will perform the following actions:
239 239
240 240 requirements
241 241 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
242 242 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
243 243 added: persistent-nodemap
244 244
245 245 processed revlogs:
246 246 - all-filelogs
247 247 - changelog
248 248 - manifest
249 249
250 250 $ hg log -r .
251 251 changeset: 1:5f6d8a4bf34a
252 252 user: test
253 253 date: Thu Jan 01 00:00:00 1970 +0000
254 254 summary: added b
255 255
256 256
257 257 Shared one should work
258 258 $ cd ../shared1
259 259 $ hg log -r .
260 260 changeset: 2:155349b645be
261 261 tag: tip
262 262 user: test
263 263 date: Thu Jan 01 00:00:00 1970 +0000
264 264 summary: added c
265 265
266 266
267 267 Testing that nonsharedrc is loaded for source and not shared
268 268
269 269 $ cd ../source
270 270 $ touch .hg/hgrc-not-shared
271 271 $ echo "[ui]" >> .hg/hgrc-not-shared
272 272 $ echo "traceback=true" >> .hg/hgrc-not-shared
273 273
274 274 $ hg showconfig ui.traceback
275 275 true
276 276
277 277 $ HGEDITOR=cat hg config --non-shared
278 278 [ui]
279 279 traceback=true
280 280
281 281 $ cd ../shared1
282 282 $ hg showconfig ui.traceback
283 283 [1]
284 284
285 285 Unsharing works
286 286
287 287 $ hg unshare
288 288
289 289 Test that source config is added to the shared one after unshare, and the config
290 290 of current repo is still respected over the config which came from source config
291 291 $ cd ../cloned
292 292 $ hg push ../shared1
293 293 pushing to ../shared1
294 294 searching for changes
295 295 adding changesets
296 296 adding manifests
297 297 adding file changes
298 298 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
299 299 transaction abort!
300 300 rollback completed
301 301 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
302 302 [255]
303 303 $ hg showconfig ui.curses -R ../shared1
304 304 false
305 305
306 306 $ cd ../
307 307
308 308 Test that upgrading using debugupgraderepo works
309 309 =================================================
310 310
311 311 $ hg init non-share-safe --config format.exp-share-safe=false
312 312 $ cd non-share-safe
313 313 $ hg debugrequirements
314 314 dotencode
315 315 fncache
316 316 generaldelta
317 317 revlogv1
318 318 sparserevlog
319 319 store
320 320 $ echo foo > foo
321 321 $ hg ci -Aqm 'added foo'
322 322 $ echo bar > bar
323 323 $ hg ci -Aqm 'added bar'
324 324
325 325 Create a share before upgrading
326 326
327 327 $ cd ..
328 328 $ hg share non-share-safe nss-share
329 329 updating working directory
330 330 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
331 331 $ hg debugrequirements -R nss-share
332 332 dotencode
333 333 fncache
334 334 generaldelta
335 335 revlogv1
336 336 shared
337 337 sparserevlog
338 338 store
339 339 $ cd non-share-safe
340 340
341 341 Upgrade
342 342
343 343 $ hg debugupgraderepo -q
344 344 requirements
345 345 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
346 346 added: exp-sharesafe
347 347
348 348 processed revlogs:
349 349 - all-filelogs
350 350 - changelog
351 351 - manifest
352 352
353 353 $ hg debugupgraderepo --run -q
354 354 upgrade will perform the following actions:
355 355
356 356 requirements
357 357 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
358 358 added: exp-sharesafe
359 359
360 360 processed revlogs:
361 361 - all-filelogs
362 362 - changelog
363 363 - manifest
364 364
365 365 repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
366 366
367 367 $ hg debugrequirements
368 368 dotencode
369 369 exp-sharesafe
370 370 fncache
371 371 generaldelta
372 372 revlogv1
373 373 sparserevlog
374 374 store
375 375
376 376 $ cat .hg/requires
377 377 exp-sharesafe
378 378
379 379 $ cat .hg/store/requires
380 380 dotencode
381 381 fncache
382 382 generaldelta
383 383 revlogv1
384 384 sparserevlog
385 385 store
386 386
387 387 $ hg log -GT "{node}: {desc}\n"
388 388 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
389 389 |
390 390 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
391 391
392 392
393 393 Make sure existing shares still works
394 394
395 395 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-warn-outdated-shares=false
396 396 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
397 397 |
398 398 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
399 399
400 400
401 401 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
402 402 warning: source repository supports share-safe functionality. Reshare to upgrade.
403 403 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
404 404 |
405 405 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
406 406
407 407
408 408
409 409 Create a safe share from upgrade one
410 410
411 411 $ cd ..
412 412 $ hg share non-share-safe ss-share
413 413 updating working directory
414 414 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 415 $ cd ss-share
416 416 $ hg log -GT "{node}: {desc}\n"
417 417 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
418 418 |
419 419 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
420 420
421 421 $ cd ../non-share-safe
422 422
423 423 Test that downgrading works too
424 424
425 425 $ cat >> $HGRCPATH <<EOF
426 426 > [extensions]
427 427 > share =
428 428 > [format]
429 429 > exp-share-safe = False
430 430 > EOF
431 431
432 432 $ hg debugupgraderepo -q
433 433 requirements
434 434 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
435 435 removed: exp-sharesafe
436 436
437 437 processed revlogs:
438 438 - all-filelogs
439 439 - changelog
440 440 - manifest
441 441
442 442 $ hg debugupgraderepo -q --run
443 443 upgrade will perform the following actions:
444 444
445 445 requirements
446 446 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
447 447 removed: exp-sharesafe
448 448
449 449 processed revlogs:
450 450 - all-filelogs
451 451 - changelog
452 452 - manifest
453 453
454 454 repository downgraded to not use share safe mode, existing shares will not work and needs to be reshared.
455 455
456 456 $ hg debugrequirements
457 457 dotencode
458 458 fncache
459 459 generaldelta
460 460 revlogv1
461 461 sparserevlog
462 462 store
463 463
464 464 $ cat .hg/requires
465 465 dotencode
466 466 fncache
467 467 generaldelta
468 468 revlogv1
469 469 sparserevlog
470 470 store
471 471
472 472 $ test -f .hg/store/requires
473 473 [1]
474 474
475 475 $ hg log -GT "{node}: {desc}\n"
476 476 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
477 477 |
478 478 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
479 479
480 480
481 481 Make sure existing shares still works
482 482
483 483 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
484 484 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
485 485 |
486 486 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
487 487
488 488
489 489 $ hg log -GT "{node}: {desc}\n" -R ../ss-share
490 490 abort: share source does not support exp-sharesafe requirement
491 491 [255]
492 492
493 493 Testing automatic downgrade of shares when config is set
494 494
495 495 $ touch ../ss-share/.hg/wlock
496 496 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config experimental.sharesafe-auto-downgrade-shares=true
497 497 abort: failed to downgrade share, got error: Lock held
498 498 [255]
499 499 $ rm ../ss-share/.hg/wlock
500 500
501 501 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config experimental.sharesafe-auto-downgrade-shares=true
502 502 repository downgraded to not use share-safe mode
503 503 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
504 504 |
505 505 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
506 506
507 507
508 508 $ hg log -GT "{node}: {desc}\n" -R ../ss-share
509 509 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
510 510 |
511 511 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
512 512
513 513
514 514
515 515 Testing automatic upgrade of shares when config is set
516 516
517 517 $ hg debugupgraderepo -q --run --config format.exp-share-safe=True
518 518 upgrade will perform the following actions:
519 519
520 520 requirements
521 521 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
522 522 added: exp-sharesafe
523 523
524 524 processed revlogs:
525 525 - all-filelogs
526 526 - changelog
527 527 - manifest
528 528
529 529 repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
530 530 $ hg debugrequirements
531 531 dotencode
532 532 exp-sharesafe
533 533 fncache
534 534 generaldelta
535 535 revlogv1
536 536 sparserevlog
537 537 store
538 538 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
539 539 warning: source repository supports share-safe functionality. Reshare to upgrade.
540 540 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
541 541 |
542 542 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
543 543
544 544
545 545 Check that if lock is taken, upgrade fails but read operation are successful
546 546 $ touch ../nss-share/.hg/wlock
547 547 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true
548 548 failed to upgrade share, got error: Lock held
549 549 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
550 550 |
551 551 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
552 552
553 553
554 554 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true --config experimental.sharesafe-warn-outdated-shares=false
555 555 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
556 556 |
557 557 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
558 558
559 559
560 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true --config experimental.sharesafe-auto-upgrade-fail-error=true
561 abort: failed to upgrade share, got error: Lock held
562 [255]
563
560 564 $ rm ../nss-share/.hg/wlock
561 565 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true
562 566 repository upgraded to use share-safe mode
563 567 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
564 568 |
565 569 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
566 570
567 571
568 572 Test that unshare works
569 573
570 574 $ hg unshare -R ../nss-share
571 575 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
572 576 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
573 577 |
574 578 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
575 579
General Comments 0
You need to be logged in to leave comments. Login now