##// END OF EJS Templates
configitems: register the 'devel.empty-changegroup' config
Boris Feld -
r34527:3999b74b default
parent child Browse files
Show More
@@ -1,752 +1,755 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
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', 'cache-vfs',
120 120 default=None,
121 121 )
122 122 coreconfigitem('devel', 'check-locks',
123 123 default=False,
124 124 )
125 125 coreconfigitem('devel', 'check-relroot',
126 126 default=False,
127 127 )
128 128 coreconfigitem('devel', 'default-date',
129 129 default=None,
130 130 )
131 131 coreconfigitem('devel', 'deprec-warn',
132 132 default=False,
133 133 )
134 134 coreconfigitem('devel', 'disableloaddefaultcerts',
135 135 default=False,
136 136 )
137 coreconfigitem('devel', 'empty-changegroup',
138 default=False,
139 )
137 140 coreconfigitem('devel', 'legacy.exchange',
138 141 default=list,
139 142 )
140 143 coreconfigitem('devel', 'servercafile',
141 144 default='',
142 145 )
143 146 coreconfigitem('devel', 'serverexactprotocol',
144 147 default='',
145 148 )
146 149 coreconfigitem('devel', 'serverrequirecert',
147 150 default=False,
148 151 )
149 152 coreconfigitem('devel', 'strip-obsmarkers',
150 153 default=True,
151 154 )
152 155 coreconfigitem('devel', 'warn-config',
153 156 default=None,
154 157 )
155 158 coreconfigitem('devel', 'warn-config-default',
156 159 default=None,
157 160 )
158 161 coreconfigitem('diff', 'nodates',
159 162 default=None,
160 163 )
161 164 coreconfigitem('diff', 'showfunc',
162 165 default=None,
163 166 )
164 167 coreconfigitem('diff', 'unified',
165 168 default=None,
166 169 )
167 170 coreconfigitem('diff', 'git',
168 171 default=None,
169 172 )
170 173 coreconfigitem('diff', 'ignorews',
171 174 default=None,
172 175 )
173 176 coreconfigitem('diff', 'ignorewsamount',
174 177 default=None,
175 178 )
176 179 coreconfigitem('diff', 'ignoreblanklines',
177 180 default=None,
178 181 )
179 182 coreconfigitem('diff', 'ignorewseol',
180 183 default=None,
181 184 )
182 185 coreconfigitem('diff', 'nobinary',
183 186 default=None,
184 187 )
185 188 coreconfigitem('diff', 'noprefix',
186 189 default=None,
187 190 )
188 191 coreconfigitem('email', 'charsets',
189 192 default=list,
190 193 )
191 194 coreconfigitem('email', 'from',
192 195 default=None,
193 196 )
194 197 coreconfigitem('email', 'method',
195 198 default='smtp',
196 199 )
197 200 coreconfigitem('experimental', 'allowdivergence',
198 201 default=False,
199 202 )
200 203 coreconfigitem('experimental', 'bundle-phases',
201 204 default=False,
202 205 )
203 206 coreconfigitem('experimental', 'bundle2-advertise',
204 207 default=True,
205 208 )
206 209 coreconfigitem('experimental', 'bundle2-output-capture',
207 210 default=False,
208 211 )
209 212 coreconfigitem('experimental', 'bundle2.pushback',
210 213 default=False,
211 214 )
212 215 coreconfigitem('experimental', 'bundle2lazylocking',
213 216 default=False,
214 217 )
215 218 coreconfigitem('experimental', 'bundlecomplevel',
216 219 default=None,
217 220 )
218 221 coreconfigitem('experimental', 'changegroup3',
219 222 default=False,
220 223 )
221 224 coreconfigitem('experimental', 'clientcompressionengines',
222 225 default=list,
223 226 )
224 227 coreconfigitem('experimental', 'copytrace',
225 228 default='on',
226 229 )
227 230 coreconfigitem('experimental', 'copytrace.sourcecommitlimit',
228 231 default=100,
229 232 )
230 233 coreconfigitem('experimental', 'crecordtest',
231 234 default=None,
232 235 )
233 236 coreconfigitem('experimental', 'editortmpinhg',
234 237 default=False,
235 238 )
236 239 coreconfigitem('experimental', 'maxdeltachainspan',
237 240 default=-1,
238 241 )
239 242 coreconfigitem('experimental', 'mmapindexthreshold',
240 243 default=None,
241 244 )
242 245 coreconfigitem('experimental', 'nonnormalparanoidcheck',
243 246 default=False,
244 247 )
245 248 coreconfigitem('experimental', 'stabilization',
246 249 default=list,
247 250 alias=[('experimental', 'evolution')],
248 251 )
249 252 coreconfigitem('experimental', 'stabilization.bundle-obsmarker',
250 253 default=False,
251 254 alias=[('experimental', 'evolution.bundle-obsmarker')],
252 255 )
253 256 coreconfigitem('experimental', 'stabilization.track-operation',
254 257 default=True,
255 258 alias=[('experimental', 'evolution.track-operation')]
256 259 )
257 260 coreconfigitem('experimental', 'exportableenviron',
258 261 default=list,
259 262 )
260 263 coreconfigitem('experimental', 'extendedheader.index',
261 264 default=None,
262 265 )
263 266 coreconfigitem('experimental', 'extendedheader.similarity',
264 267 default=False,
265 268 )
266 269 coreconfigitem('experimental', 'format.compression',
267 270 default='zlib',
268 271 )
269 272 coreconfigitem('experimental', 'graphshorten',
270 273 default=False,
271 274 )
272 275 coreconfigitem('experimental', 'hook-track-tags',
273 276 default=False,
274 277 )
275 278 coreconfigitem('experimental', 'httppostargs',
276 279 default=False,
277 280 )
278 281 coreconfigitem('experimental', 'manifestv2',
279 282 default=False,
280 283 )
281 284 coreconfigitem('experimental', 'mergedriver',
282 285 default=None,
283 286 )
284 287 coreconfigitem('experimental', 'obsmarkers-exchange-debug',
285 288 default=False,
286 289 )
287 290 coreconfigitem('experimental', 'rebase.multidest',
288 291 default=False,
289 292 )
290 293 coreconfigitem('experimental', 'revertalternateinteractivemode',
291 294 default=True,
292 295 )
293 296 coreconfigitem('experimental', 'revlogv2',
294 297 default=None,
295 298 )
296 299 coreconfigitem('experimental', 'spacemovesdown',
297 300 default=False,
298 301 )
299 302 coreconfigitem('experimental', 'treemanifest',
300 303 default=False,
301 304 )
302 305 coreconfigitem('experimental', 'updatecheck',
303 306 default=None,
304 307 )
305 308 coreconfigitem('format', 'aggressivemergedeltas',
306 309 default=False,
307 310 )
308 311 coreconfigitem('format', 'chunkcachesize',
309 312 default=None,
310 313 )
311 314 coreconfigitem('format', 'dotencode',
312 315 default=True,
313 316 )
314 317 coreconfigitem('format', 'generaldelta',
315 318 default=False,
316 319 )
317 320 coreconfigitem('format', 'manifestcachesize',
318 321 default=None,
319 322 )
320 323 coreconfigitem('format', 'maxchainlen',
321 324 default=None,
322 325 )
323 326 coreconfigitem('format', 'obsstore-version',
324 327 default=None,
325 328 )
326 329 coreconfigitem('format', 'usefncache',
327 330 default=True,
328 331 )
329 332 coreconfigitem('format', 'usegeneraldelta',
330 333 default=True,
331 334 )
332 335 coreconfigitem('format', 'usestore',
333 336 default=True,
334 337 )
335 338 coreconfigitem('hostsecurity', 'ciphers',
336 339 default=None,
337 340 )
338 341 coreconfigitem('hostsecurity', 'disabletls10warning',
339 342 default=False,
340 343 )
341 344 coreconfigitem('http_proxy', 'always',
342 345 default=False,
343 346 )
344 347 coreconfigitem('http_proxy', 'host',
345 348 default=None,
346 349 )
347 350 coreconfigitem('http_proxy', 'no',
348 351 default=list,
349 352 )
350 353 coreconfigitem('http_proxy', 'passwd',
351 354 default=None,
352 355 )
353 356 coreconfigitem('http_proxy', 'user',
354 357 default=None,
355 358 )
356 359 coreconfigitem('merge', 'checkunknown',
357 360 default='abort',
358 361 )
359 362 coreconfigitem('merge', 'checkignored',
360 363 default='abort',
361 364 )
362 365 coreconfigitem('merge', 'followcopies',
363 366 default=True,
364 367 )
365 368 coreconfigitem('merge', 'preferancestor',
366 369 default=lambda: ['*'],
367 370 )
368 371 coreconfigitem('pager', 'ignore',
369 372 default=list,
370 373 )
371 374 coreconfigitem('patch', 'eol',
372 375 default='strict',
373 376 )
374 377 coreconfigitem('patch', 'fuzz',
375 378 default=2,
376 379 )
377 380 coreconfigitem('paths', 'default',
378 381 default=None,
379 382 )
380 383 coreconfigitem('paths', 'default-push',
381 384 default=None,
382 385 )
383 386 coreconfigitem('phases', 'checksubrepos',
384 387 default='follow',
385 388 )
386 389 coreconfigitem('phases', 'new-commit',
387 390 default=dynamicdefault,
388 391 )
389 392 coreconfigitem('phases', 'publish',
390 393 default=True,
391 394 )
392 395 coreconfigitem('profiling', 'enabled',
393 396 default=False,
394 397 )
395 398 coreconfigitem('profiling', 'format',
396 399 default='text',
397 400 )
398 401 coreconfigitem('profiling', 'freq',
399 402 default=1000,
400 403 )
401 404 coreconfigitem('profiling', 'limit',
402 405 default=30,
403 406 )
404 407 coreconfigitem('profiling', 'nested',
405 408 default=0,
406 409 )
407 410 coreconfigitem('profiling', 'output',
408 411 default=None,
409 412 )
410 413 coreconfigitem('profiling', 'showmax',
411 414 default=0.999,
412 415 )
413 416 coreconfigitem('profiling', 'showmin',
414 417 default=dynamicdefault,
415 418 )
416 419 coreconfigitem('profiling', 'sort',
417 420 default='inlinetime',
418 421 )
419 422 coreconfigitem('profiling', 'statformat',
420 423 default='hotpath',
421 424 )
422 425 coreconfigitem('profiling', 'type',
423 426 default='stat',
424 427 )
425 428 coreconfigitem('progress', 'assume-tty',
426 429 default=False,
427 430 )
428 431 coreconfigitem('progress', 'changedelay',
429 432 default=1,
430 433 )
431 434 coreconfigitem('progress', 'clear-complete',
432 435 default=True,
433 436 )
434 437 coreconfigitem('progress', 'debug',
435 438 default=False,
436 439 )
437 440 coreconfigitem('progress', 'delay',
438 441 default=3,
439 442 )
440 443 coreconfigitem('progress', 'disable',
441 444 default=False,
442 445 )
443 446 coreconfigitem('progress', 'estimateinterval',
444 447 default=60.0,
445 448 )
446 449 coreconfigitem('progress', 'refresh',
447 450 default=0.1,
448 451 )
449 452 coreconfigitem('progress', 'width',
450 453 default=dynamicdefault,
451 454 )
452 455 coreconfigitem('push', 'pushvars.server',
453 456 default=False,
454 457 )
455 458 coreconfigitem('server', 'bundle1',
456 459 default=True,
457 460 )
458 461 coreconfigitem('server', 'bundle1gd',
459 462 default=None,
460 463 )
461 464 coreconfigitem('server', 'compressionengines',
462 465 default=list,
463 466 )
464 467 coreconfigitem('server', 'concurrent-push-mode',
465 468 default='strict',
466 469 )
467 470 coreconfigitem('server', 'disablefullbundle',
468 471 default=False,
469 472 )
470 473 coreconfigitem('server', 'maxhttpheaderlen',
471 474 default=1024,
472 475 )
473 476 coreconfigitem('server', 'preferuncompressed',
474 477 default=False,
475 478 )
476 479 coreconfigitem('server', 'uncompressed',
477 480 default=True,
478 481 )
479 482 coreconfigitem('server', 'uncompressedallowsecret',
480 483 default=False,
481 484 )
482 485 coreconfigitem('server', 'validate',
483 486 default=False,
484 487 )
485 488 coreconfigitem('server', 'zliblevel',
486 489 default=-1,
487 490 )
488 491 coreconfigitem('smtp', 'host',
489 492 default=None,
490 493 )
491 494 coreconfigitem('smtp', 'local_hostname',
492 495 default=None,
493 496 )
494 497 coreconfigitem('smtp', 'password',
495 498 default=None,
496 499 )
497 500 coreconfigitem('smtp', 'port',
498 501 default=dynamicdefault,
499 502 )
500 503 coreconfigitem('smtp', 'tls',
501 504 default='none',
502 505 )
503 506 coreconfigitem('smtp', 'username',
504 507 default=None,
505 508 )
506 509 coreconfigitem('sparse', 'missingwarning',
507 510 default=True,
508 511 )
509 512 coreconfigitem('trusted', 'groups',
510 513 default=list,
511 514 )
512 515 coreconfigitem('trusted', 'users',
513 516 default=list,
514 517 )
515 518 coreconfigitem('ui', '_usedassubrepo',
516 519 default=False,
517 520 )
518 521 coreconfigitem('ui', 'allowemptycommit',
519 522 default=False,
520 523 )
521 524 coreconfigitem('ui', 'archivemeta',
522 525 default=True,
523 526 )
524 527 coreconfigitem('ui', 'askusername',
525 528 default=False,
526 529 )
527 530 coreconfigitem('ui', 'clonebundlefallback',
528 531 default=False,
529 532 )
530 533 coreconfigitem('ui', 'clonebundleprefers',
531 534 default=list,
532 535 )
533 536 coreconfigitem('ui', 'clonebundles',
534 537 default=True,
535 538 )
536 539 coreconfigitem('ui', 'color',
537 540 default='auto',
538 541 )
539 542 coreconfigitem('ui', 'commitsubrepos',
540 543 default=False,
541 544 )
542 545 coreconfigitem('ui', 'debug',
543 546 default=False,
544 547 )
545 548 coreconfigitem('ui', 'debugger',
546 549 default=None,
547 550 )
548 551 coreconfigitem('ui', 'fallbackencoding',
549 552 default=None,
550 553 )
551 554 coreconfigitem('ui', 'forcecwd',
552 555 default=None,
553 556 )
554 557 coreconfigitem('ui', 'forcemerge',
555 558 default=None,
556 559 )
557 560 coreconfigitem('ui', 'formatdebug',
558 561 default=False,
559 562 )
560 563 coreconfigitem('ui', 'formatjson',
561 564 default=False,
562 565 )
563 566 coreconfigitem('ui', 'formatted',
564 567 default=None,
565 568 )
566 569 coreconfigitem('ui', 'graphnodetemplate',
567 570 default=None,
568 571 )
569 572 coreconfigitem('ui', 'http2debuglevel',
570 573 default=None,
571 574 )
572 575 coreconfigitem('ui', 'interactive',
573 576 default=None,
574 577 )
575 578 coreconfigitem('ui', 'interface',
576 579 default=None,
577 580 )
578 581 coreconfigitem('ui', 'logblockedtimes',
579 582 default=False,
580 583 )
581 584 coreconfigitem('ui', 'logtemplate',
582 585 default=None,
583 586 )
584 587 coreconfigitem('ui', 'merge',
585 588 default=None,
586 589 )
587 590 coreconfigitem('ui', 'mergemarkers',
588 591 default='basic',
589 592 )
590 593 coreconfigitem('ui', 'mergemarkertemplate',
591 594 default=('{node|short} '
592 595 '{ifeq(tags, "tip", "", '
593 596 'ifeq(tags, "", "", "{tags} "))}'
594 597 '{if(bookmarks, "{bookmarks} ")}'
595 598 '{ifeq(branch, "default", "", "{branch} ")}'
596 599 '- {author|user}: {desc|firstline}')
597 600 )
598 601 coreconfigitem('ui', 'nontty',
599 602 default=False,
600 603 )
601 604 coreconfigitem('ui', 'origbackuppath',
602 605 default=None,
603 606 )
604 607 coreconfigitem('ui', 'paginate',
605 608 default=True,
606 609 )
607 610 coreconfigitem('ui', 'patch',
608 611 default=None,
609 612 )
610 613 coreconfigitem('ui', 'portablefilenames',
611 614 default='warn',
612 615 )
613 616 coreconfigitem('ui', 'promptecho',
614 617 default=False,
615 618 )
616 619 coreconfigitem('ui', 'quiet',
617 620 default=False,
618 621 )
619 622 coreconfigitem('ui', 'quietbookmarkmove',
620 623 default=False,
621 624 )
622 625 coreconfigitem('ui', 'remotecmd',
623 626 default='hg',
624 627 )
625 628 coreconfigitem('ui', 'report_untrusted',
626 629 default=True,
627 630 )
628 631 coreconfigitem('ui', 'rollback',
629 632 default=True,
630 633 )
631 634 coreconfigitem('ui', 'slash',
632 635 default=False,
633 636 )
634 637 coreconfigitem('ui', 'ssh',
635 638 default='ssh',
636 639 )
637 640 coreconfigitem('ui', 'statuscopies',
638 641 default=False,
639 642 )
640 643 coreconfigitem('ui', 'strict',
641 644 default=False,
642 645 )
643 646 coreconfigitem('ui', 'style',
644 647 default='',
645 648 )
646 649 coreconfigitem('ui', 'supportcontact',
647 650 default=None,
648 651 )
649 652 coreconfigitem('ui', 'textwidth',
650 653 default=78,
651 654 )
652 655 coreconfigitem('ui', 'timeout',
653 656 default='600',
654 657 )
655 658 coreconfigitem('ui', 'traceback',
656 659 default=False,
657 660 )
658 661 coreconfigitem('ui', 'tweakdefaults',
659 662 default=False,
660 663 )
661 664 coreconfigitem('ui', 'usehttp2',
662 665 default=False,
663 666 )
664 667 coreconfigitem('ui', 'username',
665 668 alias=[('ui', 'user')]
666 669 )
667 670 coreconfigitem('ui', 'verbose',
668 671 default=False,
669 672 )
670 673 coreconfigitem('verify', 'skipflags',
671 674 default=None,
672 675 )
673 676 coreconfigitem('web', 'accesslog',
674 677 default='-',
675 678 )
676 679 coreconfigitem('web', 'address',
677 680 default='',
678 681 )
679 682 coreconfigitem('web', 'allow_archive',
680 683 default=list,
681 684 )
682 685 coreconfigitem('web', 'allow_read',
683 686 default=list,
684 687 )
685 688 coreconfigitem('web', 'baseurl',
686 689 default=None,
687 690 )
688 691 coreconfigitem('web', 'cacerts',
689 692 default=None,
690 693 )
691 694 coreconfigitem('web', 'certificate',
692 695 default=None,
693 696 )
694 697 coreconfigitem('web', 'collapse',
695 698 default=False,
696 699 )
697 700 coreconfigitem('web', 'csp',
698 701 default=None,
699 702 )
700 703 coreconfigitem('web', 'deny_read',
701 704 default=list,
702 705 )
703 706 coreconfigitem('web', 'descend',
704 707 default=True,
705 708 )
706 709 coreconfigitem('web', 'description',
707 710 default="",
708 711 )
709 712 coreconfigitem('web', 'encoding',
710 713 default=lambda: encoding.encoding,
711 714 )
712 715 coreconfigitem('web', 'errorlog',
713 716 default='-',
714 717 )
715 718 coreconfigitem('web', 'ipv6',
716 719 default=False,
717 720 )
718 721 coreconfigitem('web', 'port',
719 722 default=8000,
720 723 )
721 724 coreconfigitem('web', 'prefix',
722 725 default='',
723 726 )
724 727 coreconfigitem('web', 'refreshinterval',
725 728 default=20,
726 729 )
727 730 coreconfigitem('web', 'stripes',
728 731 default=1,
729 732 )
730 733 coreconfigitem('web', 'style',
731 734 default='paper',
732 735 )
733 736 coreconfigitem('web', 'templates',
734 737 default=None,
735 738 )
736 739 coreconfigitem('worker', 'backgroundclose',
737 740 default=dynamicdefault,
738 741 )
739 742 # Windows defaults to a limit of 512 open files. A buffer of 128
740 743 # should give us enough headway.
741 744 coreconfigitem('worker', 'backgroundclosemaxqueue',
742 745 default=384,
743 746 )
744 747 coreconfigitem('worker', 'backgroundcloseminfilecount',
745 748 default=2048,
746 749 )
747 750 coreconfigitem('worker', 'backgroundclosethreadcount',
748 751 default=4,
749 752 )
750 753 coreconfigitem('worker', 'numcpus',
751 754 default=None,
752 755 )
General Comments 0
You need to be logged in to leave comments. Login now