##// END OF EJS Templates
configitems: register the 'experimental.allowdivergence' config
Boris Feld -
r34491:fcf6d165 default
parent child Browse files
Show More
@@ -1,695 +1,698
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
12 12 from . import (
13 13 encoding,
14 14 error,
15 15 )
16 16
17 17 def loadconfigtable(ui, extname, configtable):
18 18 """update config item known to the ui with the extension ones"""
19 19 for section, items in configtable.items():
20 20 knownitems = ui._knownconfig.setdefault(section, {})
21 21 knownkeys = set(knownitems)
22 22 newkeys = set(items)
23 23 for key in sorted(knownkeys & newkeys):
24 24 msg = "extension '%s' overwrite config item '%s.%s'"
25 25 msg %= (extname, section, key)
26 26 ui.develwarn(msg, config='warn-config')
27 27
28 28 knownitems.update(items)
29 29
30 30 class configitem(object):
31 31 """represent a known config item
32 32
33 33 :section: the official config section where to find this item,
34 34 :name: the official name within the section,
35 35 :default: default value for this item,
36 36 :alias: optional list of tuples as alternatives.
37 37 """
38 38
39 39 def __init__(self, section, name, default=None, alias=()):
40 40 self.section = section
41 41 self.name = name
42 42 self.default = default
43 43 self.alias = list(alias)
44 44
45 45 coreitems = {}
46 46
47 47 def _register(configtable, *args, **kwargs):
48 48 item = configitem(*args, **kwargs)
49 49 section = configtable.setdefault(item.section, {})
50 50 if item.name in section:
51 51 msg = "duplicated config item registration for '%s.%s'"
52 52 raise error.ProgrammingError(msg % (item.section, item.name))
53 53 section[item.name] = item
54 54
55 55 # special value for case where the default is derived from other values
56 56 dynamicdefault = object()
57 57
58 58 # Registering actual config items
59 59
60 60 def getitemregister(configtable):
61 61 return functools.partial(_register, configtable)
62 62
63 63 coreconfigitem = getitemregister(coreitems)
64 64
65 65 coreconfigitem('auth', 'cookiefile',
66 66 default=None,
67 67 )
68 68 # bookmarks.pushing: internal hack for discovery
69 69 coreconfigitem('bookmarks', 'pushing',
70 70 default=list,
71 71 )
72 72 # bundle.mainreporoot: internal hack for bundlerepo
73 73 coreconfigitem('bundle', 'mainreporoot',
74 74 default='',
75 75 )
76 76 # bundle.reorder: experimental config
77 77 coreconfigitem('bundle', 'reorder',
78 78 default='auto',
79 79 )
80 80 coreconfigitem('censor', 'policy',
81 81 default='abort',
82 82 )
83 83 coreconfigitem('chgserver', 'idletimeout',
84 84 default=3600,
85 85 )
86 86 coreconfigitem('chgserver', 'skiphash',
87 87 default=False,
88 88 )
89 89 coreconfigitem('cmdserver', 'log',
90 90 default=None,
91 91 )
92 92 coreconfigitem('color', 'mode',
93 93 default='auto',
94 94 )
95 95 coreconfigitem('color', 'pagermode',
96 96 default=dynamicdefault,
97 97 )
98 98 coreconfigitem('commands', 'status.relative',
99 99 default=False,
100 100 )
101 101 coreconfigitem('commands', 'status.skipstates',
102 102 default=[],
103 103 )
104 104 coreconfigitem('commands', 'status.verbose',
105 105 default=False,
106 106 )
107 107 coreconfigitem('commands', 'update.requiredest',
108 108 default=False,
109 109 )
110 110 coreconfigitem('debug', 'dirstate.delaywrite',
111 111 default=0,
112 112 )
113 113 coreconfigitem('devel', 'all-warnings',
114 114 default=False,
115 115 )
116 116 coreconfigitem('devel', 'bundle2.debug',
117 117 default=False,
118 118 )
119 119 coreconfigitem('devel', 'check-locks',
120 120 default=False,
121 121 )
122 122 coreconfigitem('devel', 'check-relroot',
123 123 default=False,
124 124 )
125 125 coreconfigitem('devel', 'default-date',
126 126 default=None,
127 127 )
128 128 coreconfigitem('devel', 'deprec-warn',
129 129 default=False,
130 130 )
131 131 coreconfigitem('devel', 'disableloaddefaultcerts',
132 132 default=False,
133 133 )
134 134 coreconfigitem('devel', 'legacy.exchange',
135 135 default=list,
136 136 )
137 137 coreconfigitem('devel', 'servercafile',
138 138 default='',
139 139 )
140 140 coreconfigitem('devel', 'serverexactprotocol',
141 141 default='',
142 142 )
143 143 coreconfigitem('devel', 'serverrequirecert',
144 144 default=False,
145 145 )
146 146 coreconfigitem('devel', 'strip-obsmarkers',
147 147 default=True,
148 148 )
149 149 coreconfigitem('email', 'charsets',
150 150 default=list,
151 151 )
152 152 coreconfigitem('email', 'from',
153 153 default=None,
154 154 )
155 155 coreconfigitem('email', 'method',
156 156 default='smtp',
157 157 )
158 coreconfigitem('experimental', 'allowdivergence',
159 default=False,
160 )
158 161 coreconfigitem('experimental', 'bundle-phases',
159 162 default=False,
160 163 )
161 164 coreconfigitem('experimental', 'bundle2-advertise',
162 165 default=True,
163 166 )
164 167 coreconfigitem('experimental', 'bundle2-output-capture',
165 168 default=False,
166 169 )
167 170 coreconfigitem('experimental', 'bundle2.pushback',
168 171 default=False,
169 172 )
170 173 coreconfigitem('experimental', 'bundle2lazylocking',
171 174 default=False,
172 175 )
173 176 coreconfigitem('experimental', 'bundlecomplevel',
174 177 default=None,
175 178 )
176 179 coreconfigitem('experimental', 'changegroup3',
177 180 default=False,
178 181 )
179 182 coreconfigitem('experimental', 'clientcompressionengines',
180 183 default=list,
181 184 )
182 185 coreconfigitem('experimental', 'copytrace',
183 186 default='on',
184 187 )
185 188 coreconfigitem('experimental', 'copytrace.sourcecommitlimit',
186 189 default=100,
187 190 )
188 191 coreconfigitem('experimental', 'crecordtest',
189 192 default=None,
190 193 )
191 194 coreconfigitem('experimental', 'editortmpinhg',
192 195 default=False,
193 196 )
194 197 coreconfigitem('experimental', 'stabilization',
195 198 default=list,
196 199 alias=[('experimental', 'evolution')],
197 200 )
198 201 coreconfigitem('experimental', 'stabilization.bundle-obsmarker',
199 202 default=False,
200 203 alias=[('experimental', 'evolution.bundle-obsmarker')],
201 204 )
202 205 coreconfigitem('experimental', 'stabilization.track-operation',
203 206 default=True,
204 207 alias=[('experimental', 'evolution.track-operation')]
205 208 )
206 209 coreconfigitem('experimental', 'exportableenviron',
207 210 default=list,
208 211 )
209 212 coreconfigitem('experimental', 'extendedheader.index',
210 213 default=None,
211 214 )
212 215 coreconfigitem('experimental', 'extendedheader.similarity',
213 216 default=False,
214 217 )
215 218 coreconfigitem('experimental', 'format.compression',
216 219 default='zlib',
217 220 )
218 221 coreconfigitem('experimental', 'graphshorten',
219 222 default=False,
220 223 )
221 224 coreconfigitem('experimental', 'hook-track-tags',
222 225 default=False,
223 226 )
224 227 coreconfigitem('experimental', 'httppostargs',
225 228 default=False,
226 229 )
227 230 coreconfigitem('experimental', 'manifestv2',
228 231 default=False,
229 232 )
230 233 coreconfigitem('experimental', 'mergedriver',
231 234 default=None,
232 235 )
233 236 coreconfigitem('experimental', 'obsmarkers-exchange-debug',
234 237 default=False,
235 238 )
236 239 coreconfigitem('experimental', 'rebase.multidest',
237 240 default=False,
238 241 )
239 242 coreconfigitem('experimental', 'revertalternateinteractivemode',
240 243 default=True,
241 244 )
242 245 coreconfigitem('experimental', 'revlogv2',
243 246 default=None,
244 247 )
245 248 coreconfigitem('experimental', 'spacemovesdown',
246 249 default=False,
247 250 )
248 251 coreconfigitem('experimental', 'treemanifest',
249 252 default=False,
250 253 )
251 254 coreconfigitem('experimental', 'updatecheck',
252 255 default=None,
253 256 )
254 257 coreconfigitem('format', 'aggressivemergedeltas',
255 258 default=False,
256 259 )
257 260 coreconfigitem('format', 'chunkcachesize',
258 261 default=None,
259 262 )
260 263 coreconfigitem('format', 'dotencode',
261 264 default=True,
262 265 )
263 266 coreconfigitem('format', 'generaldelta',
264 267 default=False,
265 268 )
266 269 coreconfigitem('format', 'manifestcachesize',
267 270 default=None,
268 271 )
269 272 coreconfigitem('format', 'maxchainlen',
270 273 default=None,
271 274 )
272 275 coreconfigitem('format', 'obsstore-version',
273 276 default=None,
274 277 )
275 278 coreconfigitem('format', 'usefncache',
276 279 default=True,
277 280 )
278 281 coreconfigitem('format', 'usegeneraldelta',
279 282 default=True,
280 283 )
281 284 coreconfigitem('format', 'usestore',
282 285 default=True,
283 286 )
284 287 coreconfigitem('hostsecurity', 'ciphers',
285 288 default=None,
286 289 )
287 290 coreconfigitem('hostsecurity', 'disabletls10warning',
288 291 default=False,
289 292 )
290 293 coreconfigitem('http_proxy', 'always',
291 294 default=False,
292 295 )
293 296 coreconfigitem('http_proxy', 'host',
294 297 default=None,
295 298 )
296 299 coreconfigitem('http_proxy', 'no',
297 300 default=list,
298 301 )
299 302 coreconfigitem('http_proxy', 'passwd',
300 303 default=None,
301 304 )
302 305 coreconfigitem('http_proxy', 'user',
303 306 default=None,
304 307 )
305 308 coreconfigitem('merge', 'followcopies',
306 309 default=True,
307 310 )
308 311 coreconfigitem('merge', 'preferancestor',
309 312 default=lambda: ['*'],
310 313 )
311 314 coreconfigitem('pager', 'ignore',
312 315 default=list,
313 316 )
314 317 coreconfigitem('patch', 'eol',
315 318 default='strict',
316 319 )
317 320 coreconfigitem('patch', 'fuzz',
318 321 default=2,
319 322 )
320 323 coreconfigitem('paths', 'default',
321 324 default=None,
322 325 )
323 326 coreconfigitem('paths', 'default-push',
324 327 default=None,
325 328 )
326 329 coreconfigitem('phases', 'checksubrepos',
327 330 default='follow',
328 331 )
329 332 coreconfigitem('phases', 'new-commit',
330 333 default=dynamicdefault,
331 334 )
332 335 coreconfigitem('phases', 'publish',
333 336 default=True,
334 337 )
335 338 coreconfigitem('profiling', 'enabled',
336 339 default=False,
337 340 )
338 341 coreconfigitem('profiling', 'format',
339 342 default='text',
340 343 )
341 344 coreconfigitem('profiling', 'freq',
342 345 default=1000,
343 346 )
344 347 coreconfigitem('profiling', 'limit',
345 348 default=30,
346 349 )
347 350 coreconfigitem('profiling', 'nested',
348 351 default=0,
349 352 )
350 353 coreconfigitem('profiling', 'output',
351 354 default=None,
352 355 )
353 356 coreconfigitem('profiling', 'showmax',
354 357 default=0.999,
355 358 )
356 359 coreconfigitem('profiling', 'showmin',
357 360 default=dynamicdefault,
358 361 )
359 362 coreconfigitem('profiling', 'sort',
360 363 default='inlinetime',
361 364 )
362 365 coreconfigitem('profiling', 'statformat',
363 366 default='hotpath',
364 367 )
365 368 coreconfigitem('profiling', 'type',
366 369 default='stat',
367 370 )
368 371 coreconfigitem('progress', 'assume-tty',
369 372 default=False,
370 373 )
371 374 coreconfigitem('progress', 'changedelay',
372 375 default=1,
373 376 )
374 377 coreconfigitem('progress', 'clear-complete',
375 378 default=True,
376 379 )
377 380 coreconfigitem('progress', 'debug',
378 381 default=False,
379 382 )
380 383 coreconfigitem('progress', 'delay',
381 384 default=3,
382 385 )
383 386 coreconfigitem('progress', 'disable',
384 387 default=False,
385 388 )
386 389 coreconfigitem('progress', 'estimateinterval',
387 390 default=60.0,
388 391 )
389 392 coreconfigitem('progress', 'refresh',
390 393 default=0.1,
391 394 )
392 395 coreconfigitem('progress', 'width',
393 396 default=dynamicdefault,
394 397 )
395 398 coreconfigitem('push', 'pushvars.server',
396 399 default=False,
397 400 )
398 401 coreconfigitem('server', 'bundle1',
399 402 default=True,
400 403 )
401 404 coreconfigitem('server', 'bundle1gd',
402 405 default=None,
403 406 )
404 407 coreconfigitem('server', 'compressionengines',
405 408 default=list,
406 409 )
407 410 coreconfigitem('server', 'concurrent-push-mode',
408 411 default='strict',
409 412 )
410 413 coreconfigitem('server', 'disablefullbundle',
411 414 default=False,
412 415 )
413 416 coreconfigitem('server', 'maxhttpheaderlen',
414 417 default=1024,
415 418 )
416 419 coreconfigitem('server', 'preferuncompressed',
417 420 default=False,
418 421 )
419 422 coreconfigitem('server', 'uncompressed',
420 423 default=True,
421 424 )
422 425 coreconfigitem('server', 'uncompressedallowsecret',
423 426 default=False,
424 427 )
425 428 coreconfigitem('server', 'validate',
426 429 default=False,
427 430 )
428 431 coreconfigitem('server', 'zliblevel',
429 432 default=-1,
430 433 )
431 434 coreconfigitem('smtp', 'host',
432 435 default=None,
433 436 )
434 437 coreconfigitem('smtp', 'local_hostname',
435 438 default=None,
436 439 )
437 440 coreconfigitem('smtp', 'password',
438 441 default=None,
439 442 )
440 443 coreconfigitem('smtp', 'port',
441 444 default=dynamicdefault,
442 445 )
443 446 coreconfigitem('smtp', 'tls',
444 447 default='none',
445 448 )
446 449 coreconfigitem('smtp', 'username',
447 450 default=None,
448 451 )
449 452 coreconfigitem('sparse', 'missingwarning',
450 453 default=True,
451 454 )
452 455 coreconfigitem('trusted', 'groups',
453 456 default=list,
454 457 )
455 458 coreconfigitem('trusted', 'users',
456 459 default=list,
457 460 )
458 461 coreconfigitem('ui', '_usedassubrepo',
459 462 default=False,
460 463 )
461 464 coreconfigitem('ui', 'allowemptycommit',
462 465 default=False,
463 466 )
464 467 coreconfigitem('ui', 'archivemeta',
465 468 default=True,
466 469 )
467 470 coreconfigitem('ui', 'askusername',
468 471 default=False,
469 472 )
470 473 coreconfigitem('ui', 'clonebundlefallback',
471 474 default=False,
472 475 )
473 476 coreconfigitem('ui', 'clonebundleprefers',
474 477 default=list,
475 478 )
476 479 coreconfigitem('ui', 'clonebundles',
477 480 default=True,
478 481 )
479 482 coreconfigitem('ui', 'color',
480 483 default='auto',
481 484 )
482 485 coreconfigitem('ui', 'commitsubrepos',
483 486 default=False,
484 487 )
485 488 coreconfigitem('ui', 'debug',
486 489 default=False,
487 490 )
488 491 coreconfigitem('ui', 'debugger',
489 492 default=None,
490 493 )
491 494 coreconfigitem('ui', 'fallbackencoding',
492 495 default=None,
493 496 )
494 497 coreconfigitem('ui', 'forcecwd',
495 498 default=None,
496 499 )
497 500 coreconfigitem('ui', 'forcemerge',
498 501 default=None,
499 502 )
500 503 coreconfigitem('ui', 'formatdebug',
501 504 default=False,
502 505 )
503 506 coreconfigitem('ui', 'formatjson',
504 507 default=False,
505 508 )
506 509 coreconfigitem('ui', 'formatted',
507 510 default=None,
508 511 )
509 512 coreconfigitem('ui', 'graphnodetemplate',
510 513 default=None,
511 514 )
512 515 coreconfigitem('ui', 'http2debuglevel',
513 516 default=None,
514 517 )
515 518 coreconfigitem('ui', 'interactive',
516 519 default=None,
517 520 )
518 521 coreconfigitem('ui', 'interface',
519 522 default=None,
520 523 )
521 524 coreconfigitem('ui', 'logblockedtimes',
522 525 default=False,
523 526 )
524 527 coreconfigitem('ui', 'logtemplate',
525 528 default=None,
526 529 )
527 530 coreconfigitem('ui', 'merge',
528 531 default=None,
529 532 )
530 533 coreconfigitem('ui', 'mergemarkers',
531 534 default='basic',
532 535 )
533 536 coreconfigitem('ui', 'mergemarkertemplate',
534 537 default=('{node|short} '
535 538 '{ifeq(tags, "tip", "", '
536 539 'ifeq(tags, "", "", "{tags} "))}'
537 540 '{if(bookmarks, "{bookmarks} ")}'
538 541 '{ifeq(branch, "default", "", "{branch} ")}'
539 542 '- {author|user}: {desc|firstline}')
540 543 )
541 544 coreconfigitem('ui', 'nontty',
542 545 default=False,
543 546 )
544 547 coreconfigitem('ui', 'origbackuppath',
545 548 default=None,
546 549 )
547 550 coreconfigitem('ui', 'paginate',
548 551 default=True,
549 552 )
550 553 coreconfigitem('ui', 'patch',
551 554 default=None,
552 555 )
553 556 coreconfigitem('ui', 'portablefilenames',
554 557 default='warn',
555 558 )
556 559 coreconfigitem('ui', 'promptecho',
557 560 default=False,
558 561 )
559 562 coreconfigitem('ui', 'quiet',
560 563 default=False,
561 564 )
562 565 coreconfigitem('ui', 'quietbookmarkmove',
563 566 default=False,
564 567 )
565 568 coreconfigitem('ui', 'remotecmd',
566 569 default='hg',
567 570 )
568 571 coreconfigitem('ui', 'report_untrusted',
569 572 default=True,
570 573 )
571 574 coreconfigitem('ui', 'rollback',
572 575 default=True,
573 576 )
574 577 coreconfigitem('ui', 'slash',
575 578 default=False,
576 579 )
577 580 coreconfigitem('ui', 'ssh',
578 581 default='ssh',
579 582 )
580 583 coreconfigitem('ui', 'statuscopies',
581 584 default=False,
582 585 )
583 586 coreconfigitem('ui', 'strict',
584 587 default=False,
585 588 )
586 589 coreconfigitem('ui', 'style',
587 590 default='',
588 591 )
589 592 coreconfigitem('ui', 'supportcontact',
590 593 default=None,
591 594 )
592 595 coreconfigitem('ui', 'textwidth',
593 596 default=78,
594 597 )
595 598 coreconfigitem('ui', 'timeout',
596 599 default='600',
597 600 )
598 601 coreconfigitem('ui', 'traceback',
599 602 default=False,
600 603 )
601 604 coreconfigitem('ui', 'tweakdefaults',
602 605 default=False,
603 606 )
604 607 coreconfigitem('ui', 'usehttp2',
605 608 default=False,
606 609 )
607 610 coreconfigitem('ui', 'username',
608 611 alias=[('ui', 'user')]
609 612 )
610 613 coreconfigitem('ui', 'verbose',
611 614 default=False,
612 615 )
613 616 coreconfigitem('verify', 'skipflags',
614 617 default=None,
615 618 )
616 619 coreconfigitem('web', 'accesslog',
617 620 default='-',
618 621 )
619 622 coreconfigitem('web', 'address',
620 623 default='',
621 624 )
622 625 coreconfigitem('web', 'allow_archive',
623 626 default=list,
624 627 )
625 628 coreconfigitem('web', 'allow_read',
626 629 default=list,
627 630 )
628 631 coreconfigitem('web', 'baseurl',
629 632 default=None,
630 633 )
631 634 coreconfigitem('web', 'cacerts',
632 635 default=None,
633 636 )
634 637 coreconfigitem('web', 'certificate',
635 638 default=None,
636 639 )
637 640 coreconfigitem('web', 'collapse',
638 641 default=False,
639 642 )
640 643 coreconfigitem('web', 'csp',
641 644 default=None,
642 645 )
643 646 coreconfigitem('web', 'deny_read',
644 647 default=list,
645 648 )
646 649 coreconfigitem('web', 'descend',
647 650 default=True,
648 651 )
649 652 coreconfigitem('web', 'description',
650 653 default="",
651 654 )
652 655 coreconfigitem('web', 'encoding',
653 656 default=lambda: encoding.encoding,
654 657 )
655 658 coreconfigitem('web', 'errorlog',
656 659 default='-',
657 660 )
658 661 coreconfigitem('web', 'ipv6',
659 662 default=False,
660 663 )
661 664 coreconfigitem('web', 'port',
662 665 default=8000,
663 666 )
664 667 coreconfigitem('web', 'prefix',
665 668 default='',
666 669 )
667 670 coreconfigitem('web', 'refreshinterval',
668 671 default=20,
669 672 )
670 673 coreconfigitem('web', 'stripes',
671 674 default=1,
672 675 )
673 676 coreconfigitem('web', 'style',
674 677 default='paper',
675 678 )
676 679 coreconfigitem('web', 'templates',
677 680 default=None,
678 681 )
679 682 coreconfigitem('worker', 'backgroundclose',
680 683 default=dynamicdefault,
681 684 )
682 685 # Windows defaults to a limit of 512 open files. A buffer of 128
683 686 # should give us enough headway.
684 687 coreconfigitem('worker', 'backgroundclosemaxqueue',
685 688 default=384,
686 689 )
687 690 coreconfigitem('worker', 'backgroundcloseminfilecount',
688 691 default=2048,
689 692 )
690 693 coreconfigitem('worker', 'backgroundclosethreadcount',
691 694 default=4,
692 695 )
693 696 coreconfigitem('worker', 'numcpus',
694 697 default=None,
695 698 )
General Comments 0
You need to be logged in to leave comments. Login now