##// END OF EJS Templates
repoview: add a 'devel.debug.repo-filter' option...
marmoute -
r44141:0ddd97e4 default draft
parent child Browse files
Show More
@@ -1,1543 +1,1546
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, configprefix + b'nodates', default=False,
137 137 )
138 138 coreconfigitem(
139 139 section, configprefix + b'showfunc', default=False,
140 140 )
141 141 coreconfigitem(
142 142 section, configprefix + b'unified', default=None,
143 143 )
144 144 coreconfigitem(
145 145 section, configprefix + b'git', default=False,
146 146 )
147 147 coreconfigitem(
148 148 section, configprefix + b'ignorews', default=False,
149 149 )
150 150 coreconfigitem(
151 151 section, configprefix + b'ignorewsamount', default=False,
152 152 )
153 153 coreconfigitem(
154 154 section, configprefix + b'ignoreblanklines', default=False,
155 155 )
156 156 coreconfigitem(
157 157 section, configprefix + b'ignorewseol', default=False,
158 158 )
159 159 coreconfigitem(
160 160 section, configprefix + b'nobinary', default=False,
161 161 )
162 162 coreconfigitem(
163 163 section, configprefix + b'noprefix', default=False,
164 164 )
165 165 coreconfigitem(
166 166 section, configprefix + b'word-diff', default=False,
167 167 )
168 168
169 169
170 170 coreconfigitem(
171 171 b'alias', b'.*', default=dynamicdefault, generic=True,
172 172 )
173 173 coreconfigitem(
174 174 b'auth', b'cookiefile', default=None,
175 175 )
176 176 _registerdiffopts(section=b'annotate')
177 177 # bookmarks.pushing: internal hack for discovery
178 178 coreconfigitem(
179 179 b'bookmarks', b'pushing', default=list,
180 180 )
181 181 # bundle.mainreporoot: internal hack for bundlerepo
182 182 coreconfigitem(
183 183 b'bundle', b'mainreporoot', default=b'',
184 184 )
185 185 coreconfigitem(
186 186 b'censor', b'policy', default=b'abort', experimental=True,
187 187 )
188 188 coreconfigitem(
189 189 b'chgserver', b'idletimeout', default=3600,
190 190 )
191 191 coreconfigitem(
192 192 b'chgserver', b'skiphash', default=False,
193 193 )
194 194 coreconfigitem(
195 195 b'cmdserver', b'log', default=None,
196 196 )
197 197 coreconfigitem(
198 198 b'cmdserver', b'max-log-files', default=7,
199 199 )
200 200 coreconfigitem(
201 201 b'cmdserver', b'max-log-size', default=b'1 MB',
202 202 )
203 203 coreconfigitem(
204 204 b'cmdserver', b'max-repo-cache', default=0, experimental=True,
205 205 )
206 206 coreconfigitem(
207 207 b'cmdserver', b'message-encodings', default=list, experimental=True,
208 208 )
209 209 coreconfigitem(
210 210 b'cmdserver',
211 211 b'track-log',
212 212 default=lambda: [b'chgserver', b'cmdserver', b'repocache'],
213 213 )
214 214 coreconfigitem(
215 215 b'color', b'.*', default=None, generic=True,
216 216 )
217 217 coreconfigitem(
218 218 b'color', b'mode', default=b'auto',
219 219 )
220 220 coreconfigitem(
221 221 b'color', b'pagermode', default=dynamicdefault,
222 222 )
223 223 _registerdiffopts(section=b'commands', configprefix=b'commit.interactive.')
224 224 coreconfigitem(
225 225 b'commands', b'commit.post-status', default=False,
226 226 )
227 227 coreconfigitem(
228 228 b'commands', b'grep.all-files', default=False, experimental=True,
229 229 )
230 230 coreconfigitem(
231 231 b'commands', b'push.require-revs', default=False,
232 232 )
233 233 coreconfigitem(
234 234 b'commands', b'resolve.confirm', default=False,
235 235 )
236 236 coreconfigitem(
237 237 b'commands', b'resolve.explicit-re-merge', default=False,
238 238 )
239 239 coreconfigitem(
240 240 b'commands', b'resolve.mark-check', default=b'none',
241 241 )
242 242 _registerdiffopts(section=b'commands', configprefix=b'revert.interactive.')
243 243 coreconfigitem(
244 244 b'commands', b'show.aliasprefix', default=list,
245 245 )
246 246 coreconfigitem(
247 247 b'commands', b'status.relative', default=False,
248 248 )
249 249 coreconfigitem(
250 250 b'commands', b'status.skipstates', default=[], experimental=True,
251 251 )
252 252 coreconfigitem(
253 253 b'commands', b'status.terse', default=b'',
254 254 )
255 255 coreconfigitem(
256 256 b'commands', b'status.verbose', default=False,
257 257 )
258 258 coreconfigitem(
259 259 b'commands', b'update.check', default=None,
260 260 )
261 261 coreconfigitem(
262 262 b'commands', b'update.requiredest', default=False,
263 263 )
264 264 coreconfigitem(
265 265 b'committemplate', b'.*', default=None, generic=True,
266 266 )
267 267 coreconfigitem(
268 268 b'convert', b'bzr.saverev', default=True,
269 269 )
270 270 coreconfigitem(
271 271 b'convert', b'cvsps.cache', default=True,
272 272 )
273 273 coreconfigitem(
274 274 b'convert', b'cvsps.fuzz', default=60,
275 275 )
276 276 coreconfigitem(
277 277 b'convert', b'cvsps.logencoding', default=None,
278 278 )
279 279 coreconfigitem(
280 280 b'convert', b'cvsps.mergefrom', default=None,
281 281 )
282 282 coreconfigitem(
283 283 b'convert', b'cvsps.mergeto', default=None,
284 284 )
285 285 coreconfigitem(
286 286 b'convert', b'git.committeractions', default=lambda: [b'messagedifferent'],
287 287 )
288 288 coreconfigitem(
289 289 b'convert', b'git.extrakeys', default=list,
290 290 )
291 291 coreconfigitem(
292 292 b'convert', b'git.findcopiesharder', default=False,
293 293 )
294 294 coreconfigitem(
295 295 b'convert', b'git.remoteprefix', default=b'remote',
296 296 )
297 297 coreconfigitem(
298 298 b'convert', b'git.renamelimit', default=400,
299 299 )
300 300 coreconfigitem(
301 301 b'convert', b'git.saverev', default=True,
302 302 )
303 303 coreconfigitem(
304 304 b'convert', b'git.similarity', default=50,
305 305 )
306 306 coreconfigitem(
307 307 b'convert', b'git.skipsubmodules', default=False,
308 308 )
309 309 coreconfigitem(
310 310 b'convert', b'hg.clonebranches', default=False,
311 311 )
312 312 coreconfigitem(
313 313 b'convert', b'hg.ignoreerrors', default=False,
314 314 )
315 315 coreconfigitem(
316 316 b'convert', b'hg.preserve-hash', default=False,
317 317 )
318 318 coreconfigitem(
319 319 b'convert', b'hg.revs', default=None,
320 320 )
321 321 coreconfigitem(
322 322 b'convert', b'hg.saverev', default=False,
323 323 )
324 324 coreconfigitem(
325 325 b'convert', b'hg.sourcename', default=None,
326 326 )
327 327 coreconfigitem(
328 328 b'convert', b'hg.startrev', default=None,
329 329 )
330 330 coreconfigitem(
331 331 b'convert', b'hg.tagsbranch', default=b'default',
332 332 )
333 333 coreconfigitem(
334 334 b'convert', b'hg.usebranchnames', default=True,
335 335 )
336 336 coreconfigitem(
337 337 b'convert', b'ignoreancestorcheck', default=False, experimental=True,
338 338 )
339 339 coreconfigitem(
340 340 b'convert', b'localtimezone', default=False,
341 341 )
342 342 coreconfigitem(
343 343 b'convert', b'p4.encoding', default=dynamicdefault,
344 344 )
345 345 coreconfigitem(
346 346 b'convert', b'p4.startrev', default=0,
347 347 )
348 348 coreconfigitem(
349 349 b'convert', b'skiptags', default=False,
350 350 )
351 351 coreconfigitem(
352 352 b'convert', b'svn.debugsvnlog', default=True,
353 353 )
354 354 coreconfigitem(
355 355 b'convert', b'svn.trunk', default=None,
356 356 )
357 357 coreconfigitem(
358 358 b'convert', b'svn.tags', default=None,
359 359 )
360 360 coreconfigitem(
361 361 b'convert', b'svn.branches', default=None,
362 362 )
363 363 coreconfigitem(
364 364 b'convert', b'svn.startrev', default=0,
365 365 )
366 366 coreconfigitem(
367 367 b'debug', b'dirstate.delaywrite', default=0,
368 368 )
369 369 coreconfigitem(
370 370 b'defaults', b'.*', default=None, generic=True,
371 371 )
372 372 coreconfigitem(
373 373 b'devel', b'all-warnings', default=False,
374 374 )
375 375 coreconfigitem(
376 376 b'devel', b'bundle2.debug', default=False,
377 377 )
378 378 coreconfigitem(
379 379 b'devel', b'bundle.delta', default=b'',
380 380 )
381 381 coreconfigitem(
382 382 b'devel', b'cache-vfs', default=None,
383 383 )
384 384 coreconfigitem(
385 385 b'devel', b'check-locks', default=False,
386 386 )
387 387 coreconfigitem(
388 388 b'devel', b'check-relroot', default=False,
389 389 )
390 390 coreconfigitem(
391 391 b'devel', b'default-date', default=None,
392 392 )
393 393 coreconfigitem(
394 394 b'devel', b'deprec-warn', default=False,
395 395 )
396 396 coreconfigitem(
397 397 b'devel', b'disableloaddefaultcerts', default=False,
398 398 )
399 399 coreconfigitem(
400 400 b'devel', b'warn-empty-changegroup', default=False,
401 401 )
402 402 coreconfigitem(
403 403 b'devel', b'legacy.exchange', default=list,
404 404 )
405 405 coreconfigitem(
406 406 b'devel', b'servercafile', default=b'',
407 407 )
408 408 coreconfigitem(
409 409 b'devel', b'serverexactprotocol', default=b'',
410 410 )
411 411 coreconfigitem(
412 412 b'devel', b'serverrequirecert', default=False,
413 413 )
414 414 coreconfigitem(
415 415 b'devel', b'strip-obsmarkers', default=True,
416 416 )
417 417 coreconfigitem(
418 418 b'devel', b'warn-config', default=None,
419 419 )
420 420 coreconfigitem(
421 421 b'devel', b'warn-config-default', default=None,
422 422 )
423 423 coreconfigitem(
424 424 b'devel', b'user.obsmarker', default=None,
425 425 )
426 426 coreconfigitem(
427 427 b'devel', b'warn-config-unknown', default=None,
428 428 )
429 429 coreconfigitem(
430 430 b'devel', b'debug.copies', default=False,
431 431 )
432 432 coreconfigitem(
433 433 b'devel', b'debug.extensions', default=False,
434 434 )
435 435 coreconfigitem(
436 b'devel', b'debug.repo-filters', default=False,
437 )
438 coreconfigitem(
436 439 b'devel', b'debug.peer-request', default=False,
437 440 )
438 441 coreconfigitem(
439 442 b'devel', b'discovery.randomize', default=True,
440 443 )
441 444 _registerdiffopts(section=b'diff')
442 445 coreconfigitem(
443 446 b'email', b'bcc', default=None,
444 447 )
445 448 coreconfigitem(
446 449 b'email', b'cc', default=None,
447 450 )
448 451 coreconfigitem(
449 452 b'email', b'charsets', default=list,
450 453 )
451 454 coreconfigitem(
452 455 b'email', b'from', default=None,
453 456 )
454 457 coreconfigitem(
455 458 b'email', b'method', default=b'smtp',
456 459 )
457 460 coreconfigitem(
458 461 b'email', b'reply-to', default=None,
459 462 )
460 463 coreconfigitem(
461 464 b'email', b'to', default=None,
462 465 )
463 466 coreconfigitem(
464 467 b'experimental', b'archivemetatemplate', default=dynamicdefault,
465 468 )
466 469 coreconfigitem(
467 470 b'experimental', b'auto-publish', default=b'publish',
468 471 )
469 472 coreconfigitem(
470 473 b'experimental', b'bundle-phases', default=False,
471 474 )
472 475 coreconfigitem(
473 476 b'experimental', b'bundle2-advertise', default=True,
474 477 )
475 478 coreconfigitem(
476 479 b'experimental', b'bundle2-output-capture', default=False,
477 480 )
478 481 coreconfigitem(
479 482 b'experimental', b'bundle2.pushback', default=False,
480 483 )
481 484 coreconfigitem(
482 485 b'experimental', b'bundle2lazylocking', default=False,
483 486 )
484 487 coreconfigitem(
485 488 b'experimental', b'bundlecomplevel', default=None,
486 489 )
487 490 coreconfigitem(
488 491 b'experimental', b'bundlecomplevel.bzip2', default=None,
489 492 )
490 493 coreconfigitem(
491 494 b'experimental', b'bundlecomplevel.gzip', default=None,
492 495 )
493 496 coreconfigitem(
494 497 b'experimental', b'bundlecomplevel.none', default=None,
495 498 )
496 499 coreconfigitem(
497 500 b'experimental', b'bundlecomplevel.zstd', default=None,
498 501 )
499 502 coreconfigitem(
500 503 b'experimental', b'changegroup3', default=False,
501 504 )
502 505 coreconfigitem(
503 506 b'experimental', b'cleanup-as-archived', default=False,
504 507 )
505 508 coreconfigitem(
506 509 b'experimental', b'clientcompressionengines', default=list,
507 510 )
508 511 coreconfigitem(
509 512 b'experimental', b'copytrace', default=b'on',
510 513 )
511 514 coreconfigitem(
512 515 b'experimental', b'copytrace.movecandidateslimit', default=100,
513 516 )
514 517 coreconfigitem(
515 518 b'experimental', b'copytrace.sourcecommitlimit', default=100,
516 519 )
517 520 coreconfigitem(
518 521 b'experimental', b'copies.read-from', default=b"filelog-only",
519 522 )
520 523 coreconfigitem(
521 524 b'experimental', b'copies.write-to', default=b'filelog-only',
522 525 )
523 526 coreconfigitem(
524 527 b'experimental', b'crecordtest', default=None,
525 528 )
526 529 coreconfigitem(
527 530 b'experimental', b'directaccess', default=False,
528 531 )
529 532 coreconfigitem(
530 533 b'experimental', b'directaccess.revnums', default=False,
531 534 )
532 535 coreconfigitem(
533 536 b'experimental', b'editortmpinhg', default=False,
534 537 )
535 538 coreconfigitem(
536 539 b'experimental', b'evolution', default=list,
537 540 )
538 541 coreconfigitem(
539 542 b'experimental',
540 543 b'evolution.allowdivergence',
541 544 default=False,
542 545 alias=[(b'experimental', b'allowdivergence')],
543 546 )
544 547 coreconfigitem(
545 548 b'experimental', b'evolution.allowunstable', default=None,
546 549 )
547 550 coreconfigitem(
548 551 b'experimental', b'evolution.createmarkers', default=None,
549 552 )
550 553 coreconfigitem(
551 554 b'experimental',
552 555 b'evolution.effect-flags',
553 556 default=True,
554 557 alias=[(b'experimental', b'effect-flags')],
555 558 )
556 559 coreconfigitem(
557 560 b'experimental', b'evolution.exchange', default=None,
558 561 )
559 562 coreconfigitem(
560 563 b'experimental', b'evolution.bundle-obsmarker', default=False,
561 564 )
562 565 coreconfigitem(
563 566 b'experimental', b'log.topo', default=False,
564 567 )
565 568 coreconfigitem(
566 569 b'experimental', b'evolution.report-instabilities', default=True,
567 570 )
568 571 coreconfigitem(
569 572 b'experimental', b'evolution.track-operation', default=True,
570 573 )
571 574 # repo-level config to exclude a revset visibility
572 575 #
573 576 # The target use case is to use `share` to expose different subset of the same
574 577 # repository, especially server side. See also `server.view`.
575 578 coreconfigitem(
576 579 b'experimental', b'extra-filter-revs', default=None,
577 580 )
578 581 coreconfigitem(
579 582 b'experimental', b'maxdeltachainspan', default=-1,
580 583 )
581 584 coreconfigitem(
582 585 b'experimental', b'mergetempdirprefix', default=None,
583 586 )
584 587 coreconfigitem(
585 588 b'experimental', b'mmapindexthreshold', default=None,
586 589 )
587 590 coreconfigitem(
588 591 b'experimental', b'narrow', default=False,
589 592 )
590 593 coreconfigitem(
591 594 b'experimental', b'nonnormalparanoidcheck', default=False,
592 595 )
593 596 coreconfigitem(
594 597 b'experimental', b'exportableenviron', default=list,
595 598 )
596 599 coreconfigitem(
597 600 b'experimental', b'extendedheader.index', default=None,
598 601 )
599 602 coreconfigitem(
600 603 b'experimental', b'extendedheader.similarity', default=False,
601 604 )
602 605 coreconfigitem(
603 606 b'experimental', b'graphshorten', default=False,
604 607 )
605 608 coreconfigitem(
606 609 b'experimental', b'graphstyle.parent', default=dynamicdefault,
607 610 )
608 611 coreconfigitem(
609 612 b'experimental', b'graphstyle.missing', default=dynamicdefault,
610 613 )
611 614 coreconfigitem(
612 615 b'experimental', b'graphstyle.grandparent', default=dynamicdefault,
613 616 )
614 617 coreconfigitem(
615 618 b'experimental', b'hook-track-tags', default=False,
616 619 )
617 620 coreconfigitem(
618 621 b'experimental', b'httppeer.advertise-v2', default=False,
619 622 )
620 623 coreconfigitem(
621 624 b'experimental', b'httppeer.v2-encoder-order', default=None,
622 625 )
623 626 coreconfigitem(
624 627 b'experimental', b'httppostargs', default=False,
625 628 )
626 629 coreconfigitem(
627 630 b'experimental', b'mergedriver', default=None,
628 631 )
629 632 coreconfigitem(b'experimental', b'nointerrupt', default=False)
630 633 coreconfigitem(b'experimental', b'nointerrupt-interactiveonly', default=True)
631 634
632 635 coreconfigitem(
633 636 b'experimental', b'obsmarkers-exchange-debug', default=False,
634 637 )
635 638 coreconfigitem(
636 639 b'experimental', b'remotenames', default=False,
637 640 )
638 641 coreconfigitem(
639 642 b'experimental', b'removeemptydirs', default=True,
640 643 )
641 644 coreconfigitem(
642 645 b'experimental', b'revert.interactive.select-to-keep', default=False,
643 646 )
644 647 coreconfigitem(
645 648 b'experimental', b'revisions.prefixhexnode', default=False,
646 649 )
647 650 coreconfigitem(
648 651 b'experimental', b'revlogv2', default=None,
649 652 )
650 653 coreconfigitem(
651 654 b'experimental', b'revisions.disambiguatewithin', default=None,
652 655 )
653 656 coreconfigitem(
654 657 b'experimental', b'server.filesdata.recommended-batch-size', default=50000,
655 658 )
656 659 coreconfigitem(
657 660 b'experimental',
658 661 b'server.manifestdata.recommended-batch-size',
659 662 default=100000,
660 663 )
661 664 coreconfigitem(
662 665 b'experimental', b'server.stream-narrow-clones', default=False,
663 666 )
664 667 coreconfigitem(
665 668 b'experimental', b'single-head-per-branch', default=False,
666 669 )
667 670 coreconfigitem(
668 671 b'experimental',
669 672 b'single-head-per-branch:account-closed-heads',
670 673 default=False,
671 674 )
672 675 coreconfigitem(
673 676 b'experimental', b'sshserver.support-v2', default=False,
674 677 )
675 678 coreconfigitem(
676 679 b'experimental', b'sparse-read', default=False,
677 680 )
678 681 coreconfigitem(
679 682 b'experimental', b'sparse-read.density-threshold', default=0.50,
680 683 )
681 684 coreconfigitem(
682 685 b'experimental', b'sparse-read.min-gap-size', default=b'65K',
683 686 )
684 687 coreconfigitem(
685 688 b'experimental', b'treemanifest', default=False,
686 689 )
687 690 coreconfigitem(
688 691 b'experimental', b'update.atomic-file', default=False,
689 692 )
690 693 coreconfigitem(
691 694 b'experimental', b'sshpeer.advertise-v2', default=False,
692 695 )
693 696 coreconfigitem(
694 697 b'experimental', b'web.apiserver', default=False,
695 698 )
696 699 coreconfigitem(
697 700 b'experimental', b'web.api.http-v2', default=False,
698 701 )
699 702 coreconfigitem(
700 703 b'experimental', b'web.api.debugreflect', default=False,
701 704 )
702 705 coreconfigitem(
703 706 b'experimental', b'worker.wdir-get-thread-safe', default=False,
704 707 )
705 708 coreconfigitem(
706 709 b'experimental', b'xdiff', default=False,
707 710 )
708 711 coreconfigitem(
709 712 b'extensions', b'.*', default=None, generic=True,
710 713 )
711 714 coreconfigitem(
712 715 b'extdata', b'.*', default=None, generic=True,
713 716 )
714 717 coreconfigitem(
715 718 b'format', b'bookmarks-in-store', default=False,
716 719 )
717 720 coreconfigitem(
718 721 b'format', b'chunkcachesize', default=None, experimental=True,
719 722 )
720 723 coreconfigitem(
721 724 b'format', b'dotencode', default=True,
722 725 )
723 726 coreconfigitem(
724 727 b'format', b'generaldelta', default=False, experimental=True,
725 728 )
726 729 coreconfigitem(
727 730 b'format', b'manifestcachesize', default=None, experimental=True,
728 731 )
729 732 coreconfigitem(
730 733 b'format', b'maxchainlen', default=dynamicdefault, experimental=True,
731 734 )
732 735 coreconfigitem(
733 736 b'format', b'obsstore-version', default=None,
734 737 )
735 738 coreconfigitem(
736 739 b'format', b'sparse-revlog', default=True,
737 740 )
738 741 coreconfigitem(
739 742 b'format',
740 743 b'revlog-compression',
741 744 default=b'zlib',
742 745 alias=[(b'experimental', b'format.compression')],
743 746 )
744 747 coreconfigitem(
745 748 b'format', b'usefncache', default=True,
746 749 )
747 750 coreconfigitem(
748 751 b'format', b'usegeneraldelta', default=True,
749 752 )
750 753 coreconfigitem(
751 754 b'format', b'usestore', default=True,
752 755 )
753 756 coreconfigitem(
754 757 b'format',
755 758 b'exp-use-copies-side-data-changeset',
756 759 default=False,
757 760 experimental=True,
758 761 )
759 762 coreconfigitem(
760 763 b'format', b'exp-use-side-data', default=False, experimental=True,
761 764 )
762 765 coreconfigitem(
763 766 b'format', b'internal-phase', default=False, experimental=True,
764 767 )
765 768 coreconfigitem(
766 769 b'fsmonitor', b'warn_when_unused', default=True,
767 770 )
768 771 coreconfigitem(
769 772 b'fsmonitor', b'warn_update_file_count', default=50000,
770 773 )
771 774 coreconfigitem(
772 775 b'help', br'hidden-command\..*', default=False, generic=True,
773 776 )
774 777 coreconfigitem(
775 778 b'help', br'hidden-topic\..*', default=False, generic=True,
776 779 )
777 780 coreconfigitem(
778 781 b'hooks', b'.*', default=dynamicdefault, generic=True,
779 782 )
780 783 coreconfigitem(
781 784 b'hgweb-paths', b'.*', default=list, generic=True,
782 785 )
783 786 coreconfigitem(
784 787 b'hostfingerprints', b'.*', default=list, generic=True,
785 788 )
786 789 coreconfigitem(
787 790 b'hostsecurity', b'ciphers', default=None,
788 791 )
789 792 coreconfigitem(
790 793 b'hostsecurity', b'disabletls10warning', default=False,
791 794 )
792 795 coreconfigitem(
793 796 b'hostsecurity', b'minimumprotocol', default=dynamicdefault,
794 797 )
795 798 coreconfigitem(
796 799 b'hostsecurity',
797 800 b'.*:minimumprotocol$',
798 801 default=dynamicdefault,
799 802 generic=True,
800 803 )
801 804 coreconfigitem(
802 805 b'hostsecurity', b'.*:ciphers$', default=dynamicdefault, generic=True,
803 806 )
804 807 coreconfigitem(
805 808 b'hostsecurity', b'.*:fingerprints$', default=list, generic=True,
806 809 )
807 810 coreconfigitem(
808 811 b'hostsecurity', b'.*:verifycertsfile$', default=None, generic=True,
809 812 )
810 813
811 814 coreconfigitem(
812 815 b'http_proxy', b'always', default=False,
813 816 )
814 817 coreconfigitem(
815 818 b'http_proxy', b'host', default=None,
816 819 )
817 820 coreconfigitem(
818 821 b'http_proxy', b'no', default=list,
819 822 )
820 823 coreconfigitem(
821 824 b'http_proxy', b'passwd', default=None,
822 825 )
823 826 coreconfigitem(
824 827 b'http_proxy', b'user', default=None,
825 828 )
826 829
827 830 coreconfigitem(
828 831 b'http', b'timeout', default=None,
829 832 )
830 833
831 834 coreconfigitem(
832 835 b'logtoprocess', b'commandexception', default=None,
833 836 )
834 837 coreconfigitem(
835 838 b'logtoprocess', b'commandfinish', default=None,
836 839 )
837 840 coreconfigitem(
838 841 b'logtoprocess', b'command', default=None,
839 842 )
840 843 coreconfigitem(
841 844 b'logtoprocess', b'develwarn', default=None,
842 845 )
843 846 coreconfigitem(
844 847 b'logtoprocess', b'uiblocked', default=None,
845 848 )
846 849 coreconfigitem(
847 850 b'merge', b'checkunknown', default=b'abort',
848 851 )
849 852 coreconfigitem(
850 853 b'merge', b'checkignored', default=b'abort',
851 854 )
852 855 coreconfigitem(
853 856 b'experimental', b'merge.checkpathconflicts', default=False,
854 857 )
855 858 coreconfigitem(
856 859 b'merge', b'followcopies', default=True,
857 860 )
858 861 coreconfigitem(
859 862 b'merge', b'on-failure', default=b'continue',
860 863 )
861 864 coreconfigitem(
862 865 b'merge', b'preferancestor', default=lambda: [b'*'], experimental=True,
863 866 )
864 867 coreconfigitem(
865 868 b'merge', b'strict-capability-check', default=False,
866 869 )
867 870 coreconfigitem(
868 871 b'merge-tools', b'.*', default=None, generic=True,
869 872 )
870 873 coreconfigitem(
871 874 b'merge-tools',
872 875 br'.*\.args$',
873 876 default=b"$local $base $other",
874 877 generic=True,
875 878 priority=-1,
876 879 )
877 880 coreconfigitem(
878 881 b'merge-tools', br'.*\.binary$', default=False, generic=True, priority=-1,
879 882 )
880 883 coreconfigitem(
881 884 b'merge-tools', br'.*\.check$', default=list, generic=True, priority=-1,
882 885 )
883 886 coreconfigitem(
884 887 b'merge-tools',
885 888 br'.*\.checkchanged$',
886 889 default=False,
887 890 generic=True,
888 891 priority=-1,
889 892 )
890 893 coreconfigitem(
891 894 b'merge-tools',
892 895 br'.*\.executable$',
893 896 default=dynamicdefault,
894 897 generic=True,
895 898 priority=-1,
896 899 )
897 900 coreconfigitem(
898 901 b'merge-tools', br'.*\.fixeol$', default=False, generic=True, priority=-1,
899 902 )
900 903 coreconfigitem(
901 904 b'merge-tools', br'.*\.gui$', default=False, generic=True, priority=-1,
902 905 )
903 906 coreconfigitem(
904 907 b'merge-tools',
905 908 br'.*\.mergemarkers$',
906 909 default=b'basic',
907 910 generic=True,
908 911 priority=-1,
909 912 )
910 913 coreconfigitem(
911 914 b'merge-tools',
912 915 br'.*\.mergemarkertemplate$',
913 916 default=dynamicdefault, # take from ui.mergemarkertemplate
914 917 generic=True,
915 918 priority=-1,
916 919 )
917 920 coreconfigitem(
918 921 b'merge-tools', br'.*\.priority$', default=0, generic=True, priority=-1,
919 922 )
920 923 coreconfigitem(
921 924 b'merge-tools',
922 925 br'.*\.premerge$',
923 926 default=dynamicdefault,
924 927 generic=True,
925 928 priority=-1,
926 929 )
927 930 coreconfigitem(
928 931 b'merge-tools', br'.*\.symlink$', default=False, generic=True, priority=-1,
929 932 )
930 933 coreconfigitem(
931 934 b'pager', b'attend-.*', default=dynamicdefault, generic=True,
932 935 )
933 936 coreconfigitem(
934 937 b'pager', b'ignore', default=list,
935 938 )
936 939 coreconfigitem(
937 940 b'pager', b'pager', default=dynamicdefault,
938 941 )
939 942 coreconfigitem(
940 943 b'patch', b'eol', default=b'strict',
941 944 )
942 945 coreconfigitem(
943 946 b'patch', b'fuzz', default=2,
944 947 )
945 948 coreconfigitem(
946 949 b'paths', b'default', default=None,
947 950 )
948 951 coreconfigitem(
949 952 b'paths', b'default-push', default=None,
950 953 )
951 954 coreconfigitem(
952 955 b'paths', b'.*', default=None, generic=True,
953 956 )
954 957 coreconfigitem(
955 958 b'phases', b'checksubrepos', default=b'follow',
956 959 )
957 960 coreconfigitem(
958 961 b'phases', b'new-commit', default=b'draft',
959 962 )
960 963 coreconfigitem(
961 964 b'phases', b'publish', default=True,
962 965 )
963 966 coreconfigitem(
964 967 b'profiling', b'enabled', default=False,
965 968 )
966 969 coreconfigitem(
967 970 b'profiling', b'format', default=b'text',
968 971 )
969 972 coreconfigitem(
970 973 b'profiling', b'freq', default=1000,
971 974 )
972 975 coreconfigitem(
973 976 b'profiling', b'limit', default=30,
974 977 )
975 978 coreconfigitem(
976 979 b'profiling', b'nested', default=0,
977 980 )
978 981 coreconfigitem(
979 982 b'profiling', b'output', default=None,
980 983 )
981 984 coreconfigitem(
982 985 b'profiling', b'showmax', default=0.999,
983 986 )
984 987 coreconfigitem(
985 988 b'profiling', b'showmin', default=dynamicdefault,
986 989 )
987 990 coreconfigitem(
988 991 b'profiling', b'showtime', default=True,
989 992 )
990 993 coreconfigitem(
991 994 b'profiling', b'sort', default=b'inlinetime',
992 995 )
993 996 coreconfigitem(
994 997 b'profiling', b'statformat', default=b'hotpath',
995 998 )
996 999 coreconfigitem(
997 1000 b'profiling', b'time-track', default=dynamicdefault,
998 1001 )
999 1002 coreconfigitem(
1000 1003 b'profiling', b'type', default=b'stat',
1001 1004 )
1002 1005 coreconfigitem(
1003 1006 b'progress', b'assume-tty', default=False,
1004 1007 )
1005 1008 coreconfigitem(
1006 1009 b'progress', b'changedelay', default=1,
1007 1010 )
1008 1011 coreconfigitem(
1009 1012 b'progress', b'clear-complete', default=True,
1010 1013 )
1011 1014 coreconfigitem(
1012 1015 b'progress', b'debug', default=False,
1013 1016 )
1014 1017 coreconfigitem(
1015 1018 b'progress', b'delay', default=3,
1016 1019 )
1017 1020 coreconfigitem(
1018 1021 b'progress', b'disable', default=False,
1019 1022 )
1020 1023 coreconfigitem(
1021 1024 b'progress', b'estimateinterval', default=60.0,
1022 1025 )
1023 1026 coreconfigitem(
1024 1027 b'progress',
1025 1028 b'format',
1026 1029 default=lambda: [b'topic', b'bar', b'number', b'estimate'],
1027 1030 )
1028 1031 coreconfigitem(
1029 1032 b'progress', b'refresh', default=0.1,
1030 1033 )
1031 1034 coreconfigitem(
1032 1035 b'progress', b'width', default=dynamicdefault,
1033 1036 )
1034 1037 coreconfigitem(
1035 1038 b'push', b'pushvars.server', default=False,
1036 1039 )
1037 1040 coreconfigitem(
1038 1041 b'rewrite',
1039 1042 b'backup-bundle',
1040 1043 default=True,
1041 1044 alias=[(b'ui', b'history-editing-backup')],
1042 1045 )
1043 1046 coreconfigitem(
1044 1047 b'rewrite', b'update-timestamp', default=False,
1045 1048 )
1046 1049 coreconfigitem(
1047 1050 b'storage', b'new-repo-backend', default=b'revlogv1', experimental=True,
1048 1051 )
1049 1052 coreconfigitem(
1050 1053 b'storage',
1051 1054 b'revlog.optimize-delta-parent-choice',
1052 1055 default=True,
1053 1056 alias=[(b'format', b'aggressivemergedeltas')],
1054 1057 )
1055 1058 coreconfigitem(
1056 1059 b'storage', b'revlog.reuse-external-delta', default=True,
1057 1060 )
1058 1061 coreconfigitem(
1059 1062 b'storage', b'revlog.reuse-external-delta-parent', default=None,
1060 1063 )
1061 1064 coreconfigitem(
1062 1065 b'storage', b'revlog.zlib.level', default=None,
1063 1066 )
1064 1067 coreconfigitem(
1065 1068 b'storage', b'revlog.zstd.level', default=None,
1066 1069 )
1067 1070 coreconfigitem(
1068 1071 b'server', b'bookmarks-pushkey-compat', default=True,
1069 1072 )
1070 1073 coreconfigitem(
1071 1074 b'server', b'bundle1', default=True,
1072 1075 )
1073 1076 coreconfigitem(
1074 1077 b'server', b'bundle1gd', default=None,
1075 1078 )
1076 1079 coreconfigitem(
1077 1080 b'server', b'bundle1.pull', default=None,
1078 1081 )
1079 1082 coreconfigitem(
1080 1083 b'server', b'bundle1gd.pull', default=None,
1081 1084 )
1082 1085 coreconfigitem(
1083 1086 b'server', b'bundle1.push', default=None,
1084 1087 )
1085 1088 coreconfigitem(
1086 1089 b'server', b'bundle1gd.push', default=None,
1087 1090 )
1088 1091 coreconfigitem(
1089 1092 b'server',
1090 1093 b'bundle2.stream',
1091 1094 default=True,
1092 1095 alias=[(b'experimental', b'bundle2.stream')],
1093 1096 )
1094 1097 coreconfigitem(
1095 1098 b'server', b'compressionengines', default=list,
1096 1099 )
1097 1100 coreconfigitem(
1098 1101 b'server', b'concurrent-push-mode', default=b'strict',
1099 1102 )
1100 1103 coreconfigitem(
1101 1104 b'server', b'disablefullbundle', default=False,
1102 1105 )
1103 1106 coreconfigitem(
1104 1107 b'server', b'maxhttpheaderlen', default=1024,
1105 1108 )
1106 1109 coreconfigitem(
1107 1110 b'server', b'pullbundle', default=False,
1108 1111 )
1109 1112 coreconfigitem(
1110 1113 b'server', b'preferuncompressed', default=False,
1111 1114 )
1112 1115 coreconfigitem(
1113 1116 b'server', b'streamunbundle', default=False,
1114 1117 )
1115 1118 coreconfigitem(
1116 1119 b'server', b'uncompressed', default=True,
1117 1120 )
1118 1121 coreconfigitem(
1119 1122 b'server', b'uncompressedallowsecret', default=False,
1120 1123 )
1121 1124 coreconfigitem(
1122 1125 b'server', b'view', default=b'served',
1123 1126 )
1124 1127 coreconfigitem(
1125 1128 b'server', b'validate', default=False,
1126 1129 )
1127 1130 coreconfigitem(
1128 1131 b'server', b'zliblevel', default=-1,
1129 1132 )
1130 1133 coreconfigitem(
1131 1134 b'server', b'zstdlevel', default=3,
1132 1135 )
1133 1136 coreconfigitem(
1134 1137 b'share', b'pool', default=None,
1135 1138 )
1136 1139 coreconfigitem(
1137 1140 b'share', b'poolnaming', default=b'identity',
1138 1141 )
1139 1142 coreconfigitem(
1140 1143 b'shelve', b'maxbackups', default=10,
1141 1144 )
1142 1145 coreconfigitem(
1143 1146 b'smtp', b'host', default=None,
1144 1147 )
1145 1148 coreconfigitem(
1146 1149 b'smtp', b'local_hostname', default=None,
1147 1150 )
1148 1151 coreconfigitem(
1149 1152 b'smtp', b'password', default=None,
1150 1153 )
1151 1154 coreconfigitem(
1152 1155 b'smtp', b'port', default=dynamicdefault,
1153 1156 )
1154 1157 coreconfigitem(
1155 1158 b'smtp', b'tls', default=b'none',
1156 1159 )
1157 1160 coreconfigitem(
1158 1161 b'smtp', b'username', default=None,
1159 1162 )
1160 1163 coreconfigitem(
1161 1164 b'sparse', b'missingwarning', default=True, experimental=True,
1162 1165 )
1163 1166 coreconfigitem(
1164 1167 b'subrepos',
1165 1168 b'allowed',
1166 1169 default=dynamicdefault, # to make backporting simpler
1167 1170 )
1168 1171 coreconfigitem(
1169 1172 b'subrepos', b'hg:allowed', default=dynamicdefault,
1170 1173 )
1171 1174 coreconfigitem(
1172 1175 b'subrepos', b'git:allowed', default=dynamicdefault,
1173 1176 )
1174 1177 coreconfigitem(
1175 1178 b'subrepos', b'svn:allowed', default=dynamicdefault,
1176 1179 )
1177 1180 coreconfigitem(
1178 1181 b'templates', b'.*', default=None, generic=True,
1179 1182 )
1180 1183 coreconfigitem(
1181 1184 b'templateconfig', b'.*', default=dynamicdefault, generic=True,
1182 1185 )
1183 1186 coreconfigitem(
1184 1187 b'trusted', b'groups', default=list,
1185 1188 )
1186 1189 coreconfigitem(
1187 1190 b'trusted', b'users', default=list,
1188 1191 )
1189 1192 coreconfigitem(
1190 1193 b'ui', b'_usedassubrepo', default=False,
1191 1194 )
1192 1195 coreconfigitem(
1193 1196 b'ui', b'allowemptycommit', default=False,
1194 1197 )
1195 1198 coreconfigitem(
1196 1199 b'ui', b'archivemeta', default=True,
1197 1200 )
1198 1201 coreconfigitem(
1199 1202 b'ui', b'askusername', default=False,
1200 1203 )
1201 1204 coreconfigitem(
1202 1205 b'ui', b'clonebundlefallback', default=False,
1203 1206 )
1204 1207 coreconfigitem(
1205 1208 b'ui', b'clonebundleprefers', default=list,
1206 1209 )
1207 1210 coreconfigitem(
1208 1211 b'ui', b'clonebundles', default=True,
1209 1212 )
1210 1213 coreconfigitem(
1211 1214 b'ui', b'color', default=b'auto',
1212 1215 )
1213 1216 coreconfigitem(
1214 1217 b'ui', b'commitsubrepos', default=False,
1215 1218 )
1216 1219 coreconfigitem(
1217 1220 b'ui', b'debug', default=False,
1218 1221 )
1219 1222 coreconfigitem(
1220 1223 b'ui', b'debugger', default=None,
1221 1224 )
1222 1225 coreconfigitem(
1223 1226 b'ui', b'editor', default=dynamicdefault,
1224 1227 )
1225 1228 coreconfigitem(
1226 1229 b'ui', b'fallbackencoding', default=None,
1227 1230 )
1228 1231 coreconfigitem(
1229 1232 b'ui', b'forcecwd', default=None,
1230 1233 )
1231 1234 coreconfigitem(
1232 1235 b'ui', b'forcemerge', default=None,
1233 1236 )
1234 1237 coreconfigitem(
1235 1238 b'ui', b'formatdebug', default=False,
1236 1239 )
1237 1240 coreconfigitem(
1238 1241 b'ui', b'formatjson', default=False,
1239 1242 )
1240 1243 coreconfigitem(
1241 1244 b'ui', b'formatted', default=None,
1242 1245 )
1243 1246 coreconfigitem(
1244 1247 b'ui', b'graphnodetemplate', default=None,
1245 1248 )
1246 1249 coreconfigitem(
1247 1250 b'ui', b'interactive', default=None,
1248 1251 )
1249 1252 coreconfigitem(
1250 1253 b'ui', b'interface', default=None,
1251 1254 )
1252 1255 coreconfigitem(
1253 1256 b'ui', b'interface.chunkselector', default=None,
1254 1257 )
1255 1258 coreconfigitem(
1256 1259 b'ui', b'large-file-limit', default=10000000,
1257 1260 )
1258 1261 coreconfigitem(
1259 1262 b'ui', b'logblockedtimes', default=False,
1260 1263 )
1261 1264 coreconfigitem(
1262 1265 b'ui', b'logtemplate', default=None,
1263 1266 )
1264 1267 coreconfigitem(
1265 1268 b'ui', b'merge', default=None,
1266 1269 )
1267 1270 coreconfigitem(
1268 1271 b'ui', b'mergemarkers', default=b'basic',
1269 1272 )
1270 1273 coreconfigitem(
1271 1274 b'ui',
1272 1275 b'mergemarkertemplate',
1273 1276 default=(
1274 1277 b'{node|short} '
1275 1278 b'{ifeq(tags, "tip", "", '
1276 1279 b'ifeq(tags, "", "", "{tags} "))}'
1277 1280 b'{if(bookmarks, "{bookmarks} ")}'
1278 1281 b'{ifeq(branch, "default", "", "{branch} ")}'
1279 1282 b'- {author|user}: {desc|firstline}'
1280 1283 ),
1281 1284 )
1282 1285 coreconfigitem(
1283 1286 b'ui', b'message-output', default=b'stdio',
1284 1287 )
1285 1288 coreconfigitem(
1286 1289 b'ui', b'nontty', default=False,
1287 1290 )
1288 1291 coreconfigitem(
1289 1292 b'ui', b'origbackuppath', default=None,
1290 1293 )
1291 1294 coreconfigitem(
1292 1295 b'ui', b'paginate', default=True,
1293 1296 )
1294 1297 coreconfigitem(
1295 1298 b'ui', b'patch', default=None,
1296 1299 )
1297 1300 coreconfigitem(
1298 1301 b'ui', b'pre-merge-tool-output-template', default=None,
1299 1302 )
1300 1303 coreconfigitem(
1301 1304 b'ui', b'portablefilenames', default=b'warn',
1302 1305 )
1303 1306 coreconfigitem(
1304 1307 b'ui', b'promptecho', default=False,
1305 1308 )
1306 1309 coreconfigitem(
1307 1310 b'ui', b'quiet', default=False,
1308 1311 )
1309 1312 coreconfigitem(
1310 1313 b'ui', b'quietbookmarkmove', default=False,
1311 1314 )
1312 1315 coreconfigitem(
1313 1316 b'ui', b'relative-paths', default=b'legacy',
1314 1317 )
1315 1318 coreconfigitem(
1316 1319 b'ui', b'remotecmd', default=b'hg',
1317 1320 )
1318 1321 coreconfigitem(
1319 1322 b'ui', b'report_untrusted', default=True,
1320 1323 )
1321 1324 coreconfigitem(
1322 1325 b'ui', b'rollback', default=True,
1323 1326 )
1324 1327 coreconfigitem(
1325 1328 b'ui', b'signal-safe-lock', default=True,
1326 1329 )
1327 1330 coreconfigitem(
1328 1331 b'ui', b'slash', default=False,
1329 1332 )
1330 1333 coreconfigitem(
1331 1334 b'ui', b'ssh', default=b'ssh',
1332 1335 )
1333 1336 coreconfigitem(
1334 1337 b'ui', b'ssherrorhint', default=None,
1335 1338 )
1336 1339 coreconfigitem(
1337 1340 b'ui', b'statuscopies', default=False,
1338 1341 )
1339 1342 coreconfigitem(
1340 1343 b'ui', b'strict', default=False,
1341 1344 )
1342 1345 coreconfigitem(
1343 1346 b'ui', b'style', default=b'',
1344 1347 )
1345 1348 coreconfigitem(
1346 1349 b'ui', b'supportcontact', default=None,
1347 1350 )
1348 1351 coreconfigitem(
1349 1352 b'ui', b'textwidth', default=78,
1350 1353 )
1351 1354 coreconfigitem(
1352 1355 b'ui', b'timeout', default=b'600',
1353 1356 )
1354 1357 coreconfigitem(
1355 1358 b'ui', b'timeout.warn', default=0,
1356 1359 )
1357 1360 coreconfigitem(
1358 1361 b'ui', b'traceback', default=False,
1359 1362 )
1360 1363 coreconfigitem(
1361 1364 b'ui', b'tweakdefaults', default=False,
1362 1365 )
1363 1366 coreconfigitem(b'ui', b'username', alias=[(b'ui', b'user')])
1364 1367 coreconfigitem(
1365 1368 b'ui', b'verbose', default=False,
1366 1369 )
1367 1370 coreconfigitem(
1368 1371 b'verify', b'skipflags', default=None,
1369 1372 )
1370 1373 coreconfigitem(
1371 1374 b'web', b'allowbz2', default=False,
1372 1375 )
1373 1376 coreconfigitem(
1374 1377 b'web', b'allowgz', default=False,
1375 1378 )
1376 1379 coreconfigitem(
1377 1380 b'web', b'allow-pull', alias=[(b'web', b'allowpull')], default=True,
1378 1381 )
1379 1382 coreconfigitem(
1380 1383 b'web', b'allow-push', alias=[(b'web', b'allow_push')], default=list,
1381 1384 )
1382 1385 coreconfigitem(
1383 1386 b'web', b'allowzip', default=False,
1384 1387 )
1385 1388 coreconfigitem(
1386 1389 b'web', b'archivesubrepos', default=False,
1387 1390 )
1388 1391 coreconfigitem(
1389 1392 b'web', b'cache', default=True,
1390 1393 )
1391 1394 coreconfigitem(
1392 1395 b'web', b'comparisoncontext', default=5,
1393 1396 )
1394 1397 coreconfigitem(
1395 1398 b'web', b'contact', default=None,
1396 1399 )
1397 1400 coreconfigitem(
1398 1401 b'web', b'deny_push', default=list,
1399 1402 )
1400 1403 coreconfigitem(
1401 1404 b'web', b'guessmime', default=False,
1402 1405 )
1403 1406 coreconfigitem(
1404 1407 b'web', b'hidden', default=False,
1405 1408 )
1406 1409 coreconfigitem(
1407 1410 b'web', b'labels', default=list,
1408 1411 )
1409 1412 coreconfigitem(
1410 1413 b'web', b'logoimg', default=b'hglogo.png',
1411 1414 )
1412 1415 coreconfigitem(
1413 1416 b'web', b'logourl', default=b'https://mercurial-scm.org/',
1414 1417 )
1415 1418 coreconfigitem(
1416 1419 b'web', b'accesslog', default=b'-',
1417 1420 )
1418 1421 coreconfigitem(
1419 1422 b'web', b'address', default=b'',
1420 1423 )
1421 1424 coreconfigitem(
1422 1425 b'web', b'allow-archive', alias=[(b'web', b'allow_archive')], default=list,
1423 1426 )
1424 1427 coreconfigitem(
1425 1428 b'web', b'allow_read', default=list,
1426 1429 )
1427 1430 coreconfigitem(
1428 1431 b'web', b'baseurl', default=None,
1429 1432 )
1430 1433 coreconfigitem(
1431 1434 b'web', b'cacerts', default=None,
1432 1435 )
1433 1436 coreconfigitem(
1434 1437 b'web', b'certificate', default=None,
1435 1438 )
1436 1439 coreconfigitem(
1437 1440 b'web', b'collapse', default=False,
1438 1441 )
1439 1442 coreconfigitem(
1440 1443 b'web', b'csp', default=None,
1441 1444 )
1442 1445 coreconfigitem(
1443 1446 b'web', b'deny_read', default=list,
1444 1447 )
1445 1448 coreconfigitem(
1446 1449 b'web', b'descend', default=True,
1447 1450 )
1448 1451 coreconfigitem(
1449 1452 b'web', b'description', default=b"",
1450 1453 )
1451 1454 coreconfigitem(
1452 1455 b'web', b'encoding', default=lambda: encoding.encoding,
1453 1456 )
1454 1457 coreconfigitem(
1455 1458 b'web', b'errorlog', default=b'-',
1456 1459 )
1457 1460 coreconfigitem(
1458 1461 b'web', b'ipv6', default=False,
1459 1462 )
1460 1463 coreconfigitem(
1461 1464 b'web', b'maxchanges', default=10,
1462 1465 )
1463 1466 coreconfigitem(
1464 1467 b'web', b'maxfiles', default=10,
1465 1468 )
1466 1469 coreconfigitem(
1467 1470 b'web', b'maxshortchanges', default=60,
1468 1471 )
1469 1472 coreconfigitem(
1470 1473 b'web', b'motd', default=b'',
1471 1474 )
1472 1475 coreconfigitem(
1473 1476 b'web', b'name', default=dynamicdefault,
1474 1477 )
1475 1478 coreconfigitem(
1476 1479 b'web', b'port', default=8000,
1477 1480 )
1478 1481 coreconfigitem(
1479 1482 b'web', b'prefix', default=b'',
1480 1483 )
1481 1484 coreconfigitem(
1482 1485 b'web', b'push_ssl', default=True,
1483 1486 )
1484 1487 coreconfigitem(
1485 1488 b'web', b'refreshinterval', default=20,
1486 1489 )
1487 1490 coreconfigitem(
1488 1491 b'web', b'server-header', default=None,
1489 1492 )
1490 1493 coreconfigitem(
1491 1494 b'web', b'static', default=None,
1492 1495 )
1493 1496 coreconfigitem(
1494 1497 b'web', b'staticurl', default=None,
1495 1498 )
1496 1499 coreconfigitem(
1497 1500 b'web', b'stripes', default=1,
1498 1501 )
1499 1502 coreconfigitem(
1500 1503 b'web', b'style', default=b'paper',
1501 1504 )
1502 1505 coreconfigitem(
1503 1506 b'web', b'templates', default=None,
1504 1507 )
1505 1508 coreconfigitem(
1506 1509 b'web', b'view', default=b'served', experimental=True,
1507 1510 )
1508 1511 coreconfigitem(
1509 1512 b'worker', b'backgroundclose', default=dynamicdefault,
1510 1513 )
1511 1514 # Windows defaults to a limit of 512 open files. A buffer of 128
1512 1515 # should give us enough headway.
1513 1516 coreconfigitem(
1514 1517 b'worker', b'backgroundclosemaxqueue', default=384,
1515 1518 )
1516 1519 coreconfigitem(
1517 1520 b'worker', b'backgroundcloseminfilecount', default=2048,
1518 1521 )
1519 1522 coreconfigitem(
1520 1523 b'worker', b'backgroundclosethreadcount', default=4,
1521 1524 )
1522 1525 coreconfigitem(
1523 1526 b'worker', b'enabled', default=True,
1524 1527 )
1525 1528 coreconfigitem(
1526 1529 b'worker', b'numcpus', default=None,
1527 1530 )
1528 1531
1529 1532 # Rebase related configuration moved to core because other extension are doing
1530 1533 # strange things. For example, shelve import the extensions to reuse some bit
1531 1534 # without formally loading it.
1532 1535 coreconfigitem(
1533 1536 b'commands', b'rebase.requiredest', default=False,
1534 1537 )
1535 1538 coreconfigitem(
1536 1539 b'experimental', b'rebaseskipobsolete', default=True,
1537 1540 )
1538 1541 coreconfigitem(
1539 1542 b'rebase', b'singletransaction', default=False,
1540 1543 )
1541 1544 coreconfigitem(
1542 1545 b'rebase', b'experimental.inmemory', default=False,
1543 1546 )
@@ -1,455 +1,458
1 1 # repoview.py - Filtered view of a localrepo object
2 2 #
3 3 # Copyright 2012 Pierre-Yves David <pierre-yves.david@ens-lyon.org>
4 4 # Logilab SA <contact@logilab.fr>
5 5 #
6 6 # This software may be used and distributed according to the terms of the
7 7 # GNU General Public License version 2 or any later version.
8 8
9 9 from __future__ import absolute_import
10 10
11 11 import copy
12 12 import weakref
13 13
14 14 from .i18n import _
15 15 from .node import (
16 16 hex,
17 17 nullrev,
18 18 )
19 19 from .pycompat import (
20 20 delattr,
21 21 getattr,
22 22 setattr,
23 23 )
24 24 from . import (
25 25 error,
26 26 obsolete,
27 27 phases,
28 28 pycompat,
29 29 tags as tagsmod,
30 30 util,
31 31 )
32 32 from .utils import repoviewutil
33 33
34 34
35 35 def hideablerevs(repo):
36 36 """Revision candidates to be hidden
37 37
38 38 This is a standalone function to allow extensions to wrap it.
39 39
40 40 Because we use the set of immutable changesets as a fallback subset in
41 41 branchmap (see mercurial.utils.repoviewutils.subsettable), you cannot set
42 42 "public" changesets as "hideable". Doing so would break multiple code
43 43 assertions and lead to crashes."""
44 44 obsoletes = obsolete.getrevs(repo, b'obsolete')
45 45 internals = repo._phasecache.getrevset(repo, phases.localhiddenphases)
46 46 internals = frozenset(internals)
47 47 return obsoletes | internals
48 48
49 49
50 50 def pinnedrevs(repo):
51 51 """revisions blocking hidden changesets from being filtered
52 52 """
53 53
54 54 cl = repo.changelog
55 55 pinned = set()
56 56 pinned.update([par.rev() for par in repo[None].parents()])
57 57 pinned.update([cl.rev(bm) for bm in repo._bookmarks.values()])
58 58
59 59 tags = {}
60 60 tagsmod.readlocaltags(repo.ui, repo, tags, {})
61 61 if tags:
62 62 rev = cl.index.get_rev
63 63 pinned.update(rev(t[0]) for t in tags.values())
64 64 pinned.discard(None)
65 65 return pinned
66 66
67 67
68 68 def _revealancestors(pfunc, hidden, revs):
69 69 """reveals contiguous chains of hidden ancestors of 'revs' by removing them
70 70 from 'hidden'
71 71
72 72 - pfunc(r): a funtion returning parent of 'r',
73 73 - hidden: the (preliminary) hidden revisions, to be updated
74 74 - revs: iterable of revnum,
75 75
76 76 (Ancestors are revealed exclusively, i.e. the elements in 'revs' are
77 77 *not* revealed)
78 78 """
79 79 stack = list(revs)
80 80 while stack:
81 81 for p in pfunc(stack.pop()):
82 82 if p != nullrev and p in hidden:
83 83 hidden.remove(p)
84 84 stack.append(p)
85 85
86 86
87 87 def computehidden(repo, visibilityexceptions=None):
88 88 """compute the set of hidden revision to filter
89 89
90 90 During most operation hidden should be filtered."""
91 91 assert not repo.changelog.filteredrevs
92 92
93 93 hidden = hideablerevs(repo)
94 94 if hidden:
95 95 hidden = set(hidden - pinnedrevs(repo))
96 96 if visibilityexceptions:
97 97 hidden -= visibilityexceptions
98 98 pfunc = repo.changelog.parentrevs
99 99 mutable = repo._phasecache.getrevset(repo, phases.mutablephases)
100 100
101 101 visible = mutable - hidden
102 102 _revealancestors(pfunc, hidden, visible)
103 103 return frozenset(hidden)
104 104
105 105
106 106 def computesecret(repo, visibilityexceptions=None):
107 107 """compute the set of revision that can never be exposed through hgweb
108 108
109 109 Changeset in the secret phase (or above) should stay unaccessible."""
110 110 assert not repo.changelog.filteredrevs
111 111 secrets = repo._phasecache.getrevset(repo, phases.remotehiddenphases)
112 112 return frozenset(secrets)
113 113
114 114
115 115 def computeunserved(repo, visibilityexceptions=None):
116 116 """compute the set of revision that should be filtered when used a server
117 117
118 118 Secret and hidden changeset should not pretend to be here."""
119 119 assert not repo.changelog.filteredrevs
120 120 # fast path in simple case to avoid impact of non optimised code
121 121 hiddens = filterrevs(repo, b'visible')
122 122 secrets = filterrevs(repo, b'served.hidden')
123 123 if secrets:
124 124 return frozenset(hiddens | secrets)
125 125 else:
126 126 return hiddens
127 127
128 128
129 129 def computemutable(repo, visibilityexceptions=None):
130 130 assert not repo.changelog.filteredrevs
131 131 # fast check to avoid revset call on huge repo
132 132 if any(repo._phasecache.phaseroots[1:]):
133 133 getphase = repo._phasecache.phase
134 134 maymutable = filterrevs(repo, b'base')
135 135 return frozenset(r for r in maymutable if getphase(repo, r))
136 136 return frozenset()
137 137
138 138
139 139 def computeimpactable(repo, visibilityexceptions=None):
140 140 """Everything impactable by mutable revision
141 141
142 142 The immutable filter still have some chance to get invalidated. This will
143 143 happen when:
144 144
145 145 - you garbage collect hidden changeset,
146 146 - public phase is moved backward,
147 147 - something is changed in the filtering (this could be fixed)
148 148
149 149 This filter out any mutable changeset and any public changeset that may be
150 150 impacted by something happening to a mutable revision.
151 151
152 152 This is achieved by filtered everything with a revision number egal or
153 153 higher than the first mutable changeset is filtered."""
154 154 assert not repo.changelog.filteredrevs
155 155 cl = repo.changelog
156 156 firstmutable = len(cl)
157 157 for roots in repo._phasecache.phaseroots[1:]:
158 158 if roots:
159 159 firstmutable = min(firstmutable, min(cl.rev(r) for r in roots))
160 160 # protect from nullrev root
161 161 firstmutable = max(0, firstmutable)
162 162 return frozenset(pycompat.xrange(firstmutable, len(cl)))
163 163
164 164
165 165 # function to compute filtered set
166 166 #
167 167 # When adding a new filter you MUST update the table at:
168 168 # mercurial.utils.repoviewutil.subsettable
169 169 # Otherwise your filter will have to recompute all its branches cache
170 170 # from scratch (very slow).
171 171 filtertable = {
172 172 b'visible': computehidden,
173 173 b'visible-hidden': computehidden,
174 174 b'served.hidden': computesecret,
175 175 b'served': computeunserved,
176 176 b'immutable': computemutable,
177 177 b'base': computeimpactable,
178 178 }
179 179
180 180 _basefiltername = list(filtertable)
181 181
182 182
183 183 def extrafilter(ui):
184 184 """initialize extra filter and return its id
185 185
186 186 If extra filtering is configured, we make sure the associated filtered view
187 187 are declared and return the associated id.
188 188 """
189 189 frevs = ui.config(b'experimental', b'extra-filter-revs')
190 190 if frevs is None:
191 191 return None
192 192
193 193 fid = pycompat.sysbytes(util.DIGESTS[b'sha1'](frevs).hexdigest())[:12]
194 194
195 195 combine = lambda fname: fname + b'%' + fid
196 196
197 197 subsettable = repoviewutil.subsettable
198 198
199 199 if combine(b'base') not in filtertable:
200 200 for name in _basefiltername:
201 201
202 202 def extrafilteredrevs(repo, *args, **kwargs):
203 203 baserevs = filtertable[name](repo, *args, **kwargs)
204 204 extrarevs = frozenset(repo.revs(frevs))
205 205 return baserevs | extrarevs
206 206
207 207 filtertable[combine(name)] = extrafilteredrevs
208 208 if name in subsettable:
209 209 subsettable[combine(name)] = combine(subsettable[name])
210 210 return fid
211 211
212 212
213 213 def filterrevs(repo, filtername, visibilityexceptions=None):
214 214 """returns set of filtered revision for this filter name
215 215
216 216 visibilityexceptions is a set of revs which must are exceptions for
217 217 hidden-state and must be visible. They are dynamic and hence we should not
218 218 cache it's result"""
219 219 if filtername not in repo.filteredrevcache:
220 if repo.ui.configbool(b'devel', b'debug.repo-filters'):
221 msg = b'debug.filters: computing revision filter for "%s"\n'
222 repo.ui.debug(msg % filtername)
220 223 func = filtertable[filtername]
221 224 if visibilityexceptions:
222 225 return func(repo.unfiltered, visibilityexceptions)
223 226 repo.filteredrevcache[filtername] = func(repo.unfiltered())
224 227 return repo.filteredrevcache[filtername]
225 228
226 229
227 230 def wrapchangelog(unfichangelog, filteredrevs):
228 231 cl = copy.copy(unfichangelog)
229 232 cl.filteredrevs = filteredrevs
230 233
231 234 class filteredchangelog(filteredchangelogmixin, cl.__class__):
232 235 pass
233 236
234 237 cl.__class__ = filteredchangelog
235 238
236 239 return cl
237 240
238 241
239 242 class filteredchangelogmixin(object):
240 243 def tiprev(self):
241 244 """filtered version of revlog.tiprev"""
242 245 for i in pycompat.xrange(len(self) - 1, -2, -1):
243 246 if i not in self.filteredrevs:
244 247 return i
245 248
246 249 def __contains__(self, rev):
247 250 """filtered version of revlog.__contains__"""
248 251 return 0 <= rev < len(self) and rev not in self.filteredrevs
249 252
250 253 def __iter__(self):
251 254 """filtered version of revlog.__iter__"""
252 255
253 256 def filterediter():
254 257 for i in pycompat.xrange(len(self)):
255 258 if i not in self.filteredrevs:
256 259 yield i
257 260
258 261 return filterediter()
259 262
260 263 def revs(self, start=0, stop=None):
261 264 """filtered version of revlog.revs"""
262 265 for i in super(filteredchangelogmixin, self).revs(start, stop):
263 266 if i not in self.filteredrevs:
264 267 yield i
265 268
266 269 def _checknofilteredinrevs(self, revs):
267 270 """raise the appropriate error if 'revs' contains a filtered revision
268 271
269 272 This returns a version of 'revs' to be used thereafter by the caller.
270 273 In particular, if revs is an iterator, it is converted into a set.
271 274 """
272 275 safehasattr = util.safehasattr
273 276 if safehasattr(revs, '__next__'):
274 277 # Note that inspect.isgenerator() is not true for iterators,
275 278 revs = set(revs)
276 279
277 280 filteredrevs = self.filteredrevs
278 281 if safehasattr(revs, 'first'): # smartset
279 282 offenders = revs & filteredrevs
280 283 else:
281 284 offenders = filteredrevs.intersection(revs)
282 285
283 286 for rev in offenders:
284 287 raise error.FilteredIndexError(rev)
285 288 return revs
286 289
287 290 def headrevs(self, revs=None):
288 291 if revs is None:
289 292 try:
290 293 return self.index.headrevsfiltered(self.filteredrevs)
291 294 # AttributeError covers non-c-extension environments and
292 295 # old c extensions without filter handling.
293 296 except AttributeError:
294 297 return self._headrevs()
295 298
296 299 revs = self._checknofilteredinrevs(revs)
297 300 return super(filteredchangelogmixin, self).headrevs(revs)
298 301
299 302 def strip(self, *args, **kwargs):
300 303 # XXX make something better than assert
301 304 # We can't expect proper strip behavior if we are filtered.
302 305 assert not self.filteredrevs
303 306 super(filteredchangelogmixin, self).strip(*args, **kwargs)
304 307
305 308 def rev(self, node):
306 309 """filtered version of revlog.rev"""
307 310 r = super(filteredchangelogmixin, self).rev(node)
308 311 if r in self.filteredrevs:
309 312 raise error.FilteredLookupError(
310 313 hex(node), self.indexfile, _(b'filtered node')
311 314 )
312 315 return r
313 316
314 317 def node(self, rev):
315 318 """filtered version of revlog.node"""
316 319 if rev in self.filteredrevs:
317 320 raise error.FilteredIndexError(rev)
318 321 return super(filteredchangelogmixin, self).node(rev)
319 322
320 323 def linkrev(self, rev):
321 324 """filtered version of revlog.linkrev"""
322 325 if rev in self.filteredrevs:
323 326 raise error.FilteredIndexError(rev)
324 327 return super(filteredchangelogmixin, self).linkrev(rev)
325 328
326 329 def parentrevs(self, rev):
327 330 """filtered version of revlog.parentrevs"""
328 331 if rev in self.filteredrevs:
329 332 raise error.FilteredIndexError(rev)
330 333 return super(filteredchangelogmixin, self).parentrevs(rev)
331 334
332 335 def flags(self, rev):
333 336 """filtered version of revlog.flags"""
334 337 if rev in self.filteredrevs:
335 338 raise error.FilteredIndexError(rev)
336 339 return super(filteredchangelogmixin, self).flags(rev)
337 340
338 341
339 342 class repoview(object):
340 343 """Provide a read/write view of a repo through a filtered changelog
341 344
342 345 This object is used to access a filtered version of a repository without
343 346 altering the original repository object itself. We can not alter the
344 347 original object for two main reasons:
345 348 - It prevents the use of a repo with multiple filters at the same time. In
346 349 particular when multiple threads are involved.
347 350 - It makes scope of the filtering harder to control.
348 351
349 352 This object behaves very closely to the original repository. All attribute
350 353 operations are done on the original repository:
351 354 - An access to `repoview.someattr` actually returns `repo.someattr`,
352 355 - A write to `repoview.someattr` actually sets value of `repo.someattr`,
353 356 - A deletion of `repoview.someattr` actually drops `someattr`
354 357 from `repo.__dict__`.
355 358
356 359 The only exception is the `changelog` property. It is overridden to return
357 360 a (surface) copy of `repo.changelog` with some revisions filtered. The
358 361 `filtername` attribute of the view control the revisions that need to be
359 362 filtered. (the fact the changelog is copied is an implementation detail).
360 363
361 364 Unlike attributes, this object intercepts all method calls. This means that
362 365 all methods are run on the `repoview` object with the filtered `changelog`
363 366 property. For this purpose the simple `repoview` class must be mixed with
364 367 the actual class of the repository. This ensures that the resulting
365 368 `repoview` object have the very same methods than the repo object. This
366 369 leads to the property below.
367 370
368 371 repoview.method() --> repo.__class__.method(repoview)
369 372
370 373 The inheritance has to be done dynamically because `repo` can be of any
371 374 subclasses of `localrepo`. Eg: `bundlerepo` or `statichttprepo`.
372 375 """
373 376
374 377 def __init__(self, repo, filtername, visibilityexceptions=None):
375 378 object.__setattr__(self, '_unfilteredrepo', repo)
376 379 object.__setattr__(self, 'filtername', filtername)
377 380 object.__setattr__(self, '_clcachekey', None)
378 381 object.__setattr__(self, '_clcache', None)
379 382 # revs which are exceptions and must not be hidden
380 383 object.__setattr__(self, '_visibilityexceptions', visibilityexceptions)
381 384
382 385 # not a propertycache on purpose we shall implement a proper cache later
383 386 @property
384 387 def changelog(self):
385 388 """return a filtered version of the changeset
386 389
387 390 this changelog must not be used for writing"""
388 391 # some cache may be implemented later
389 392 unfi = self._unfilteredrepo
390 393 unfichangelog = unfi.changelog
391 394 # bypass call to changelog.method
392 395 unfiindex = unfichangelog.index
393 396 unfilen = len(unfiindex)
394 397 unfinode = unfiindex[unfilen - 1][7]
395 398 with util.timedcm('repo filter for %s', self.filtername):
396 399 revs = filterrevs(unfi, self.filtername, self._visibilityexceptions)
397 400 cl = self._clcache
398 401 newkey = (unfilen, unfinode, hash(revs), unfichangelog._delayed)
399 402 # if cl.index is not unfiindex, unfi.changelog would be
400 403 # recreated, and our clcache refers to garbage object
401 404 if cl is not None and (
402 405 cl.index is not unfiindex or newkey != self._clcachekey
403 406 ):
404 407 cl = None
405 408 # could have been made None by the previous if
406 409 if cl is None:
407 410 # Only filter if there's something to filter
408 411 cl = wrapchangelog(unfichangelog, revs) if revs else unfichangelog
409 412 object.__setattr__(self, '_clcache', cl)
410 413 object.__setattr__(self, '_clcachekey', newkey)
411 414 return cl
412 415
413 416 def unfiltered(self):
414 417 """Return an unfiltered version of a repo"""
415 418 return self._unfilteredrepo
416 419
417 420 def filtered(self, name, visibilityexceptions=None):
418 421 """Return a filtered version of a repository"""
419 422 if name == self.filtername and not visibilityexceptions:
420 423 return self
421 424 return self.unfiltered().filtered(name, visibilityexceptions)
422 425
423 426 def __repr__(self):
424 427 return '<%s:%s %r>' % (
425 428 self.__class__.__name__,
426 429 pycompat.sysstr(self.filtername),
427 430 self.unfiltered(),
428 431 )
429 432
430 433 # everything access are forwarded to the proxied repo
431 434 def __getattr__(self, attr):
432 435 return getattr(self._unfilteredrepo, attr)
433 436
434 437 def __setattr__(self, attr, value):
435 438 return setattr(self._unfilteredrepo, attr, value)
436 439
437 440 def __delattr__(self, attr):
438 441 return delattr(self._unfilteredrepo, attr)
439 442
440 443
441 444 # Python <3.4 easily leaks types via __mro__. See
442 445 # https://bugs.python.org/issue17950. We cache dynamically created types
443 446 # so they won't be leaked on every invocation of repo.filtered().
444 447 _filteredrepotypes = weakref.WeakKeyDictionary()
445 448
446 449
447 450 def newtype(base):
448 451 """Create a new type with the repoview mixin and the given base class"""
449 452 if base not in _filteredrepotypes:
450 453
451 454 class filteredrepo(repoview, base):
452 455 pass
453 456
454 457 _filteredrepotypes[base] = filteredrepo
455 458 return _filteredrepotypes[base]
General Comments 0
You need to be logged in to leave comments. Login now