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