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