##// END OF EJS Templates
hooks: forbid ':' in hook name...
marmoute -
r47240:86b01989 stable
parent child Browse files
Show More
@@ -1,2582 +1,2582 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 # When True, revlogs use a special reference version of the nodemap, that is not
639 639 # performant but is "known" to behave properly.
640 640 coreconfigitem(
641 641 b'devel',
642 642 b'persistent-nodemap',
643 643 default=False,
644 644 )
645 645 coreconfigitem(
646 646 b'devel',
647 647 b'servercafile',
648 648 default=b'',
649 649 )
650 650 coreconfigitem(
651 651 b'devel',
652 652 b'serverexactprotocol',
653 653 default=b'',
654 654 )
655 655 coreconfigitem(
656 656 b'devel',
657 657 b'serverrequirecert',
658 658 default=False,
659 659 )
660 660 coreconfigitem(
661 661 b'devel',
662 662 b'strip-obsmarkers',
663 663 default=True,
664 664 )
665 665 coreconfigitem(
666 666 b'devel',
667 667 b'warn-config',
668 668 default=None,
669 669 )
670 670 coreconfigitem(
671 671 b'devel',
672 672 b'warn-config-default',
673 673 default=None,
674 674 )
675 675 coreconfigitem(
676 676 b'devel',
677 677 b'user.obsmarker',
678 678 default=None,
679 679 )
680 680 coreconfigitem(
681 681 b'devel',
682 682 b'warn-config-unknown',
683 683 default=None,
684 684 )
685 685 coreconfigitem(
686 686 b'devel',
687 687 b'debug.copies',
688 688 default=False,
689 689 )
690 690 coreconfigitem(
691 691 b'devel',
692 692 b'debug.extensions',
693 693 default=False,
694 694 )
695 695 coreconfigitem(
696 696 b'devel',
697 697 b'debug.repo-filters',
698 698 default=False,
699 699 )
700 700 coreconfigitem(
701 701 b'devel',
702 702 b'debug.peer-request',
703 703 default=False,
704 704 )
705 705 # If discovery.exchange-heads is False, the discovery will not start with
706 706 # remote head fetching and local head querying.
707 707 coreconfigitem(
708 708 b'devel',
709 709 b'discovery.exchange-heads',
710 710 default=True,
711 711 )
712 712 # If discovery.grow-sample is False, the sample size used in set discovery will
713 713 # not be increased through the process
714 714 coreconfigitem(
715 715 b'devel',
716 716 b'discovery.grow-sample',
717 717 default=True,
718 718 )
719 719 # discovery.grow-sample.rate control the rate at which the sample grow
720 720 coreconfigitem(
721 721 b'devel',
722 722 b'discovery.grow-sample.rate',
723 723 default=1.05,
724 724 )
725 725 # If discovery.randomize is False, random sampling during discovery are
726 726 # deterministic. It is meant for integration tests.
727 727 coreconfigitem(
728 728 b'devel',
729 729 b'discovery.randomize',
730 730 default=True,
731 731 )
732 732 _registerdiffopts(section=b'diff')
733 733 coreconfigitem(
734 734 b'email',
735 735 b'bcc',
736 736 default=None,
737 737 )
738 738 coreconfigitem(
739 739 b'email',
740 740 b'cc',
741 741 default=None,
742 742 )
743 743 coreconfigitem(
744 744 b'email',
745 745 b'charsets',
746 746 default=list,
747 747 )
748 748 coreconfigitem(
749 749 b'email',
750 750 b'from',
751 751 default=None,
752 752 )
753 753 coreconfigitem(
754 754 b'email',
755 755 b'method',
756 756 default=b'smtp',
757 757 )
758 758 coreconfigitem(
759 759 b'email',
760 760 b'reply-to',
761 761 default=None,
762 762 )
763 763 coreconfigitem(
764 764 b'email',
765 765 b'to',
766 766 default=None,
767 767 )
768 768 coreconfigitem(
769 769 b'experimental',
770 770 b'archivemetatemplate',
771 771 default=dynamicdefault,
772 772 )
773 773 coreconfigitem(
774 774 b'experimental',
775 775 b'auto-publish',
776 776 default=b'publish',
777 777 )
778 778 coreconfigitem(
779 779 b'experimental',
780 780 b'bundle-phases',
781 781 default=False,
782 782 )
783 783 coreconfigitem(
784 784 b'experimental',
785 785 b'bundle2-advertise',
786 786 default=True,
787 787 )
788 788 coreconfigitem(
789 789 b'experimental',
790 790 b'bundle2-output-capture',
791 791 default=False,
792 792 )
793 793 coreconfigitem(
794 794 b'experimental',
795 795 b'bundle2.pushback',
796 796 default=False,
797 797 )
798 798 coreconfigitem(
799 799 b'experimental',
800 800 b'bundle2lazylocking',
801 801 default=False,
802 802 )
803 803 coreconfigitem(
804 804 b'experimental',
805 805 b'bundlecomplevel',
806 806 default=None,
807 807 )
808 808 coreconfigitem(
809 809 b'experimental',
810 810 b'bundlecomplevel.bzip2',
811 811 default=None,
812 812 )
813 813 coreconfigitem(
814 814 b'experimental',
815 815 b'bundlecomplevel.gzip',
816 816 default=None,
817 817 )
818 818 coreconfigitem(
819 819 b'experimental',
820 820 b'bundlecomplevel.none',
821 821 default=None,
822 822 )
823 823 coreconfigitem(
824 824 b'experimental',
825 825 b'bundlecomplevel.zstd',
826 826 default=None,
827 827 )
828 828 coreconfigitem(
829 829 b'experimental',
830 830 b'changegroup3',
831 831 default=False,
832 832 )
833 833 coreconfigitem(
834 834 b'experimental',
835 835 b'cleanup-as-archived',
836 836 default=False,
837 837 )
838 838 coreconfigitem(
839 839 b'experimental',
840 840 b'clientcompressionengines',
841 841 default=list,
842 842 )
843 843 coreconfigitem(
844 844 b'experimental',
845 845 b'copytrace',
846 846 default=b'on',
847 847 )
848 848 coreconfigitem(
849 849 b'experimental',
850 850 b'copytrace.movecandidateslimit',
851 851 default=100,
852 852 )
853 853 coreconfigitem(
854 854 b'experimental',
855 855 b'copytrace.sourcecommitlimit',
856 856 default=100,
857 857 )
858 858 coreconfigitem(
859 859 b'experimental',
860 860 b'copies.read-from',
861 861 default=b"filelog-only",
862 862 )
863 863 coreconfigitem(
864 864 b'experimental',
865 865 b'copies.write-to',
866 866 default=b'filelog-only',
867 867 )
868 868 coreconfigitem(
869 869 b'experimental',
870 870 b'crecordtest',
871 871 default=None,
872 872 )
873 873 coreconfigitem(
874 874 b'experimental',
875 875 b'directaccess',
876 876 default=False,
877 877 )
878 878 coreconfigitem(
879 879 b'experimental',
880 880 b'directaccess.revnums',
881 881 default=False,
882 882 )
883 883 coreconfigitem(
884 884 b'experimental',
885 885 b'editortmpinhg',
886 886 default=False,
887 887 )
888 888 coreconfigitem(
889 889 b'experimental',
890 890 b'evolution',
891 891 default=list,
892 892 )
893 893 coreconfigitem(
894 894 b'experimental',
895 895 b'evolution.allowdivergence',
896 896 default=False,
897 897 alias=[(b'experimental', b'allowdivergence')],
898 898 )
899 899 coreconfigitem(
900 900 b'experimental',
901 901 b'evolution.allowunstable',
902 902 default=None,
903 903 )
904 904 coreconfigitem(
905 905 b'experimental',
906 906 b'evolution.createmarkers',
907 907 default=None,
908 908 )
909 909 coreconfigitem(
910 910 b'experimental',
911 911 b'evolution.effect-flags',
912 912 default=True,
913 913 alias=[(b'experimental', b'effect-flags')],
914 914 )
915 915 coreconfigitem(
916 916 b'experimental',
917 917 b'evolution.exchange',
918 918 default=None,
919 919 )
920 920 coreconfigitem(
921 921 b'experimental',
922 922 b'evolution.bundle-obsmarker',
923 923 default=False,
924 924 )
925 925 coreconfigitem(
926 926 b'experimental',
927 927 b'evolution.bundle-obsmarker:mandatory',
928 928 default=True,
929 929 )
930 930 coreconfigitem(
931 931 b'experimental',
932 932 b'log.topo',
933 933 default=False,
934 934 )
935 935 coreconfigitem(
936 936 b'experimental',
937 937 b'evolution.report-instabilities',
938 938 default=True,
939 939 )
940 940 coreconfigitem(
941 941 b'experimental',
942 942 b'evolution.track-operation',
943 943 default=True,
944 944 )
945 945 # repo-level config to exclude a revset visibility
946 946 #
947 947 # The target use case is to use `share` to expose different subset of the same
948 948 # repository, especially server side. See also `server.view`.
949 949 coreconfigitem(
950 950 b'experimental',
951 951 b'extra-filter-revs',
952 952 default=None,
953 953 )
954 954 coreconfigitem(
955 955 b'experimental',
956 956 b'maxdeltachainspan',
957 957 default=-1,
958 958 )
959 959 # tracks files which were undeleted (merge might delete them but we explicitly
960 960 # kept/undeleted them) and creates new filenodes for them
961 961 coreconfigitem(
962 962 b'experimental',
963 963 b'merge-track-salvaged',
964 964 default=False,
965 965 )
966 966 coreconfigitem(
967 967 b'experimental',
968 968 b'mergetempdirprefix',
969 969 default=None,
970 970 )
971 971 coreconfigitem(
972 972 b'experimental',
973 973 b'mmapindexthreshold',
974 974 default=None,
975 975 )
976 976 coreconfigitem(
977 977 b'experimental',
978 978 b'narrow',
979 979 default=False,
980 980 )
981 981 coreconfigitem(
982 982 b'experimental',
983 983 b'nonnormalparanoidcheck',
984 984 default=False,
985 985 )
986 986 coreconfigitem(
987 987 b'experimental',
988 988 b'exportableenviron',
989 989 default=list,
990 990 )
991 991 coreconfigitem(
992 992 b'experimental',
993 993 b'extendedheader.index',
994 994 default=None,
995 995 )
996 996 coreconfigitem(
997 997 b'experimental',
998 998 b'extendedheader.similarity',
999 999 default=False,
1000 1000 )
1001 1001 coreconfigitem(
1002 1002 b'experimental',
1003 1003 b'graphshorten',
1004 1004 default=False,
1005 1005 )
1006 1006 coreconfigitem(
1007 1007 b'experimental',
1008 1008 b'graphstyle.parent',
1009 1009 default=dynamicdefault,
1010 1010 )
1011 1011 coreconfigitem(
1012 1012 b'experimental',
1013 1013 b'graphstyle.missing',
1014 1014 default=dynamicdefault,
1015 1015 )
1016 1016 coreconfigitem(
1017 1017 b'experimental',
1018 1018 b'graphstyle.grandparent',
1019 1019 default=dynamicdefault,
1020 1020 )
1021 1021 coreconfigitem(
1022 1022 b'experimental',
1023 1023 b'hook-track-tags',
1024 1024 default=False,
1025 1025 )
1026 1026 coreconfigitem(
1027 1027 b'experimental',
1028 1028 b'httppeer.advertise-v2',
1029 1029 default=False,
1030 1030 )
1031 1031 coreconfigitem(
1032 1032 b'experimental',
1033 1033 b'httppeer.v2-encoder-order',
1034 1034 default=None,
1035 1035 )
1036 1036 coreconfigitem(
1037 1037 b'experimental',
1038 1038 b'httppostargs',
1039 1039 default=False,
1040 1040 )
1041 1041 coreconfigitem(b'experimental', b'nointerrupt', default=False)
1042 1042 coreconfigitem(b'experimental', b'nointerrupt-interactiveonly', default=True)
1043 1043
1044 1044 coreconfigitem(
1045 1045 b'experimental',
1046 1046 b'obsmarkers-exchange-debug',
1047 1047 default=False,
1048 1048 )
1049 1049 coreconfigitem(
1050 1050 b'experimental',
1051 1051 b'remotenames',
1052 1052 default=False,
1053 1053 )
1054 1054 coreconfigitem(
1055 1055 b'experimental',
1056 1056 b'removeemptydirs',
1057 1057 default=True,
1058 1058 )
1059 1059 coreconfigitem(
1060 1060 b'experimental',
1061 1061 b'revert.interactive.select-to-keep',
1062 1062 default=False,
1063 1063 )
1064 1064 coreconfigitem(
1065 1065 b'experimental',
1066 1066 b'revisions.prefixhexnode',
1067 1067 default=False,
1068 1068 )
1069 1069 coreconfigitem(
1070 1070 b'experimental',
1071 1071 b'revlogv2',
1072 1072 default=None,
1073 1073 )
1074 1074 coreconfigitem(
1075 1075 b'experimental',
1076 1076 b'revisions.disambiguatewithin',
1077 1077 default=None,
1078 1078 )
1079 1079 coreconfigitem(
1080 1080 b'experimental',
1081 1081 b'rust.index',
1082 1082 default=False,
1083 1083 )
1084 1084 coreconfigitem(
1085 1085 b'experimental',
1086 1086 b'server.filesdata.recommended-batch-size',
1087 1087 default=50000,
1088 1088 )
1089 1089 coreconfigitem(
1090 1090 b'experimental',
1091 1091 b'server.manifestdata.recommended-batch-size',
1092 1092 default=100000,
1093 1093 )
1094 1094 coreconfigitem(
1095 1095 b'experimental',
1096 1096 b'server.stream-narrow-clones',
1097 1097 default=False,
1098 1098 )
1099 1099 coreconfigitem(
1100 1100 b'experimental',
1101 1101 b'single-head-per-branch',
1102 1102 default=False,
1103 1103 )
1104 1104 coreconfigitem(
1105 1105 b'experimental',
1106 1106 b'single-head-per-branch:account-closed-heads',
1107 1107 default=False,
1108 1108 )
1109 1109 coreconfigitem(
1110 1110 b'experimental',
1111 1111 b'single-head-per-branch:public-changes-only',
1112 1112 default=False,
1113 1113 )
1114 1114 coreconfigitem(
1115 1115 b'experimental',
1116 1116 b'sshserver.support-v2',
1117 1117 default=False,
1118 1118 )
1119 1119 coreconfigitem(
1120 1120 b'experimental',
1121 1121 b'sparse-read',
1122 1122 default=False,
1123 1123 )
1124 1124 coreconfigitem(
1125 1125 b'experimental',
1126 1126 b'sparse-read.density-threshold',
1127 1127 default=0.50,
1128 1128 )
1129 1129 coreconfigitem(
1130 1130 b'experimental',
1131 1131 b'sparse-read.min-gap-size',
1132 1132 default=b'65K',
1133 1133 )
1134 1134 coreconfigitem(
1135 1135 b'experimental',
1136 1136 b'treemanifest',
1137 1137 default=False,
1138 1138 )
1139 1139 coreconfigitem(
1140 1140 b'experimental',
1141 1141 b'update.atomic-file',
1142 1142 default=False,
1143 1143 )
1144 1144 coreconfigitem(
1145 1145 b'experimental',
1146 1146 b'sshpeer.advertise-v2',
1147 1147 default=False,
1148 1148 )
1149 1149 coreconfigitem(
1150 1150 b'experimental',
1151 1151 b'web.apiserver',
1152 1152 default=False,
1153 1153 )
1154 1154 coreconfigitem(
1155 1155 b'experimental',
1156 1156 b'web.api.http-v2',
1157 1157 default=False,
1158 1158 )
1159 1159 coreconfigitem(
1160 1160 b'experimental',
1161 1161 b'web.api.debugreflect',
1162 1162 default=False,
1163 1163 )
1164 1164 coreconfigitem(
1165 1165 b'experimental',
1166 1166 b'worker.wdir-get-thread-safe',
1167 1167 default=False,
1168 1168 )
1169 1169 coreconfigitem(
1170 1170 b'experimental',
1171 1171 b'worker.repository-upgrade',
1172 1172 default=False,
1173 1173 )
1174 1174 coreconfigitem(
1175 1175 b'experimental',
1176 1176 b'xdiff',
1177 1177 default=False,
1178 1178 )
1179 1179 coreconfigitem(
1180 1180 b'extensions',
1181 1181 b'.*',
1182 1182 default=None,
1183 1183 generic=True,
1184 1184 )
1185 1185 coreconfigitem(
1186 1186 b'extdata',
1187 1187 b'.*',
1188 1188 default=None,
1189 1189 generic=True,
1190 1190 )
1191 1191 coreconfigitem(
1192 1192 b'format',
1193 1193 b'bookmarks-in-store',
1194 1194 default=False,
1195 1195 )
1196 1196 coreconfigitem(
1197 1197 b'format',
1198 1198 b'chunkcachesize',
1199 1199 default=None,
1200 1200 experimental=True,
1201 1201 )
1202 1202 coreconfigitem(
1203 1203 b'format',
1204 1204 b'dotencode',
1205 1205 default=True,
1206 1206 )
1207 1207 coreconfigitem(
1208 1208 b'format',
1209 1209 b'generaldelta',
1210 1210 default=False,
1211 1211 experimental=True,
1212 1212 )
1213 1213 coreconfigitem(
1214 1214 b'format',
1215 1215 b'manifestcachesize',
1216 1216 default=None,
1217 1217 experimental=True,
1218 1218 )
1219 1219 coreconfigitem(
1220 1220 b'format',
1221 1221 b'maxchainlen',
1222 1222 default=dynamicdefault,
1223 1223 experimental=True,
1224 1224 )
1225 1225 coreconfigitem(
1226 1226 b'format',
1227 1227 b'obsstore-version',
1228 1228 default=None,
1229 1229 )
1230 1230 coreconfigitem(
1231 1231 b'format',
1232 1232 b'sparse-revlog',
1233 1233 default=True,
1234 1234 )
1235 1235 coreconfigitem(
1236 1236 b'format',
1237 1237 b'revlog-compression',
1238 1238 default=lambda: [b'zlib'],
1239 1239 alias=[(b'experimental', b'format.compression')],
1240 1240 )
1241 1241 coreconfigitem(
1242 1242 b'format',
1243 1243 b'usefncache',
1244 1244 default=True,
1245 1245 )
1246 1246 coreconfigitem(
1247 1247 b'format',
1248 1248 b'usegeneraldelta',
1249 1249 default=True,
1250 1250 )
1251 1251 coreconfigitem(
1252 1252 b'format',
1253 1253 b'usestore',
1254 1254 default=True,
1255 1255 )
1256 1256 coreconfigitem(
1257 1257 b'format',
1258 1258 b'use-persistent-nodemap',
1259 1259 default=False,
1260 1260 )
1261 1261 coreconfigitem(
1262 1262 b'format',
1263 1263 b'exp-use-copies-side-data-changeset',
1264 1264 default=False,
1265 1265 experimental=True,
1266 1266 )
1267 1267 coreconfigitem(
1268 1268 b'format',
1269 1269 b'exp-use-side-data',
1270 1270 default=False,
1271 1271 experimental=True,
1272 1272 )
1273 1273 coreconfigitem(
1274 1274 b'format',
1275 1275 b'use-share-safe',
1276 1276 default=False,
1277 1277 )
1278 1278 coreconfigitem(
1279 1279 b'format',
1280 1280 b'internal-phase',
1281 1281 default=False,
1282 1282 experimental=True,
1283 1283 )
1284 1284 coreconfigitem(
1285 1285 b'fsmonitor',
1286 1286 b'warn_when_unused',
1287 1287 default=True,
1288 1288 )
1289 1289 coreconfigitem(
1290 1290 b'fsmonitor',
1291 1291 b'warn_update_file_count',
1292 1292 default=50000,
1293 1293 )
1294 1294 coreconfigitem(
1295 1295 b'fsmonitor',
1296 1296 b'warn_update_file_count_rust',
1297 1297 default=400000,
1298 1298 )
1299 1299 coreconfigitem(
1300 1300 b'help',
1301 1301 br'hidden-command\..*',
1302 1302 default=False,
1303 1303 generic=True,
1304 1304 )
1305 1305 coreconfigitem(
1306 1306 b'help',
1307 1307 br'hidden-topic\..*',
1308 1308 default=False,
1309 1309 generic=True,
1310 1310 )
1311 1311 coreconfigitem(
1312 1312 b'hooks',
1313 b'.*',
1313 b'[^:]*',
1314 1314 default=dynamicdefault,
1315 1315 generic=True,
1316 1316 )
1317 1317 coreconfigitem(
1318 1318 b'hgweb-paths',
1319 1319 b'.*',
1320 1320 default=list,
1321 1321 generic=True,
1322 1322 )
1323 1323 coreconfigitem(
1324 1324 b'hostfingerprints',
1325 1325 b'.*',
1326 1326 default=list,
1327 1327 generic=True,
1328 1328 )
1329 1329 coreconfigitem(
1330 1330 b'hostsecurity',
1331 1331 b'ciphers',
1332 1332 default=None,
1333 1333 )
1334 1334 coreconfigitem(
1335 1335 b'hostsecurity',
1336 1336 b'minimumprotocol',
1337 1337 default=dynamicdefault,
1338 1338 )
1339 1339 coreconfigitem(
1340 1340 b'hostsecurity',
1341 1341 b'.*:minimumprotocol$',
1342 1342 default=dynamicdefault,
1343 1343 generic=True,
1344 1344 )
1345 1345 coreconfigitem(
1346 1346 b'hostsecurity',
1347 1347 b'.*:ciphers$',
1348 1348 default=dynamicdefault,
1349 1349 generic=True,
1350 1350 )
1351 1351 coreconfigitem(
1352 1352 b'hostsecurity',
1353 1353 b'.*:fingerprints$',
1354 1354 default=list,
1355 1355 generic=True,
1356 1356 )
1357 1357 coreconfigitem(
1358 1358 b'hostsecurity',
1359 1359 b'.*:verifycertsfile$',
1360 1360 default=None,
1361 1361 generic=True,
1362 1362 )
1363 1363
1364 1364 coreconfigitem(
1365 1365 b'http_proxy',
1366 1366 b'always',
1367 1367 default=False,
1368 1368 )
1369 1369 coreconfigitem(
1370 1370 b'http_proxy',
1371 1371 b'host',
1372 1372 default=None,
1373 1373 )
1374 1374 coreconfigitem(
1375 1375 b'http_proxy',
1376 1376 b'no',
1377 1377 default=list,
1378 1378 )
1379 1379 coreconfigitem(
1380 1380 b'http_proxy',
1381 1381 b'passwd',
1382 1382 default=None,
1383 1383 )
1384 1384 coreconfigitem(
1385 1385 b'http_proxy',
1386 1386 b'user',
1387 1387 default=None,
1388 1388 )
1389 1389
1390 1390 coreconfigitem(
1391 1391 b'http',
1392 1392 b'timeout',
1393 1393 default=None,
1394 1394 )
1395 1395
1396 1396 coreconfigitem(
1397 1397 b'logtoprocess',
1398 1398 b'commandexception',
1399 1399 default=None,
1400 1400 )
1401 1401 coreconfigitem(
1402 1402 b'logtoprocess',
1403 1403 b'commandfinish',
1404 1404 default=None,
1405 1405 )
1406 1406 coreconfigitem(
1407 1407 b'logtoprocess',
1408 1408 b'command',
1409 1409 default=None,
1410 1410 )
1411 1411 coreconfigitem(
1412 1412 b'logtoprocess',
1413 1413 b'develwarn',
1414 1414 default=None,
1415 1415 )
1416 1416 coreconfigitem(
1417 1417 b'logtoprocess',
1418 1418 b'uiblocked',
1419 1419 default=None,
1420 1420 )
1421 1421 coreconfigitem(
1422 1422 b'merge',
1423 1423 b'checkunknown',
1424 1424 default=b'abort',
1425 1425 )
1426 1426 coreconfigitem(
1427 1427 b'merge',
1428 1428 b'checkignored',
1429 1429 default=b'abort',
1430 1430 )
1431 1431 coreconfigitem(
1432 1432 b'experimental',
1433 1433 b'merge.checkpathconflicts',
1434 1434 default=False,
1435 1435 )
1436 1436 coreconfigitem(
1437 1437 b'merge',
1438 1438 b'followcopies',
1439 1439 default=True,
1440 1440 )
1441 1441 coreconfigitem(
1442 1442 b'merge',
1443 1443 b'on-failure',
1444 1444 default=b'continue',
1445 1445 )
1446 1446 coreconfigitem(
1447 1447 b'merge',
1448 1448 b'preferancestor',
1449 1449 default=lambda: [b'*'],
1450 1450 experimental=True,
1451 1451 )
1452 1452 coreconfigitem(
1453 1453 b'merge',
1454 1454 b'strict-capability-check',
1455 1455 default=False,
1456 1456 )
1457 1457 coreconfigitem(
1458 1458 b'merge-tools',
1459 1459 b'.*',
1460 1460 default=None,
1461 1461 generic=True,
1462 1462 )
1463 1463 coreconfigitem(
1464 1464 b'merge-tools',
1465 1465 br'.*\.args$',
1466 1466 default=b"$local $base $other",
1467 1467 generic=True,
1468 1468 priority=-1,
1469 1469 )
1470 1470 coreconfigitem(
1471 1471 b'merge-tools',
1472 1472 br'.*\.binary$',
1473 1473 default=False,
1474 1474 generic=True,
1475 1475 priority=-1,
1476 1476 )
1477 1477 coreconfigitem(
1478 1478 b'merge-tools',
1479 1479 br'.*\.check$',
1480 1480 default=list,
1481 1481 generic=True,
1482 1482 priority=-1,
1483 1483 )
1484 1484 coreconfigitem(
1485 1485 b'merge-tools',
1486 1486 br'.*\.checkchanged$',
1487 1487 default=False,
1488 1488 generic=True,
1489 1489 priority=-1,
1490 1490 )
1491 1491 coreconfigitem(
1492 1492 b'merge-tools',
1493 1493 br'.*\.executable$',
1494 1494 default=dynamicdefault,
1495 1495 generic=True,
1496 1496 priority=-1,
1497 1497 )
1498 1498 coreconfigitem(
1499 1499 b'merge-tools',
1500 1500 br'.*\.fixeol$',
1501 1501 default=False,
1502 1502 generic=True,
1503 1503 priority=-1,
1504 1504 )
1505 1505 coreconfigitem(
1506 1506 b'merge-tools',
1507 1507 br'.*\.gui$',
1508 1508 default=False,
1509 1509 generic=True,
1510 1510 priority=-1,
1511 1511 )
1512 1512 coreconfigitem(
1513 1513 b'merge-tools',
1514 1514 br'.*\.mergemarkers$',
1515 1515 default=b'basic',
1516 1516 generic=True,
1517 1517 priority=-1,
1518 1518 )
1519 1519 coreconfigitem(
1520 1520 b'merge-tools',
1521 1521 br'.*\.mergemarkertemplate$',
1522 1522 default=dynamicdefault, # take from command-templates.mergemarker
1523 1523 generic=True,
1524 1524 priority=-1,
1525 1525 )
1526 1526 coreconfigitem(
1527 1527 b'merge-tools',
1528 1528 br'.*\.priority$',
1529 1529 default=0,
1530 1530 generic=True,
1531 1531 priority=-1,
1532 1532 )
1533 1533 coreconfigitem(
1534 1534 b'merge-tools',
1535 1535 br'.*\.premerge$',
1536 1536 default=dynamicdefault,
1537 1537 generic=True,
1538 1538 priority=-1,
1539 1539 )
1540 1540 coreconfigitem(
1541 1541 b'merge-tools',
1542 1542 br'.*\.symlink$',
1543 1543 default=False,
1544 1544 generic=True,
1545 1545 priority=-1,
1546 1546 )
1547 1547 coreconfigitem(
1548 1548 b'pager',
1549 1549 b'attend-.*',
1550 1550 default=dynamicdefault,
1551 1551 generic=True,
1552 1552 )
1553 1553 coreconfigitem(
1554 1554 b'pager',
1555 1555 b'ignore',
1556 1556 default=list,
1557 1557 )
1558 1558 coreconfigitem(
1559 1559 b'pager',
1560 1560 b'pager',
1561 1561 default=dynamicdefault,
1562 1562 )
1563 1563 coreconfigitem(
1564 1564 b'patch',
1565 1565 b'eol',
1566 1566 default=b'strict',
1567 1567 )
1568 1568 coreconfigitem(
1569 1569 b'patch',
1570 1570 b'fuzz',
1571 1571 default=2,
1572 1572 )
1573 1573 coreconfigitem(
1574 1574 b'paths',
1575 1575 b'default',
1576 1576 default=None,
1577 1577 )
1578 1578 coreconfigitem(
1579 1579 b'paths',
1580 1580 b'default-push',
1581 1581 default=None,
1582 1582 )
1583 1583 coreconfigitem(
1584 1584 b'paths',
1585 1585 b'.*',
1586 1586 default=None,
1587 1587 generic=True,
1588 1588 )
1589 1589 coreconfigitem(
1590 1590 b'phases',
1591 1591 b'checksubrepos',
1592 1592 default=b'follow',
1593 1593 )
1594 1594 coreconfigitem(
1595 1595 b'phases',
1596 1596 b'new-commit',
1597 1597 default=b'draft',
1598 1598 )
1599 1599 coreconfigitem(
1600 1600 b'phases',
1601 1601 b'publish',
1602 1602 default=True,
1603 1603 )
1604 1604 coreconfigitem(
1605 1605 b'profiling',
1606 1606 b'enabled',
1607 1607 default=False,
1608 1608 )
1609 1609 coreconfigitem(
1610 1610 b'profiling',
1611 1611 b'format',
1612 1612 default=b'text',
1613 1613 )
1614 1614 coreconfigitem(
1615 1615 b'profiling',
1616 1616 b'freq',
1617 1617 default=1000,
1618 1618 )
1619 1619 coreconfigitem(
1620 1620 b'profiling',
1621 1621 b'limit',
1622 1622 default=30,
1623 1623 )
1624 1624 coreconfigitem(
1625 1625 b'profiling',
1626 1626 b'nested',
1627 1627 default=0,
1628 1628 )
1629 1629 coreconfigitem(
1630 1630 b'profiling',
1631 1631 b'output',
1632 1632 default=None,
1633 1633 )
1634 1634 coreconfigitem(
1635 1635 b'profiling',
1636 1636 b'showmax',
1637 1637 default=0.999,
1638 1638 )
1639 1639 coreconfigitem(
1640 1640 b'profiling',
1641 1641 b'showmin',
1642 1642 default=dynamicdefault,
1643 1643 )
1644 1644 coreconfigitem(
1645 1645 b'profiling',
1646 1646 b'showtime',
1647 1647 default=True,
1648 1648 )
1649 1649 coreconfigitem(
1650 1650 b'profiling',
1651 1651 b'sort',
1652 1652 default=b'inlinetime',
1653 1653 )
1654 1654 coreconfigitem(
1655 1655 b'profiling',
1656 1656 b'statformat',
1657 1657 default=b'hotpath',
1658 1658 )
1659 1659 coreconfigitem(
1660 1660 b'profiling',
1661 1661 b'time-track',
1662 1662 default=dynamicdefault,
1663 1663 )
1664 1664 coreconfigitem(
1665 1665 b'profiling',
1666 1666 b'type',
1667 1667 default=b'stat',
1668 1668 )
1669 1669 coreconfigitem(
1670 1670 b'progress',
1671 1671 b'assume-tty',
1672 1672 default=False,
1673 1673 )
1674 1674 coreconfigitem(
1675 1675 b'progress',
1676 1676 b'changedelay',
1677 1677 default=1,
1678 1678 )
1679 1679 coreconfigitem(
1680 1680 b'progress',
1681 1681 b'clear-complete',
1682 1682 default=True,
1683 1683 )
1684 1684 coreconfigitem(
1685 1685 b'progress',
1686 1686 b'debug',
1687 1687 default=False,
1688 1688 )
1689 1689 coreconfigitem(
1690 1690 b'progress',
1691 1691 b'delay',
1692 1692 default=3,
1693 1693 )
1694 1694 coreconfigitem(
1695 1695 b'progress',
1696 1696 b'disable',
1697 1697 default=False,
1698 1698 )
1699 1699 coreconfigitem(
1700 1700 b'progress',
1701 1701 b'estimateinterval',
1702 1702 default=60.0,
1703 1703 )
1704 1704 coreconfigitem(
1705 1705 b'progress',
1706 1706 b'format',
1707 1707 default=lambda: [b'topic', b'bar', b'number', b'estimate'],
1708 1708 )
1709 1709 coreconfigitem(
1710 1710 b'progress',
1711 1711 b'refresh',
1712 1712 default=0.1,
1713 1713 )
1714 1714 coreconfigitem(
1715 1715 b'progress',
1716 1716 b'width',
1717 1717 default=dynamicdefault,
1718 1718 )
1719 1719 coreconfigitem(
1720 1720 b'pull',
1721 1721 b'confirm',
1722 1722 default=False,
1723 1723 )
1724 1724 coreconfigitem(
1725 1725 b'push',
1726 1726 b'pushvars.server',
1727 1727 default=False,
1728 1728 )
1729 1729 coreconfigitem(
1730 1730 b'rewrite',
1731 1731 b'backup-bundle',
1732 1732 default=True,
1733 1733 alias=[(b'ui', b'history-editing-backup')],
1734 1734 )
1735 1735 coreconfigitem(
1736 1736 b'rewrite',
1737 1737 b'update-timestamp',
1738 1738 default=False,
1739 1739 )
1740 1740 coreconfigitem(
1741 1741 b'rewrite',
1742 1742 b'empty-successor',
1743 1743 default=b'skip',
1744 1744 experimental=True,
1745 1745 )
1746 1746 coreconfigitem(
1747 1747 b'storage',
1748 1748 b'new-repo-backend',
1749 1749 default=b'revlogv1',
1750 1750 experimental=True,
1751 1751 )
1752 1752 coreconfigitem(
1753 1753 b'storage',
1754 1754 b'revlog.optimize-delta-parent-choice',
1755 1755 default=True,
1756 1756 alias=[(b'format', b'aggressivemergedeltas')],
1757 1757 )
1758 1758 # experimental as long as rust is experimental (or a C version is implemented)
1759 1759 coreconfigitem(
1760 1760 b'storage',
1761 1761 b'revlog.persistent-nodemap.mmap',
1762 1762 default=True,
1763 1763 )
1764 1764 # experimental as long as format.use-persistent-nodemap is.
1765 1765 coreconfigitem(
1766 1766 b'storage',
1767 1767 b'revlog.persistent-nodemap.slow-path',
1768 1768 default=b"abort",
1769 1769 )
1770 1770
1771 1771 coreconfigitem(
1772 1772 b'storage',
1773 1773 b'revlog.reuse-external-delta',
1774 1774 default=True,
1775 1775 )
1776 1776 coreconfigitem(
1777 1777 b'storage',
1778 1778 b'revlog.reuse-external-delta-parent',
1779 1779 default=None,
1780 1780 )
1781 1781 coreconfigitem(
1782 1782 b'storage',
1783 1783 b'revlog.zlib.level',
1784 1784 default=None,
1785 1785 )
1786 1786 coreconfigitem(
1787 1787 b'storage',
1788 1788 b'revlog.zstd.level',
1789 1789 default=None,
1790 1790 )
1791 1791 coreconfigitem(
1792 1792 b'server',
1793 1793 b'bookmarks-pushkey-compat',
1794 1794 default=True,
1795 1795 )
1796 1796 coreconfigitem(
1797 1797 b'server',
1798 1798 b'bundle1',
1799 1799 default=True,
1800 1800 )
1801 1801 coreconfigitem(
1802 1802 b'server',
1803 1803 b'bundle1gd',
1804 1804 default=None,
1805 1805 )
1806 1806 coreconfigitem(
1807 1807 b'server',
1808 1808 b'bundle1.pull',
1809 1809 default=None,
1810 1810 )
1811 1811 coreconfigitem(
1812 1812 b'server',
1813 1813 b'bundle1gd.pull',
1814 1814 default=None,
1815 1815 )
1816 1816 coreconfigitem(
1817 1817 b'server',
1818 1818 b'bundle1.push',
1819 1819 default=None,
1820 1820 )
1821 1821 coreconfigitem(
1822 1822 b'server',
1823 1823 b'bundle1gd.push',
1824 1824 default=None,
1825 1825 )
1826 1826 coreconfigitem(
1827 1827 b'server',
1828 1828 b'bundle2.stream',
1829 1829 default=True,
1830 1830 alias=[(b'experimental', b'bundle2.stream')],
1831 1831 )
1832 1832 coreconfigitem(
1833 1833 b'server',
1834 1834 b'compressionengines',
1835 1835 default=list,
1836 1836 )
1837 1837 coreconfigitem(
1838 1838 b'server',
1839 1839 b'concurrent-push-mode',
1840 1840 default=b'check-related',
1841 1841 )
1842 1842 coreconfigitem(
1843 1843 b'server',
1844 1844 b'disablefullbundle',
1845 1845 default=False,
1846 1846 )
1847 1847 coreconfigitem(
1848 1848 b'server',
1849 1849 b'maxhttpheaderlen',
1850 1850 default=1024,
1851 1851 )
1852 1852 coreconfigitem(
1853 1853 b'server',
1854 1854 b'pullbundle',
1855 1855 default=False,
1856 1856 )
1857 1857 coreconfigitem(
1858 1858 b'server',
1859 1859 b'preferuncompressed',
1860 1860 default=False,
1861 1861 )
1862 1862 coreconfigitem(
1863 1863 b'server',
1864 1864 b'streamunbundle',
1865 1865 default=False,
1866 1866 )
1867 1867 coreconfigitem(
1868 1868 b'server',
1869 1869 b'uncompressed',
1870 1870 default=True,
1871 1871 )
1872 1872 coreconfigitem(
1873 1873 b'server',
1874 1874 b'uncompressedallowsecret',
1875 1875 default=False,
1876 1876 )
1877 1877 coreconfigitem(
1878 1878 b'server',
1879 1879 b'view',
1880 1880 default=b'served',
1881 1881 )
1882 1882 coreconfigitem(
1883 1883 b'server',
1884 1884 b'validate',
1885 1885 default=False,
1886 1886 )
1887 1887 coreconfigitem(
1888 1888 b'server',
1889 1889 b'zliblevel',
1890 1890 default=-1,
1891 1891 )
1892 1892 coreconfigitem(
1893 1893 b'server',
1894 1894 b'zstdlevel',
1895 1895 default=3,
1896 1896 )
1897 1897 coreconfigitem(
1898 1898 b'share',
1899 1899 b'pool',
1900 1900 default=None,
1901 1901 )
1902 1902 coreconfigitem(
1903 1903 b'share',
1904 1904 b'poolnaming',
1905 1905 default=b'identity',
1906 1906 )
1907 1907 coreconfigitem(
1908 1908 b'share',
1909 1909 b'safe-mismatch.source-not-safe',
1910 1910 default=b'abort',
1911 1911 )
1912 1912 coreconfigitem(
1913 1913 b'share',
1914 1914 b'safe-mismatch.source-safe',
1915 1915 default=b'abort',
1916 1916 )
1917 1917 coreconfigitem(
1918 1918 b'share',
1919 1919 b'safe-mismatch.source-not-safe.warn',
1920 1920 default=True,
1921 1921 )
1922 1922 coreconfigitem(
1923 1923 b'share',
1924 1924 b'safe-mismatch.source-safe.warn',
1925 1925 default=True,
1926 1926 )
1927 1927 coreconfigitem(
1928 1928 b'shelve',
1929 1929 b'maxbackups',
1930 1930 default=10,
1931 1931 )
1932 1932 coreconfigitem(
1933 1933 b'smtp',
1934 1934 b'host',
1935 1935 default=None,
1936 1936 )
1937 1937 coreconfigitem(
1938 1938 b'smtp',
1939 1939 b'local_hostname',
1940 1940 default=None,
1941 1941 )
1942 1942 coreconfigitem(
1943 1943 b'smtp',
1944 1944 b'password',
1945 1945 default=None,
1946 1946 )
1947 1947 coreconfigitem(
1948 1948 b'smtp',
1949 1949 b'port',
1950 1950 default=dynamicdefault,
1951 1951 )
1952 1952 coreconfigitem(
1953 1953 b'smtp',
1954 1954 b'tls',
1955 1955 default=b'none',
1956 1956 )
1957 1957 coreconfigitem(
1958 1958 b'smtp',
1959 1959 b'username',
1960 1960 default=None,
1961 1961 )
1962 1962 coreconfigitem(
1963 1963 b'sparse',
1964 1964 b'missingwarning',
1965 1965 default=True,
1966 1966 experimental=True,
1967 1967 )
1968 1968 coreconfigitem(
1969 1969 b'subrepos',
1970 1970 b'allowed',
1971 1971 default=dynamicdefault, # to make backporting simpler
1972 1972 )
1973 1973 coreconfigitem(
1974 1974 b'subrepos',
1975 1975 b'hg:allowed',
1976 1976 default=dynamicdefault,
1977 1977 )
1978 1978 coreconfigitem(
1979 1979 b'subrepos',
1980 1980 b'git:allowed',
1981 1981 default=dynamicdefault,
1982 1982 )
1983 1983 coreconfigitem(
1984 1984 b'subrepos',
1985 1985 b'svn:allowed',
1986 1986 default=dynamicdefault,
1987 1987 )
1988 1988 coreconfigitem(
1989 1989 b'templates',
1990 1990 b'.*',
1991 1991 default=None,
1992 1992 generic=True,
1993 1993 )
1994 1994 coreconfigitem(
1995 1995 b'templateconfig',
1996 1996 b'.*',
1997 1997 default=dynamicdefault,
1998 1998 generic=True,
1999 1999 )
2000 2000 coreconfigitem(
2001 2001 b'trusted',
2002 2002 b'groups',
2003 2003 default=list,
2004 2004 )
2005 2005 coreconfigitem(
2006 2006 b'trusted',
2007 2007 b'users',
2008 2008 default=list,
2009 2009 )
2010 2010 coreconfigitem(
2011 2011 b'ui',
2012 2012 b'_usedassubrepo',
2013 2013 default=False,
2014 2014 )
2015 2015 coreconfigitem(
2016 2016 b'ui',
2017 2017 b'allowemptycommit',
2018 2018 default=False,
2019 2019 )
2020 2020 coreconfigitem(
2021 2021 b'ui',
2022 2022 b'archivemeta',
2023 2023 default=True,
2024 2024 )
2025 2025 coreconfigitem(
2026 2026 b'ui',
2027 2027 b'askusername',
2028 2028 default=False,
2029 2029 )
2030 2030 coreconfigitem(
2031 2031 b'ui',
2032 2032 b'available-memory',
2033 2033 default=None,
2034 2034 )
2035 2035
2036 2036 coreconfigitem(
2037 2037 b'ui',
2038 2038 b'clonebundlefallback',
2039 2039 default=False,
2040 2040 )
2041 2041 coreconfigitem(
2042 2042 b'ui',
2043 2043 b'clonebundleprefers',
2044 2044 default=list,
2045 2045 )
2046 2046 coreconfigitem(
2047 2047 b'ui',
2048 2048 b'clonebundles',
2049 2049 default=True,
2050 2050 )
2051 2051 coreconfigitem(
2052 2052 b'ui',
2053 2053 b'color',
2054 2054 default=b'auto',
2055 2055 )
2056 2056 coreconfigitem(
2057 2057 b'ui',
2058 2058 b'commitsubrepos',
2059 2059 default=False,
2060 2060 )
2061 2061 coreconfigitem(
2062 2062 b'ui',
2063 2063 b'debug',
2064 2064 default=False,
2065 2065 )
2066 2066 coreconfigitem(
2067 2067 b'ui',
2068 2068 b'debugger',
2069 2069 default=None,
2070 2070 )
2071 2071 coreconfigitem(
2072 2072 b'ui',
2073 2073 b'editor',
2074 2074 default=dynamicdefault,
2075 2075 )
2076 2076 coreconfigitem(
2077 2077 b'ui',
2078 2078 b'detailed-exit-code',
2079 2079 default=False,
2080 2080 experimental=True,
2081 2081 )
2082 2082 coreconfigitem(
2083 2083 b'ui',
2084 2084 b'fallbackencoding',
2085 2085 default=None,
2086 2086 )
2087 2087 coreconfigitem(
2088 2088 b'ui',
2089 2089 b'forcecwd',
2090 2090 default=None,
2091 2091 )
2092 2092 coreconfigitem(
2093 2093 b'ui',
2094 2094 b'forcemerge',
2095 2095 default=None,
2096 2096 )
2097 2097 coreconfigitem(
2098 2098 b'ui',
2099 2099 b'formatdebug',
2100 2100 default=False,
2101 2101 )
2102 2102 coreconfigitem(
2103 2103 b'ui',
2104 2104 b'formatjson',
2105 2105 default=False,
2106 2106 )
2107 2107 coreconfigitem(
2108 2108 b'ui',
2109 2109 b'formatted',
2110 2110 default=None,
2111 2111 )
2112 2112 coreconfigitem(
2113 2113 b'ui',
2114 2114 b'interactive',
2115 2115 default=None,
2116 2116 )
2117 2117 coreconfigitem(
2118 2118 b'ui',
2119 2119 b'interface',
2120 2120 default=None,
2121 2121 )
2122 2122 coreconfigitem(
2123 2123 b'ui',
2124 2124 b'interface.chunkselector',
2125 2125 default=None,
2126 2126 )
2127 2127 coreconfigitem(
2128 2128 b'ui',
2129 2129 b'large-file-limit',
2130 2130 default=10000000,
2131 2131 )
2132 2132 coreconfigitem(
2133 2133 b'ui',
2134 2134 b'logblockedtimes',
2135 2135 default=False,
2136 2136 )
2137 2137 coreconfigitem(
2138 2138 b'ui',
2139 2139 b'merge',
2140 2140 default=None,
2141 2141 )
2142 2142 coreconfigitem(
2143 2143 b'ui',
2144 2144 b'mergemarkers',
2145 2145 default=b'basic',
2146 2146 )
2147 2147 coreconfigitem(
2148 2148 b'ui',
2149 2149 b'message-output',
2150 2150 default=b'stdio',
2151 2151 )
2152 2152 coreconfigitem(
2153 2153 b'ui',
2154 2154 b'nontty',
2155 2155 default=False,
2156 2156 )
2157 2157 coreconfigitem(
2158 2158 b'ui',
2159 2159 b'origbackuppath',
2160 2160 default=None,
2161 2161 )
2162 2162 coreconfigitem(
2163 2163 b'ui',
2164 2164 b'paginate',
2165 2165 default=True,
2166 2166 )
2167 2167 coreconfigitem(
2168 2168 b'ui',
2169 2169 b'patch',
2170 2170 default=None,
2171 2171 )
2172 2172 coreconfigitem(
2173 2173 b'ui',
2174 2174 b'portablefilenames',
2175 2175 default=b'warn',
2176 2176 )
2177 2177 coreconfigitem(
2178 2178 b'ui',
2179 2179 b'promptecho',
2180 2180 default=False,
2181 2181 )
2182 2182 coreconfigitem(
2183 2183 b'ui',
2184 2184 b'quiet',
2185 2185 default=False,
2186 2186 )
2187 2187 coreconfigitem(
2188 2188 b'ui',
2189 2189 b'quietbookmarkmove',
2190 2190 default=False,
2191 2191 )
2192 2192 coreconfigitem(
2193 2193 b'ui',
2194 2194 b'relative-paths',
2195 2195 default=b'legacy',
2196 2196 )
2197 2197 coreconfigitem(
2198 2198 b'ui',
2199 2199 b'remotecmd',
2200 2200 default=b'hg',
2201 2201 )
2202 2202 coreconfigitem(
2203 2203 b'ui',
2204 2204 b'report_untrusted',
2205 2205 default=True,
2206 2206 )
2207 2207 coreconfigitem(
2208 2208 b'ui',
2209 2209 b'rollback',
2210 2210 default=True,
2211 2211 )
2212 2212 coreconfigitem(
2213 2213 b'ui',
2214 2214 b'signal-safe-lock',
2215 2215 default=True,
2216 2216 )
2217 2217 coreconfigitem(
2218 2218 b'ui',
2219 2219 b'slash',
2220 2220 default=False,
2221 2221 )
2222 2222 coreconfigitem(
2223 2223 b'ui',
2224 2224 b'ssh',
2225 2225 default=b'ssh',
2226 2226 )
2227 2227 coreconfigitem(
2228 2228 b'ui',
2229 2229 b'ssherrorhint',
2230 2230 default=None,
2231 2231 )
2232 2232 coreconfigitem(
2233 2233 b'ui',
2234 2234 b'statuscopies',
2235 2235 default=False,
2236 2236 )
2237 2237 coreconfigitem(
2238 2238 b'ui',
2239 2239 b'strict',
2240 2240 default=False,
2241 2241 )
2242 2242 coreconfigitem(
2243 2243 b'ui',
2244 2244 b'style',
2245 2245 default=b'',
2246 2246 )
2247 2247 coreconfigitem(
2248 2248 b'ui',
2249 2249 b'supportcontact',
2250 2250 default=None,
2251 2251 )
2252 2252 coreconfigitem(
2253 2253 b'ui',
2254 2254 b'textwidth',
2255 2255 default=78,
2256 2256 )
2257 2257 coreconfigitem(
2258 2258 b'ui',
2259 2259 b'timeout',
2260 2260 default=b'600',
2261 2261 )
2262 2262 coreconfigitem(
2263 2263 b'ui',
2264 2264 b'timeout.warn',
2265 2265 default=0,
2266 2266 )
2267 2267 coreconfigitem(
2268 2268 b'ui',
2269 2269 b'timestamp-output',
2270 2270 default=False,
2271 2271 )
2272 2272 coreconfigitem(
2273 2273 b'ui',
2274 2274 b'traceback',
2275 2275 default=False,
2276 2276 )
2277 2277 coreconfigitem(
2278 2278 b'ui',
2279 2279 b'tweakdefaults',
2280 2280 default=False,
2281 2281 )
2282 2282 coreconfigitem(b'ui', b'username', alias=[(b'ui', b'user')])
2283 2283 coreconfigitem(
2284 2284 b'ui',
2285 2285 b'verbose',
2286 2286 default=False,
2287 2287 )
2288 2288 coreconfigitem(
2289 2289 b'verify',
2290 2290 b'skipflags',
2291 2291 default=None,
2292 2292 )
2293 2293 coreconfigitem(
2294 2294 b'web',
2295 2295 b'allowbz2',
2296 2296 default=False,
2297 2297 )
2298 2298 coreconfigitem(
2299 2299 b'web',
2300 2300 b'allowgz',
2301 2301 default=False,
2302 2302 )
2303 2303 coreconfigitem(
2304 2304 b'web',
2305 2305 b'allow-pull',
2306 2306 alias=[(b'web', b'allowpull')],
2307 2307 default=True,
2308 2308 )
2309 2309 coreconfigitem(
2310 2310 b'web',
2311 2311 b'allow-push',
2312 2312 alias=[(b'web', b'allow_push')],
2313 2313 default=list,
2314 2314 )
2315 2315 coreconfigitem(
2316 2316 b'web',
2317 2317 b'allowzip',
2318 2318 default=False,
2319 2319 )
2320 2320 coreconfigitem(
2321 2321 b'web',
2322 2322 b'archivesubrepos',
2323 2323 default=False,
2324 2324 )
2325 2325 coreconfigitem(
2326 2326 b'web',
2327 2327 b'cache',
2328 2328 default=True,
2329 2329 )
2330 2330 coreconfigitem(
2331 2331 b'web',
2332 2332 b'comparisoncontext',
2333 2333 default=5,
2334 2334 )
2335 2335 coreconfigitem(
2336 2336 b'web',
2337 2337 b'contact',
2338 2338 default=None,
2339 2339 )
2340 2340 coreconfigitem(
2341 2341 b'web',
2342 2342 b'deny_push',
2343 2343 default=list,
2344 2344 )
2345 2345 coreconfigitem(
2346 2346 b'web',
2347 2347 b'guessmime',
2348 2348 default=False,
2349 2349 )
2350 2350 coreconfigitem(
2351 2351 b'web',
2352 2352 b'hidden',
2353 2353 default=False,
2354 2354 )
2355 2355 coreconfigitem(
2356 2356 b'web',
2357 2357 b'labels',
2358 2358 default=list,
2359 2359 )
2360 2360 coreconfigitem(
2361 2361 b'web',
2362 2362 b'logoimg',
2363 2363 default=b'hglogo.png',
2364 2364 )
2365 2365 coreconfigitem(
2366 2366 b'web',
2367 2367 b'logourl',
2368 2368 default=b'https://mercurial-scm.org/',
2369 2369 )
2370 2370 coreconfigitem(
2371 2371 b'web',
2372 2372 b'accesslog',
2373 2373 default=b'-',
2374 2374 )
2375 2375 coreconfigitem(
2376 2376 b'web',
2377 2377 b'address',
2378 2378 default=b'',
2379 2379 )
2380 2380 coreconfigitem(
2381 2381 b'web',
2382 2382 b'allow-archive',
2383 2383 alias=[(b'web', b'allow_archive')],
2384 2384 default=list,
2385 2385 )
2386 2386 coreconfigitem(
2387 2387 b'web',
2388 2388 b'allow_read',
2389 2389 default=list,
2390 2390 )
2391 2391 coreconfigitem(
2392 2392 b'web',
2393 2393 b'baseurl',
2394 2394 default=None,
2395 2395 )
2396 2396 coreconfigitem(
2397 2397 b'web',
2398 2398 b'cacerts',
2399 2399 default=None,
2400 2400 )
2401 2401 coreconfigitem(
2402 2402 b'web',
2403 2403 b'certificate',
2404 2404 default=None,
2405 2405 )
2406 2406 coreconfigitem(
2407 2407 b'web',
2408 2408 b'collapse',
2409 2409 default=False,
2410 2410 )
2411 2411 coreconfigitem(
2412 2412 b'web',
2413 2413 b'csp',
2414 2414 default=None,
2415 2415 )
2416 2416 coreconfigitem(
2417 2417 b'web',
2418 2418 b'deny_read',
2419 2419 default=list,
2420 2420 )
2421 2421 coreconfigitem(
2422 2422 b'web',
2423 2423 b'descend',
2424 2424 default=True,
2425 2425 )
2426 2426 coreconfigitem(
2427 2427 b'web',
2428 2428 b'description',
2429 2429 default=b"",
2430 2430 )
2431 2431 coreconfigitem(
2432 2432 b'web',
2433 2433 b'encoding',
2434 2434 default=lambda: encoding.encoding,
2435 2435 )
2436 2436 coreconfigitem(
2437 2437 b'web',
2438 2438 b'errorlog',
2439 2439 default=b'-',
2440 2440 )
2441 2441 coreconfigitem(
2442 2442 b'web',
2443 2443 b'ipv6',
2444 2444 default=False,
2445 2445 )
2446 2446 coreconfigitem(
2447 2447 b'web',
2448 2448 b'maxchanges',
2449 2449 default=10,
2450 2450 )
2451 2451 coreconfigitem(
2452 2452 b'web',
2453 2453 b'maxfiles',
2454 2454 default=10,
2455 2455 )
2456 2456 coreconfigitem(
2457 2457 b'web',
2458 2458 b'maxshortchanges',
2459 2459 default=60,
2460 2460 )
2461 2461 coreconfigitem(
2462 2462 b'web',
2463 2463 b'motd',
2464 2464 default=b'',
2465 2465 )
2466 2466 coreconfigitem(
2467 2467 b'web',
2468 2468 b'name',
2469 2469 default=dynamicdefault,
2470 2470 )
2471 2471 coreconfigitem(
2472 2472 b'web',
2473 2473 b'port',
2474 2474 default=8000,
2475 2475 )
2476 2476 coreconfigitem(
2477 2477 b'web',
2478 2478 b'prefix',
2479 2479 default=b'',
2480 2480 )
2481 2481 coreconfigitem(
2482 2482 b'web',
2483 2483 b'push_ssl',
2484 2484 default=True,
2485 2485 )
2486 2486 coreconfigitem(
2487 2487 b'web',
2488 2488 b'refreshinterval',
2489 2489 default=20,
2490 2490 )
2491 2491 coreconfigitem(
2492 2492 b'web',
2493 2493 b'server-header',
2494 2494 default=None,
2495 2495 )
2496 2496 coreconfigitem(
2497 2497 b'web',
2498 2498 b'static',
2499 2499 default=None,
2500 2500 )
2501 2501 coreconfigitem(
2502 2502 b'web',
2503 2503 b'staticurl',
2504 2504 default=None,
2505 2505 )
2506 2506 coreconfigitem(
2507 2507 b'web',
2508 2508 b'stripes',
2509 2509 default=1,
2510 2510 )
2511 2511 coreconfigitem(
2512 2512 b'web',
2513 2513 b'style',
2514 2514 default=b'paper',
2515 2515 )
2516 2516 coreconfigitem(
2517 2517 b'web',
2518 2518 b'templates',
2519 2519 default=None,
2520 2520 )
2521 2521 coreconfigitem(
2522 2522 b'web',
2523 2523 b'view',
2524 2524 default=b'served',
2525 2525 experimental=True,
2526 2526 )
2527 2527 coreconfigitem(
2528 2528 b'worker',
2529 2529 b'backgroundclose',
2530 2530 default=dynamicdefault,
2531 2531 )
2532 2532 # Windows defaults to a limit of 512 open files. A buffer of 128
2533 2533 # should give us enough headway.
2534 2534 coreconfigitem(
2535 2535 b'worker',
2536 2536 b'backgroundclosemaxqueue',
2537 2537 default=384,
2538 2538 )
2539 2539 coreconfigitem(
2540 2540 b'worker',
2541 2541 b'backgroundcloseminfilecount',
2542 2542 default=2048,
2543 2543 )
2544 2544 coreconfigitem(
2545 2545 b'worker',
2546 2546 b'backgroundclosethreadcount',
2547 2547 default=4,
2548 2548 )
2549 2549 coreconfigitem(
2550 2550 b'worker',
2551 2551 b'enabled',
2552 2552 default=True,
2553 2553 )
2554 2554 coreconfigitem(
2555 2555 b'worker',
2556 2556 b'numcpus',
2557 2557 default=None,
2558 2558 )
2559 2559
2560 2560 # Rebase related configuration moved to core because other extension are doing
2561 2561 # strange things. For example, shelve import the extensions to reuse some bit
2562 2562 # without formally loading it.
2563 2563 coreconfigitem(
2564 2564 b'commands',
2565 2565 b'rebase.requiredest',
2566 2566 default=False,
2567 2567 )
2568 2568 coreconfigitem(
2569 2569 b'experimental',
2570 2570 b'rebaseskipobsolete',
2571 2571 default=True,
2572 2572 )
2573 2573 coreconfigitem(
2574 2574 b'rebase',
2575 2575 b'singletransaction',
2576 2576 default=False,
2577 2577 )
2578 2578 coreconfigitem(
2579 2579 b'rebase',
2580 2580 b'experimental.inmemory',
2581 2581 default=False,
2582 2582 )
@@ -1,350 +1,354 b''
1 1 # hook.py - hook support for mercurial
2 2 #
3 3 # Copyright 2007 Matt Mackall <mpm@selenic.com>
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 contextlib
11 11 import errno
12 12 import os
13 13 import sys
14 14
15 15 from .i18n import _
16 16 from .pycompat import getattr
17 17 from . import (
18 18 demandimport,
19 19 encoding,
20 20 error,
21 21 extensions,
22 22 pycompat,
23 23 util,
24 24 )
25 25 from .utils import (
26 26 procutil,
27 27 resourceutil,
28 28 stringutil,
29 29 )
30 30
31 31
32 32 def pythonhook(ui, repo, htype, hname, funcname, args, throw):
33 33 """call python hook. hook is callable object, looked up as
34 34 name in python module. if callable returns "true", hook
35 35 fails, else passes. if hook raises exception, treated as
36 36 hook failure. exception propagates if throw is "true".
37 37
38 38 reason for "true" meaning "hook failed" is so that
39 39 unmodified commands (e.g. mercurial.commands.update) can
40 40 be run as hooks without wrappers to convert return values."""
41 41
42 42 if callable(funcname):
43 43 obj = funcname
44 44 funcname = pycompat.sysbytes(obj.__module__ + "." + obj.__name__)
45 45 else:
46 46 d = funcname.rfind(b'.')
47 47 if d == -1:
48 48 raise error.HookLoadError(
49 49 _(b'%s hook is invalid: "%s" not in a module')
50 50 % (hname, funcname)
51 51 )
52 52 modname = funcname[:d]
53 53 oldpaths = sys.path
54 54 if resourceutil.mainfrozen():
55 55 # binary installs require sys.path manipulation
56 56 modpath, modfile = os.path.split(modname)
57 57 if modpath and modfile:
58 58 sys.path = sys.path[:] + [modpath]
59 59 modname = modfile
60 60 with demandimport.deactivated():
61 61 try:
62 62 obj = __import__(pycompat.sysstr(modname))
63 63 except (ImportError, SyntaxError):
64 64 e1 = sys.exc_info()
65 65 try:
66 66 # extensions are loaded with hgext_ prefix
67 67 obj = __import__("hgext_%s" % pycompat.sysstr(modname))
68 68 except (ImportError, SyntaxError):
69 69 e2 = sys.exc_info()
70 70 if ui.tracebackflag:
71 71 ui.warn(
72 72 _(
73 73 b'exception from first failed import '
74 74 b'attempt:\n'
75 75 )
76 76 )
77 77 ui.traceback(e1)
78 78 if ui.tracebackflag:
79 79 ui.warn(
80 80 _(
81 81 b'exception from second failed import '
82 82 b'attempt:\n'
83 83 )
84 84 )
85 85 ui.traceback(e2)
86 86
87 87 if not ui.tracebackflag:
88 88 tracebackhint = _(
89 89 b'run with --traceback for stack trace'
90 90 )
91 91 else:
92 92 tracebackhint = None
93 93 raise error.HookLoadError(
94 94 _(b'%s hook is invalid: import of "%s" failed')
95 95 % (hname, modname),
96 96 hint=tracebackhint,
97 97 )
98 98 sys.path = oldpaths
99 99 try:
100 100 for p in funcname.split(b'.')[1:]:
101 101 obj = getattr(obj, p)
102 102 except AttributeError:
103 103 raise error.HookLoadError(
104 104 _(b'%s hook is invalid: "%s" is not defined')
105 105 % (hname, funcname)
106 106 )
107 107 if not callable(obj):
108 108 raise error.HookLoadError(
109 109 _(b'%s hook is invalid: "%s" is not callable')
110 110 % (hname, funcname)
111 111 )
112 112
113 113 ui.note(_(b"calling hook %s: %s\n") % (hname, funcname))
114 114 starttime = util.timer()
115 115
116 116 try:
117 117 r = obj(ui=ui, repo=repo, hooktype=htype, **pycompat.strkwargs(args))
118 118 except Exception as exc:
119 119 if isinstance(exc, error.Abort):
120 120 ui.warn(_(b'error: %s hook failed: %s\n') % (hname, exc.args[0]))
121 121 else:
122 122 ui.warn(
123 123 _(b'error: %s hook raised an exception: %s\n')
124 124 % (hname, stringutil.forcebytestr(exc))
125 125 )
126 126 if throw:
127 127 raise
128 128 if not ui.tracebackflag:
129 129 ui.warn(_(b'(run with --traceback for stack trace)\n'))
130 130 ui.traceback()
131 131 return True, True
132 132 finally:
133 133 duration = util.timer() - starttime
134 134 ui.log(
135 135 b'pythonhook',
136 136 b'pythonhook-%s: %s finished in %0.2f seconds\n',
137 137 htype,
138 138 funcname,
139 139 duration,
140 140 )
141 141 if r:
142 142 if throw:
143 143 raise error.HookAbort(_(b'%s hook failed') % hname)
144 144 ui.warn(_(b'warning: %s hook failed\n') % hname)
145 145 return r, False
146 146
147 147
148 148 def _exthook(ui, repo, htype, name, cmd, args, throw):
149 149 starttime = util.timer()
150 150 env = {}
151 151
152 152 # make in-memory changes visible to external process
153 153 if repo is not None:
154 154 tr = repo.currenttransaction()
155 155 repo.dirstate.write(tr)
156 156 if tr and tr.writepending():
157 157 env[b'HG_PENDING'] = repo.root
158 158 env[b'HG_HOOKTYPE'] = htype
159 159 env[b'HG_HOOKNAME'] = name
160 160 env[b'HGPLAIN'] = b'1'
161 161
162 162 for k, v in pycompat.iteritems(args):
163 163 # transaction changes can accumulate MBs of data, so skip it
164 164 # for external hooks
165 165 if k == b'changes':
166 166 continue
167 167 if callable(v):
168 168 v = v()
169 169 if isinstance(v, (dict, list)):
170 170 v = stringutil.pprint(v)
171 171 env[b'HG_' + k.upper()] = v
172 172
173 173 if ui.configbool(b'hooks', b'tonative.%s' % name, False):
174 174 oldcmd = cmd
175 175 cmd = procutil.shelltonative(cmd, env)
176 176 if cmd != oldcmd:
177 177 ui.note(_(b'converting hook "%s" to native\n') % name)
178 178
179 179 ui.note(_(b"running hook %s: %s\n") % (name, cmd))
180 180
181 181 if repo:
182 182 cwd = repo.root
183 183 else:
184 184 cwd = encoding.getcwd()
185 185 r = ui.system(cmd, environ=env, cwd=cwd, blockedtag=b'exthook-%s' % (name,))
186 186
187 187 duration = util.timer() - starttime
188 188 ui.log(
189 189 b'exthook',
190 190 b'exthook-%s: %s finished in %0.2f seconds\n',
191 191 name,
192 192 cmd,
193 193 duration,
194 194 )
195 195 if r:
196 196 desc = procutil.explainexit(r)
197 197 if throw:
198 198 raise error.HookAbort(_(b'%s hook %s') % (name, desc))
199 199 ui.warn(_(b'warning: %s hook %s\n') % (name, desc))
200 200 return r
201 201
202 202
203 203 # represent an untrusted hook command
204 204 _fromuntrusted = object()
205 205
206 206
207 207 def _allhooks(ui):
208 208 """return a list of (hook-id, cmd) pairs sorted by priority"""
209 209 hooks = _hookitems(ui)
210 210 # Be careful in this section, propagating the real commands from untrusted
211 211 # sources would create a security vulnerability, make sure anything altered
212 212 # in that section uses "_fromuntrusted" as its command.
213 213 untrustedhooks = _hookitems(ui, _untrusted=True)
214 214 for name, value in untrustedhooks.items():
215 215 trustedvalue = hooks.get(name, ((), (), name, _fromuntrusted))
216 216 if value != trustedvalue:
217 217 (lp, lo, lk, lv) = trustedvalue
218 218 hooks[name] = (lp, lo, lk, _fromuntrusted)
219 219 # (end of the security sensitive section)
220 220 return [(k, v) for p, o, k, v in sorted(hooks.values())]
221 221
222 222
223 223 def _hookitems(ui, _untrusted=False):
224 224 """return all hooks items ready to be sorted"""
225 225 hooks = {}
226 226 for name, cmd in ui.configitems(b'hooks', untrusted=_untrusted):
227 if name.startswith(b'priority.') or name.startswith(b'tonative.'):
227 if (
228 name.startswith(b'priority.')
229 or name.startswith(b'tonative.')
230 or b':' in name
231 ):
228 232 continue
229 233
230 234 priority = ui.configint(b'hooks', b'priority.%s' % name, 0)
231 235 hooks[name] = ((-priority,), (len(hooks),), name, cmd)
232 236 return hooks
233 237
234 238
235 239 _redirect = False
236 240
237 241
238 242 def redirect(state):
239 243 global _redirect
240 244 _redirect = state
241 245
242 246
243 247 def hashook(ui, htype):
244 248 """return True if a hook is configured for 'htype'"""
245 249 if not ui.callhooks:
246 250 return False
247 251 for hname, cmd in _allhooks(ui):
248 252 if hname.split(b'.')[0] == htype and cmd:
249 253 return True
250 254 return False
251 255
252 256
253 257 def hook(ui, repo, htype, throw=False, **args):
254 258 if not ui.callhooks:
255 259 return False
256 260
257 261 hooks = []
258 262 for hname, cmd in _allhooks(ui):
259 263 if hname.split(b'.')[0] == htype and cmd:
260 264 hooks.append((hname, cmd))
261 265
262 266 res = runhooks(ui, repo, htype, hooks, throw=throw, **args)
263 267 r = False
264 268 for hname, cmd in hooks:
265 269 r = res[hname][0] or r
266 270 return r
267 271
268 272
269 273 @contextlib.contextmanager
270 274 def redirect_stdio():
271 275 """Redirects stdout to stderr, if possible."""
272 276
273 277 oldstdout = -1
274 278 try:
275 279 if _redirect:
276 280 try:
277 281 stdoutno = procutil.stdout.fileno()
278 282 stderrno = procutil.stderr.fileno()
279 283 # temporarily redirect stdout to stderr, if possible
280 284 if stdoutno >= 0 and stderrno >= 0:
281 285 procutil.stdout.flush()
282 286 oldstdout = os.dup(stdoutno)
283 287 os.dup2(stderrno, stdoutno)
284 288 except (OSError, AttributeError):
285 289 # files seem to be bogus, give up on redirecting (WSGI, etc)
286 290 pass
287 291
288 292 yield
289 293
290 294 finally:
291 295 # The stderr is fully buffered on Windows when connected to a pipe.
292 296 # A forcible flush is required to make small stderr data in the
293 297 # remote side available to the client immediately.
294 298 try:
295 299 procutil.stderr.flush()
296 300 except IOError as err:
297 301 if err.errno not in (errno.EPIPE, errno.EIO, errno.EBADF):
298 302 raise error.StdioError(err)
299 303
300 304 if _redirect and oldstdout >= 0:
301 305 try:
302 306 procutil.stdout.flush() # write hook output to stderr fd
303 307 except IOError as err:
304 308 if err.errno not in (errno.EPIPE, errno.EIO, errno.EBADF):
305 309 raise error.StdioError(err)
306 310 os.dup2(oldstdout, stdoutno)
307 311 os.close(oldstdout)
308 312
309 313
310 314 def runhooks(ui, repo, htype, hooks, throw=False, **args):
311 315 args = pycompat.byteskwargs(args)
312 316 res = {}
313 317
314 318 with redirect_stdio():
315 319 for hname, cmd in hooks:
316 320 if cmd is _fromuntrusted:
317 321 if throw:
318 322 raise error.HookAbort(
319 323 _(b'untrusted hook %s not executed') % hname,
320 324 hint=_(b"see 'hg help config.trusted'"),
321 325 )
322 326 ui.warn(_(b'warning: untrusted hook %s not executed\n') % hname)
323 327 r = 1
324 328 raised = False
325 329 elif callable(cmd):
326 330 r, raised = pythonhook(ui, repo, htype, hname, cmd, args, throw)
327 331 elif cmd.startswith(b'python:'):
328 332 if cmd.count(b':') >= 2:
329 333 path, cmd = cmd[7:].rsplit(b':', 1)
330 334 path = util.expandpath(path)
331 335 if repo:
332 336 path = os.path.join(repo.root, path)
333 337 try:
334 338 mod = extensions.loadpath(path, b'hghook.%s' % hname)
335 339 except Exception:
336 340 ui.write(_(b"loading %s hook failed:\n") % hname)
337 341 raise
338 342 hookfn = getattr(mod, cmd)
339 343 else:
340 344 hookfn = cmd[7:].strip()
341 345 r, raised = pythonhook(
342 346 ui, repo, htype, hname, hookfn, args, throw
343 347 )
344 348 else:
345 349 r = _exthook(ui, repo, htype, hname, cmd, args, throw)
346 350 raised = False
347 351
348 352 res[hname] = r, raised
349 353
350 354 return res
General Comments 0
You need to be logged in to leave comments. Login now