##// END OF EJS Templates
hgwebdir: avoid systematic full garbage collection...
Georges Racinet -
r48581:de2e04fe default
parent child Browse files
Show More
@@ -0,0 +1,49 b''
1 from __future__ import absolute_import
2
3 import os
4 from mercurial.hgweb import hgwebdir_mod
5
6 hgwebdir = hgwebdir_mod.hgwebdir
7
8 os.mkdir(b'webdir')
9 os.chdir(b'webdir')
10
11 webdir = os.path.realpath(b'.')
12
13
14 def trivial_response(req, res):
15 return []
16
17
18 def make_hgwebdir(gc_rate=None):
19 config = os.path.join(webdir, b'hgwebdir.conf')
20 with open(config, 'wb') as configfile:
21 configfile.write(b'[experimental]\n')
22 if gc_rate is not None:
23 configfile.write(b'web.full-garbage-collection-rate=%d\n' % gc_rate)
24 hg_wd = hgwebdir(config)
25 hg_wd._runwsgi = trivial_response
26 return hg_wd
27
28
29 def process_requests(webdir_instance, number):
30 # we don't care for now about passing realistic arguments
31 for _ in range(number):
32 for chunk in webdir_instance.run_wsgi(None, None):
33 pass
34
35
36 without_gc = make_hgwebdir(gc_rate=0)
37 process_requests(without_gc, 5)
38 assert without_gc.requests_count == 5
39 assert without_gc.gc_full_collections_done == 0
40
41 with_gc = make_hgwebdir(gc_rate=2)
42 process_requests(with_gc, 5)
43 assert with_gc.requests_count == 5
44 assert with_gc.gc_full_collections_done == 2
45
46 with_systematic_gc = make_hgwebdir() # default value of the setting
47 process_requests(with_systematic_gc, 3)
48 assert with_systematic_gc.requests_count == 3
49 assert with_systematic_gc.gc_full_collections_done == 3
@@ -1,2719 +1,2724 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'debug',
583 b'debug',
584 b'revlog.verifyposition.changelog',
584 b'revlog.verifyposition.changelog',
585 default=b'',
585 default=b'',
586 )
586 )
587 coreconfigitem(
587 coreconfigitem(
588 b'defaults',
588 b'defaults',
589 b'.*',
589 b'.*',
590 default=None,
590 default=None,
591 generic=True,
591 generic=True,
592 )
592 )
593 coreconfigitem(
593 coreconfigitem(
594 b'devel',
594 b'devel',
595 b'all-warnings',
595 b'all-warnings',
596 default=False,
596 default=False,
597 )
597 )
598 coreconfigitem(
598 coreconfigitem(
599 b'devel',
599 b'devel',
600 b'bundle2.debug',
600 b'bundle2.debug',
601 default=False,
601 default=False,
602 )
602 )
603 coreconfigitem(
603 coreconfigitem(
604 b'devel',
604 b'devel',
605 b'bundle.delta',
605 b'bundle.delta',
606 default=b'',
606 default=b'',
607 )
607 )
608 coreconfigitem(
608 coreconfigitem(
609 b'devel',
609 b'devel',
610 b'cache-vfs',
610 b'cache-vfs',
611 default=None,
611 default=None,
612 )
612 )
613 coreconfigitem(
613 coreconfigitem(
614 b'devel',
614 b'devel',
615 b'check-locks',
615 b'check-locks',
616 default=False,
616 default=False,
617 )
617 )
618 coreconfigitem(
618 coreconfigitem(
619 b'devel',
619 b'devel',
620 b'check-relroot',
620 b'check-relroot',
621 default=False,
621 default=False,
622 )
622 )
623 # Track copy information for all file, not just "added" one (very slow)
623 # Track copy information for all file, not just "added" one (very slow)
624 coreconfigitem(
624 coreconfigitem(
625 b'devel',
625 b'devel',
626 b'copy-tracing.trace-all-files',
626 b'copy-tracing.trace-all-files',
627 default=False,
627 default=False,
628 )
628 )
629 coreconfigitem(
629 coreconfigitem(
630 b'devel',
630 b'devel',
631 b'default-date',
631 b'default-date',
632 default=None,
632 default=None,
633 )
633 )
634 coreconfigitem(
634 coreconfigitem(
635 b'devel',
635 b'devel',
636 b'deprec-warn',
636 b'deprec-warn',
637 default=False,
637 default=False,
638 )
638 )
639 coreconfigitem(
639 coreconfigitem(
640 b'devel',
640 b'devel',
641 b'disableloaddefaultcerts',
641 b'disableloaddefaultcerts',
642 default=False,
642 default=False,
643 )
643 )
644 coreconfigitem(
644 coreconfigitem(
645 b'devel',
645 b'devel',
646 b'warn-empty-changegroup',
646 b'warn-empty-changegroup',
647 default=False,
647 default=False,
648 )
648 )
649 coreconfigitem(
649 coreconfigitem(
650 b'devel',
650 b'devel',
651 b'legacy.exchange',
651 b'legacy.exchange',
652 default=list,
652 default=list,
653 )
653 )
654 # When True, revlogs use a special reference version of the nodemap, that is not
654 # When True, revlogs use a special reference version of the nodemap, that is not
655 # performant but is "known" to behave properly.
655 # performant but is "known" to behave properly.
656 coreconfigitem(
656 coreconfigitem(
657 b'devel',
657 b'devel',
658 b'persistent-nodemap',
658 b'persistent-nodemap',
659 default=False,
659 default=False,
660 )
660 )
661 coreconfigitem(
661 coreconfigitem(
662 b'devel',
662 b'devel',
663 b'servercafile',
663 b'servercafile',
664 default=b'',
664 default=b'',
665 )
665 )
666 coreconfigitem(
666 coreconfigitem(
667 b'devel',
667 b'devel',
668 b'serverexactprotocol',
668 b'serverexactprotocol',
669 default=b'',
669 default=b'',
670 )
670 )
671 coreconfigitem(
671 coreconfigitem(
672 b'devel',
672 b'devel',
673 b'serverrequirecert',
673 b'serverrequirecert',
674 default=False,
674 default=False,
675 )
675 )
676 coreconfigitem(
676 coreconfigitem(
677 b'devel',
677 b'devel',
678 b'strip-obsmarkers',
678 b'strip-obsmarkers',
679 default=True,
679 default=True,
680 )
680 )
681 coreconfigitem(
681 coreconfigitem(
682 b'devel',
682 b'devel',
683 b'warn-config',
683 b'warn-config',
684 default=None,
684 default=None,
685 )
685 )
686 coreconfigitem(
686 coreconfigitem(
687 b'devel',
687 b'devel',
688 b'warn-config-default',
688 b'warn-config-default',
689 default=None,
689 default=None,
690 )
690 )
691 coreconfigitem(
691 coreconfigitem(
692 b'devel',
692 b'devel',
693 b'user.obsmarker',
693 b'user.obsmarker',
694 default=None,
694 default=None,
695 )
695 )
696 coreconfigitem(
696 coreconfigitem(
697 b'devel',
697 b'devel',
698 b'warn-config-unknown',
698 b'warn-config-unknown',
699 default=None,
699 default=None,
700 )
700 )
701 coreconfigitem(
701 coreconfigitem(
702 b'devel',
702 b'devel',
703 b'debug.copies',
703 b'debug.copies',
704 default=False,
704 default=False,
705 )
705 )
706 coreconfigitem(
706 coreconfigitem(
707 b'devel',
707 b'devel',
708 b'copy-tracing.multi-thread',
708 b'copy-tracing.multi-thread',
709 default=True,
709 default=True,
710 )
710 )
711 coreconfigitem(
711 coreconfigitem(
712 b'devel',
712 b'devel',
713 b'debug.extensions',
713 b'debug.extensions',
714 default=False,
714 default=False,
715 )
715 )
716 coreconfigitem(
716 coreconfigitem(
717 b'devel',
717 b'devel',
718 b'debug.repo-filters',
718 b'debug.repo-filters',
719 default=False,
719 default=False,
720 )
720 )
721 coreconfigitem(
721 coreconfigitem(
722 b'devel',
722 b'devel',
723 b'debug.peer-request',
723 b'debug.peer-request',
724 default=False,
724 default=False,
725 )
725 )
726 # If discovery.exchange-heads is False, the discovery will not start with
726 # If discovery.exchange-heads is False, the discovery will not start with
727 # remote head fetching and local head querying.
727 # remote head fetching and local head querying.
728 coreconfigitem(
728 coreconfigitem(
729 b'devel',
729 b'devel',
730 b'discovery.exchange-heads',
730 b'discovery.exchange-heads',
731 default=True,
731 default=True,
732 )
732 )
733 # If discovery.grow-sample is False, the sample size used in set discovery will
733 # If discovery.grow-sample is False, the sample size used in set discovery will
734 # not be increased through the process
734 # not be increased through the process
735 coreconfigitem(
735 coreconfigitem(
736 b'devel',
736 b'devel',
737 b'discovery.grow-sample',
737 b'discovery.grow-sample',
738 default=True,
738 default=True,
739 )
739 )
740 # When discovery.grow-sample.dynamic is True, the default, the sample size is
740 # When discovery.grow-sample.dynamic is True, the default, the sample size is
741 # adapted to the shape of the undecided set (it is set to the max of:
741 # adapted to the shape of the undecided set (it is set to the max of:
742 # <target-size>, len(roots(undecided)), len(heads(undecided)
742 # <target-size>, len(roots(undecided)), len(heads(undecided)
743 coreconfigitem(
743 coreconfigitem(
744 b'devel',
744 b'devel',
745 b'discovery.grow-sample.dynamic',
745 b'discovery.grow-sample.dynamic',
746 default=True,
746 default=True,
747 )
747 )
748 # discovery.grow-sample.rate control the rate at which the sample grow
748 # discovery.grow-sample.rate control the rate at which the sample grow
749 coreconfigitem(
749 coreconfigitem(
750 b'devel',
750 b'devel',
751 b'discovery.grow-sample.rate',
751 b'discovery.grow-sample.rate',
752 default=1.05,
752 default=1.05,
753 )
753 )
754 # If discovery.randomize is False, random sampling during discovery are
754 # If discovery.randomize is False, random sampling during discovery are
755 # deterministic. It is meant for integration tests.
755 # deterministic. It is meant for integration tests.
756 coreconfigitem(
756 coreconfigitem(
757 b'devel',
757 b'devel',
758 b'discovery.randomize',
758 b'discovery.randomize',
759 default=True,
759 default=True,
760 )
760 )
761 # Control the initial size of the discovery sample
761 # Control the initial size of the discovery sample
762 coreconfigitem(
762 coreconfigitem(
763 b'devel',
763 b'devel',
764 b'discovery.sample-size',
764 b'discovery.sample-size',
765 default=200,
765 default=200,
766 )
766 )
767 # Control the initial size of the discovery for initial change
767 # Control the initial size of the discovery for initial change
768 coreconfigitem(
768 coreconfigitem(
769 b'devel',
769 b'devel',
770 b'discovery.sample-size.initial',
770 b'discovery.sample-size.initial',
771 default=100,
771 default=100,
772 )
772 )
773 _registerdiffopts(section=b'diff')
773 _registerdiffopts(section=b'diff')
774 coreconfigitem(
774 coreconfigitem(
775 b'diff',
775 b'diff',
776 b'merge',
776 b'merge',
777 default=False,
777 default=False,
778 experimental=True,
778 experimental=True,
779 )
779 )
780 coreconfigitem(
780 coreconfigitem(
781 b'email',
781 b'email',
782 b'bcc',
782 b'bcc',
783 default=None,
783 default=None,
784 )
784 )
785 coreconfigitem(
785 coreconfigitem(
786 b'email',
786 b'email',
787 b'cc',
787 b'cc',
788 default=None,
788 default=None,
789 )
789 )
790 coreconfigitem(
790 coreconfigitem(
791 b'email',
791 b'email',
792 b'charsets',
792 b'charsets',
793 default=list,
793 default=list,
794 )
794 )
795 coreconfigitem(
795 coreconfigitem(
796 b'email',
796 b'email',
797 b'from',
797 b'from',
798 default=None,
798 default=None,
799 )
799 )
800 coreconfigitem(
800 coreconfigitem(
801 b'email',
801 b'email',
802 b'method',
802 b'method',
803 default=b'smtp',
803 default=b'smtp',
804 )
804 )
805 coreconfigitem(
805 coreconfigitem(
806 b'email',
806 b'email',
807 b'reply-to',
807 b'reply-to',
808 default=None,
808 default=None,
809 )
809 )
810 coreconfigitem(
810 coreconfigitem(
811 b'email',
811 b'email',
812 b'to',
812 b'to',
813 default=None,
813 default=None,
814 )
814 )
815 coreconfigitem(
815 coreconfigitem(
816 b'experimental',
816 b'experimental',
817 b'archivemetatemplate',
817 b'archivemetatemplate',
818 default=dynamicdefault,
818 default=dynamicdefault,
819 )
819 )
820 coreconfigitem(
820 coreconfigitem(
821 b'experimental',
821 b'experimental',
822 b'auto-publish',
822 b'auto-publish',
823 default=b'publish',
823 default=b'publish',
824 )
824 )
825 coreconfigitem(
825 coreconfigitem(
826 b'experimental',
826 b'experimental',
827 b'bundle-phases',
827 b'bundle-phases',
828 default=False,
828 default=False,
829 )
829 )
830 coreconfigitem(
830 coreconfigitem(
831 b'experimental',
831 b'experimental',
832 b'bundle2-advertise',
832 b'bundle2-advertise',
833 default=True,
833 default=True,
834 )
834 )
835 coreconfigitem(
835 coreconfigitem(
836 b'experimental',
836 b'experimental',
837 b'bundle2-output-capture',
837 b'bundle2-output-capture',
838 default=False,
838 default=False,
839 )
839 )
840 coreconfigitem(
840 coreconfigitem(
841 b'experimental',
841 b'experimental',
842 b'bundle2.pushback',
842 b'bundle2.pushback',
843 default=False,
843 default=False,
844 )
844 )
845 coreconfigitem(
845 coreconfigitem(
846 b'experimental',
846 b'experimental',
847 b'bundle2lazylocking',
847 b'bundle2lazylocking',
848 default=False,
848 default=False,
849 )
849 )
850 coreconfigitem(
850 coreconfigitem(
851 b'experimental',
851 b'experimental',
852 b'bundlecomplevel',
852 b'bundlecomplevel',
853 default=None,
853 default=None,
854 )
854 )
855 coreconfigitem(
855 coreconfigitem(
856 b'experimental',
856 b'experimental',
857 b'bundlecomplevel.bzip2',
857 b'bundlecomplevel.bzip2',
858 default=None,
858 default=None,
859 )
859 )
860 coreconfigitem(
860 coreconfigitem(
861 b'experimental',
861 b'experimental',
862 b'bundlecomplevel.gzip',
862 b'bundlecomplevel.gzip',
863 default=None,
863 default=None,
864 )
864 )
865 coreconfigitem(
865 coreconfigitem(
866 b'experimental',
866 b'experimental',
867 b'bundlecomplevel.none',
867 b'bundlecomplevel.none',
868 default=None,
868 default=None,
869 )
869 )
870 coreconfigitem(
870 coreconfigitem(
871 b'experimental',
871 b'experimental',
872 b'bundlecomplevel.zstd',
872 b'bundlecomplevel.zstd',
873 default=None,
873 default=None,
874 )
874 )
875 coreconfigitem(
875 coreconfigitem(
876 b'experimental',
876 b'experimental',
877 b'bundlecompthreads',
877 b'bundlecompthreads',
878 default=None,
878 default=None,
879 )
879 )
880 coreconfigitem(
880 coreconfigitem(
881 b'experimental',
881 b'experimental',
882 b'bundlecompthreads.bzip2',
882 b'bundlecompthreads.bzip2',
883 default=None,
883 default=None,
884 )
884 )
885 coreconfigitem(
885 coreconfigitem(
886 b'experimental',
886 b'experimental',
887 b'bundlecompthreads.gzip',
887 b'bundlecompthreads.gzip',
888 default=None,
888 default=None,
889 )
889 )
890 coreconfigitem(
890 coreconfigitem(
891 b'experimental',
891 b'experimental',
892 b'bundlecompthreads.none',
892 b'bundlecompthreads.none',
893 default=None,
893 default=None,
894 )
894 )
895 coreconfigitem(
895 coreconfigitem(
896 b'experimental',
896 b'experimental',
897 b'bundlecompthreads.zstd',
897 b'bundlecompthreads.zstd',
898 default=None,
898 default=None,
899 )
899 )
900 coreconfigitem(
900 coreconfigitem(
901 b'experimental',
901 b'experimental',
902 b'changegroup3',
902 b'changegroup3',
903 default=False,
903 default=False,
904 )
904 )
905 coreconfigitem(
905 coreconfigitem(
906 b'experimental',
906 b'experimental',
907 b'changegroup4',
907 b'changegroup4',
908 default=False,
908 default=False,
909 )
909 )
910 coreconfigitem(
910 coreconfigitem(
911 b'experimental',
911 b'experimental',
912 b'cleanup-as-archived',
912 b'cleanup-as-archived',
913 default=False,
913 default=False,
914 )
914 )
915 coreconfigitem(
915 coreconfigitem(
916 b'experimental',
916 b'experimental',
917 b'clientcompressionengines',
917 b'clientcompressionengines',
918 default=list,
918 default=list,
919 )
919 )
920 coreconfigitem(
920 coreconfigitem(
921 b'experimental',
921 b'experimental',
922 b'copytrace',
922 b'copytrace',
923 default=b'on',
923 default=b'on',
924 )
924 )
925 coreconfigitem(
925 coreconfigitem(
926 b'experimental',
926 b'experimental',
927 b'copytrace.movecandidateslimit',
927 b'copytrace.movecandidateslimit',
928 default=100,
928 default=100,
929 )
929 )
930 coreconfigitem(
930 coreconfigitem(
931 b'experimental',
931 b'experimental',
932 b'copytrace.sourcecommitlimit',
932 b'copytrace.sourcecommitlimit',
933 default=100,
933 default=100,
934 )
934 )
935 coreconfigitem(
935 coreconfigitem(
936 b'experimental',
936 b'experimental',
937 b'copies.read-from',
937 b'copies.read-from',
938 default=b"filelog-only",
938 default=b"filelog-only",
939 )
939 )
940 coreconfigitem(
940 coreconfigitem(
941 b'experimental',
941 b'experimental',
942 b'copies.write-to',
942 b'copies.write-to',
943 default=b'filelog-only',
943 default=b'filelog-only',
944 )
944 )
945 coreconfigitem(
945 coreconfigitem(
946 b'experimental',
946 b'experimental',
947 b'crecordtest',
947 b'crecordtest',
948 default=None,
948 default=None,
949 )
949 )
950 coreconfigitem(
950 coreconfigitem(
951 b'experimental',
951 b'experimental',
952 b'directaccess',
952 b'directaccess',
953 default=False,
953 default=False,
954 )
954 )
955 coreconfigitem(
955 coreconfigitem(
956 b'experimental',
956 b'experimental',
957 b'directaccess.revnums',
957 b'directaccess.revnums',
958 default=False,
958 default=False,
959 )
959 )
960 coreconfigitem(
960 coreconfigitem(
961 b'experimental',
961 b'experimental',
962 b'dirstate-tree.in-memory',
962 b'dirstate-tree.in-memory',
963 default=False,
963 default=False,
964 )
964 )
965 coreconfigitem(
965 coreconfigitem(
966 b'experimental',
966 b'experimental',
967 b'editortmpinhg',
967 b'editortmpinhg',
968 default=False,
968 default=False,
969 )
969 )
970 coreconfigitem(
970 coreconfigitem(
971 b'experimental',
971 b'experimental',
972 b'evolution',
972 b'evolution',
973 default=list,
973 default=list,
974 )
974 )
975 coreconfigitem(
975 coreconfigitem(
976 b'experimental',
976 b'experimental',
977 b'evolution.allowdivergence',
977 b'evolution.allowdivergence',
978 default=False,
978 default=False,
979 alias=[(b'experimental', b'allowdivergence')],
979 alias=[(b'experimental', b'allowdivergence')],
980 )
980 )
981 coreconfigitem(
981 coreconfigitem(
982 b'experimental',
982 b'experimental',
983 b'evolution.allowunstable',
983 b'evolution.allowunstable',
984 default=None,
984 default=None,
985 )
985 )
986 coreconfigitem(
986 coreconfigitem(
987 b'experimental',
987 b'experimental',
988 b'evolution.createmarkers',
988 b'evolution.createmarkers',
989 default=None,
989 default=None,
990 )
990 )
991 coreconfigitem(
991 coreconfigitem(
992 b'experimental',
992 b'experimental',
993 b'evolution.effect-flags',
993 b'evolution.effect-flags',
994 default=True,
994 default=True,
995 alias=[(b'experimental', b'effect-flags')],
995 alias=[(b'experimental', b'effect-flags')],
996 )
996 )
997 coreconfigitem(
997 coreconfigitem(
998 b'experimental',
998 b'experimental',
999 b'evolution.exchange',
999 b'evolution.exchange',
1000 default=None,
1000 default=None,
1001 )
1001 )
1002 coreconfigitem(
1002 coreconfigitem(
1003 b'experimental',
1003 b'experimental',
1004 b'evolution.bundle-obsmarker',
1004 b'evolution.bundle-obsmarker',
1005 default=False,
1005 default=False,
1006 )
1006 )
1007 coreconfigitem(
1007 coreconfigitem(
1008 b'experimental',
1008 b'experimental',
1009 b'evolution.bundle-obsmarker:mandatory',
1009 b'evolution.bundle-obsmarker:mandatory',
1010 default=True,
1010 default=True,
1011 )
1011 )
1012 coreconfigitem(
1012 coreconfigitem(
1013 b'experimental',
1013 b'experimental',
1014 b'log.topo',
1014 b'log.topo',
1015 default=False,
1015 default=False,
1016 )
1016 )
1017 coreconfigitem(
1017 coreconfigitem(
1018 b'experimental',
1018 b'experimental',
1019 b'evolution.report-instabilities',
1019 b'evolution.report-instabilities',
1020 default=True,
1020 default=True,
1021 )
1021 )
1022 coreconfigitem(
1022 coreconfigitem(
1023 b'experimental',
1023 b'experimental',
1024 b'evolution.track-operation',
1024 b'evolution.track-operation',
1025 default=True,
1025 default=True,
1026 )
1026 )
1027 # repo-level config to exclude a revset visibility
1027 # repo-level config to exclude a revset visibility
1028 #
1028 #
1029 # The target use case is to use `share` to expose different subset of the same
1029 # The target use case is to use `share` to expose different subset of the same
1030 # repository, especially server side. See also `server.view`.
1030 # repository, especially server side. See also `server.view`.
1031 coreconfigitem(
1031 coreconfigitem(
1032 b'experimental',
1032 b'experimental',
1033 b'extra-filter-revs',
1033 b'extra-filter-revs',
1034 default=None,
1034 default=None,
1035 )
1035 )
1036 coreconfigitem(
1036 coreconfigitem(
1037 b'experimental',
1037 b'experimental',
1038 b'maxdeltachainspan',
1038 b'maxdeltachainspan',
1039 default=-1,
1039 default=-1,
1040 )
1040 )
1041 # tracks files which were undeleted (merge might delete them but we explicitly
1041 # tracks files which were undeleted (merge might delete them but we explicitly
1042 # kept/undeleted them) and creates new filenodes for them
1042 # kept/undeleted them) and creates new filenodes for them
1043 coreconfigitem(
1043 coreconfigitem(
1044 b'experimental',
1044 b'experimental',
1045 b'merge-track-salvaged',
1045 b'merge-track-salvaged',
1046 default=False,
1046 default=False,
1047 )
1047 )
1048 coreconfigitem(
1048 coreconfigitem(
1049 b'experimental',
1049 b'experimental',
1050 b'mergetempdirprefix',
1050 b'mergetempdirprefix',
1051 default=None,
1051 default=None,
1052 )
1052 )
1053 coreconfigitem(
1053 coreconfigitem(
1054 b'experimental',
1054 b'experimental',
1055 b'mmapindexthreshold',
1055 b'mmapindexthreshold',
1056 default=None,
1056 default=None,
1057 )
1057 )
1058 coreconfigitem(
1058 coreconfigitem(
1059 b'experimental',
1059 b'experimental',
1060 b'narrow',
1060 b'narrow',
1061 default=False,
1061 default=False,
1062 )
1062 )
1063 coreconfigitem(
1063 coreconfigitem(
1064 b'experimental',
1064 b'experimental',
1065 b'nonnormalparanoidcheck',
1065 b'nonnormalparanoidcheck',
1066 default=False,
1066 default=False,
1067 )
1067 )
1068 coreconfigitem(
1068 coreconfigitem(
1069 b'experimental',
1069 b'experimental',
1070 b'exportableenviron',
1070 b'exportableenviron',
1071 default=list,
1071 default=list,
1072 )
1072 )
1073 coreconfigitem(
1073 coreconfigitem(
1074 b'experimental',
1074 b'experimental',
1075 b'extendedheader.index',
1075 b'extendedheader.index',
1076 default=None,
1076 default=None,
1077 )
1077 )
1078 coreconfigitem(
1078 coreconfigitem(
1079 b'experimental',
1079 b'experimental',
1080 b'extendedheader.similarity',
1080 b'extendedheader.similarity',
1081 default=False,
1081 default=False,
1082 )
1082 )
1083 coreconfigitem(
1083 coreconfigitem(
1084 b'experimental',
1084 b'experimental',
1085 b'graphshorten',
1085 b'graphshorten',
1086 default=False,
1086 default=False,
1087 )
1087 )
1088 coreconfigitem(
1088 coreconfigitem(
1089 b'experimental',
1089 b'experimental',
1090 b'graphstyle.parent',
1090 b'graphstyle.parent',
1091 default=dynamicdefault,
1091 default=dynamicdefault,
1092 )
1092 )
1093 coreconfigitem(
1093 coreconfigitem(
1094 b'experimental',
1094 b'experimental',
1095 b'graphstyle.missing',
1095 b'graphstyle.missing',
1096 default=dynamicdefault,
1096 default=dynamicdefault,
1097 )
1097 )
1098 coreconfigitem(
1098 coreconfigitem(
1099 b'experimental',
1099 b'experimental',
1100 b'graphstyle.grandparent',
1100 b'graphstyle.grandparent',
1101 default=dynamicdefault,
1101 default=dynamicdefault,
1102 )
1102 )
1103 coreconfigitem(
1103 coreconfigitem(
1104 b'experimental',
1104 b'experimental',
1105 b'hook-track-tags',
1105 b'hook-track-tags',
1106 default=False,
1106 default=False,
1107 )
1107 )
1108 coreconfigitem(
1108 coreconfigitem(
1109 b'experimental',
1109 b'experimental',
1110 b'httppeer.advertise-v2',
1110 b'httppeer.advertise-v2',
1111 default=False,
1111 default=False,
1112 )
1112 )
1113 coreconfigitem(
1113 coreconfigitem(
1114 b'experimental',
1114 b'experimental',
1115 b'httppeer.v2-encoder-order',
1115 b'httppeer.v2-encoder-order',
1116 default=None,
1116 default=None,
1117 )
1117 )
1118 coreconfigitem(
1118 coreconfigitem(
1119 b'experimental',
1119 b'experimental',
1120 b'httppostargs',
1120 b'httppostargs',
1121 default=False,
1121 default=False,
1122 )
1122 )
1123 coreconfigitem(b'experimental', b'nointerrupt', default=False)
1123 coreconfigitem(b'experimental', b'nointerrupt', default=False)
1124 coreconfigitem(b'experimental', b'nointerrupt-interactiveonly', default=True)
1124 coreconfigitem(b'experimental', b'nointerrupt-interactiveonly', default=True)
1125
1125
1126 coreconfigitem(
1126 coreconfigitem(
1127 b'experimental',
1127 b'experimental',
1128 b'obsmarkers-exchange-debug',
1128 b'obsmarkers-exchange-debug',
1129 default=False,
1129 default=False,
1130 )
1130 )
1131 coreconfigitem(
1131 coreconfigitem(
1132 b'experimental',
1132 b'experimental',
1133 b'remotenames',
1133 b'remotenames',
1134 default=False,
1134 default=False,
1135 )
1135 )
1136 coreconfigitem(
1136 coreconfigitem(
1137 b'experimental',
1137 b'experimental',
1138 b'removeemptydirs',
1138 b'removeemptydirs',
1139 default=True,
1139 default=True,
1140 )
1140 )
1141 coreconfigitem(
1141 coreconfigitem(
1142 b'experimental',
1142 b'experimental',
1143 b'revert.interactive.select-to-keep',
1143 b'revert.interactive.select-to-keep',
1144 default=False,
1144 default=False,
1145 )
1145 )
1146 coreconfigitem(
1146 coreconfigitem(
1147 b'experimental',
1147 b'experimental',
1148 b'revisions.prefixhexnode',
1148 b'revisions.prefixhexnode',
1149 default=False,
1149 default=False,
1150 )
1150 )
1151 # "out of experimental" todo list.
1151 # "out of experimental" todo list.
1152 #
1152 #
1153 # * include management of a persistent nodemap in the main docket
1153 # * include management of a persistent nodemap in the main docket
1154 # * enforce a "no-truncate" policy for mmap safety
1154 # * enforce a "no-truncate" policy for mmap safety
1155 # - for censoring operation
1155 # - for censoring operation
1156 # - for stripping operation
1156 # - for stripping operation
1157 # - for rollback operation
1157 # - for rollback operation
1158 # * proper streaming (race free) of the docket file
1158 # * proper streaming (race free) of the docket file
1159 # * track garbage data to evemtually allow rewriting -existing- sidedata.
1159 # * track garbage data to evemtually allow rewriting -existing- sidedata.
1160 # * Exchange-wise, we will also need to do something more efficient than
1160 # * Exchange-wise, we will also need to do something more efficient than
1161 # keeping references to the affected revlogs, especially memory-wise when
1161 # keeping references to the affected revlogs, especially memory-wise when
1162 # rewriting sidedata.
1162 # rewriting sidedata.
1163 # * introduce a proper solution to reduce the number of filelog related files.
1163 # * introduce a proper solution to reduce the number of filelog related files.
1164 # * use caching for reading sidedata (similar to what we do for data).
1164 # * use caching for reading sidedata (similar to what we do for data).
1165 # * no longer set offset=0 if sidedata_size=0 (simplify cutoff computation).
1165 # * no longer set offset=0 if sidedata_size=0 (simplify cutoff computation).
1166 # * Improvement to consider
1166 # * Improvement to consider
1167 # - avoid compression header in chunk using the default compression?
1167 # - avoid compression header in chunk using the default compression?
1168 # - forbid "inline" compression mode entirely?
1168 # - forbid "inline" compression mode entirely?
1169 # - split the data offset and flag field (the 2 bytes save are mostly trouble)
1169 # - split the data offset and flag field (the 2 bytes save are mostly trouble)
1170 # - keep track of uncompressed -chunk- size (to preallocate memory better)
1170 # - keep track of uncompressed -chunk- size (to preallocate memory better)
1171 # - keep track of chain base or size (probably not that useful anymore)
1171 # - keep track of chain base or size (probably not that useful anymore)
1172 coreconfigitem(
1172 coreconfigitem(
1173 b'experimental',
1173 b'experimental',
1174 b'revlogv2',
1174 b'revlogv2',
1175 default=None,
1175 default=None,
1176 )
1176 )
1177 coreconfigitem(
1177 coreconfigitem(
1178 b'experimental',
1178 b'experimental',
1179 b'revisions.disambiguatewithin',
1179 b'revisions.disambiguatewithin',
1180 default=None,
1180 default=None,
1181 )
1181 )
1182 coreconfigitem(
1182 coreconfigitem(
1183 b'experimental',
1183 b'experimental',
1184 b'rust.index',
1184 b'rust.index',
1185 default=False,
1185 default=False,
1186 )
1186 )
1187 coreconfigitem(
1187 coreconfigitem(
1188 b'experimental',
1188 b'experimental',
1189 b'server.filesdata.recommended-batch-size',
1189 b'server.filesdata.recommended-batch-size',
1190 default=50000,
1190 default=50000,
1191 )
1191 )
1192 coreconfigitem(
1192 coreconfigitem(
1193 b'experimental',
1193 b'experimental',
1194 b'server.manifestdata.recommended-batch-size',
1194 b'server.manifestdata.recommended-batch-size',
1195 default=100000,
1195 default=100000,
1196 )
1196 )
1197 coreconfigitem(
1197 coreconfigitem(
1198 b'experimental',
1198 b'experimental',
1199 b'server.stream-narrow-clones',
1199 b'server.stream-narrow-clones',
1200 default=False,
1200 default=False,
1201 )
1201 )
1202 coreconfigitem(
1202 coreconfigitem(
1203 b'experimental',
1203 b'experimental',
1204 b'single-head-per-branch',
1204 b'single-head-per-branch',
1205 default=False,
1205 default=False,
1206 )
1206 )
1207 coreconfigitem(
1207 coreconfigitem(
1208 b'experimental',
1208 b'experimental',
1209 b'single-head-per-branch:account-closed-heads',
1209 b'single-head-per-branch:account-closed-heads',
1210 default=False,
1210 default=False,
1211 )
1211 )
1212 coreconfigitem(
1212 coreconfigitem(
1213 b'experimental',
1213 b'experimental',
1214 b'single-head-per-branch:public-changes-only',
1214 b'single-head-per-branch:public-changes-only',
1215 default=False,
1215 default=False,
1216 )
1216 )
1217 coreconfigitem(
1217 coreconfigitem(
1218 b'experimental',
1218 b'experimental',
1219 b'sshserver.support-v2',
1219 b'sshserver.support-v2',
1220 default=False,
1220 default=False,
1221 )
1221 )
1222 coreconfigitem(
1222 coreconfigitem(
1223 b'experimental',
1223 b'experimental',
1224 b'sparse-read',
1224 b'sparse-read',
1225 default=False,
1225 default=False,
1226 )
1226 )
1227 coreconfigitem(
1227 coreconfigitem(
1228 b'experimental',
1228 b'experimental',
1229 b'sparse-read.density-threshold',
1229 b'sparse-read.density-threshold',
1230 default=0.50,
1230 default=0.50,
1231 )
1231 )
1232 coreconfigitem(
1232 coreconfigitem(
1233 b'experimental',
1233 b'experimental',
1234 b'sparse-read.min-gap-size',
1234 b'sparse-read.min-gap-size',
1235 default=b'65K',
1235 default=b'65K',
1236 )
1236 )
1237 coreconfigitem(
1237 coreconfigitem(
1238 b'experimental',
1238 b'experimental',
1239 b'treemanifest',
1239 b'treemanifest',
1240 default=False,
1240 default=False,
1241 )
1241 )
1242 coreconfigitem(
1242 coreconfigitem(
1243 b'experimental',
1243 b'experimental',
1244 b'update.atomic-file',
1244 b'update.atomic-file',
1245 default=False,
1245 default=False,
1246 )
1246 )
1247 coreconfigitem(
1247 coreconfigitem(
1248 b'experimental',
1248 b'experimental',
1249 b'sshpeer.advertise-v2',
1249 b'sshpeer.advertise-v2',
1250 default=False,
1250 default=False,
1251 )
1251 )
1252 coreconfigitem(
1252 coreconfigitem(
1253 b'experimental',
1253 b'experimental',
1254 b'web.apiserver',
1254 b'web.apiserver',
1255 default=False,
1255 default=False,
1256 )
1256 )
1257 coreconfigitem(
1257 coreconfigitem(
1258 b'experimental',
1258 b'experimental',
1259 b'web.api.http-v2',
1259 b'web.api.http-v2',
1260 default=False,
1260 default=False,
1261 )
1261 )
1262 coreconfigitem(
1262 coreconfigitem(
1263 b'experimental',
1263 b'experimental',
1264 b'web.api.debugreflect',
1264 b'web.api.debugreflect',
1265 default=False,
1265 default=False,
1266 )
1266 )
1267 coreconfigitem(
1267 coreconfigitem(
1268 b'experimental',
1268 b'experimental',
1269 b'web.full-garbage-collection-rate',
1270 default=1, # still forcing a full collection on each request
1271 )
1272 coreconfigitem(
1273 b'experimental',
1269 b'worker.wdir-get-thread-safe',
1274 b'worker.wdir-get-thread-safe',
1270 default=False,
1275 default=False,
1271 )
1276 )
1272 coreconfigitem(
1277 coreconfigitem(
1273 b'experimental',
1278 b'experimental',
1274 b'worker.repository-upgrade',
1279 b'worker.repository-upgrade',
1275 default=False,
1280 default=False,
1276 )
1281 )
1277 coreconfigitem(
1282 coreconfigitem(
1278 b'experimental',
1283 b'experimental',
1279 b'xdiff',
1284 b'xdiff',
1280 default=False,
1285 default=False,
1281 )
1286 )
1282 coreconfigitem(
1287 coreconfigitem(
1283 b'extensions',
1288 b'extensions',
1284 b'.*',
1289 b'.*',
1285 default=None,
1290 default=None,
1286 generic=True,
1291 generic=True,
1287 )
1292 )
1288 coreconfigitem(
1293 coreconfigitem(
1289 b'extdata',
1294 b'extdata',
1290 b'.*',
1295 b'.*',
1291 default=None,
1296 default=None,
1292 generic=True,
1297 generic=True,
1293 )
1298 )
1294 coreconfigitem(
1299 coreconfigitem(
1295 b'format',
1300 b'format',
1296 b'bookmarks-in-store',
1301 b'bookmarks-in-store',
1297 default=False,
1302 default=False,
1298 )
1303 )
1299 coreconfigitem(
1304 coreconfigitem(
1300 b'format',
1305 b'format',
1301 b'chunkcachesize',
1306 b'chunkcachesize',
1302 default=None,
1307 default=None,
1303 experimental=True,
1308 experimental=True,
1304 )
1309 )
1305 coreconfigitem(
1310 coreconfigitem(
1306 # Enable this dirstate format *when creating a new repository*.
1311 # Enable this dirstate format *when creating a new repository*.
1307 # Which format to use for existing repos is controlled by .hg/requires
1312 # Which format to use for existing repos is controlled by .hg/requires
1308 b'format',
1313 b'format',
1309 b'exp-dirstate-v2',
1314 b'exp-dirstate-v2',
1310 default=False,
1315 default=False,
1311 experimental=True,
1316 experimental=True,
1312 )
1317 )
1313 coreconfigitem(
1318 coreconfigitem(
1314 b'format',
1319 b'format',
1315 b'dotencode',
1320 b'dotencode',
1316 default=True,
1321 default=True,
1317 )
1322 )
1318 coreconfigitem(
1323 coreconfigitem(
1319 b'format',
1324 b'format',
1320 b'generaldelta',
1325 b'generaldelta',
1321 default=False,
1326 default=False,
1322 experimental=True,
1327 experimental=True,
1323 )
1328 )
1324 coreconfigitem(
1329 coreconfigitem(
1325 b'format',
1330 b'format',
1326 b'manifestcachesize',
1331 b'manifestcachesize',
1327 default=None,
1332 default=None,
1328 experimental=True,
1333 experimental=True,
1329 )
1334 )
1330 coreconfigitem(
1335 coreconfigitem(
1331 b'format',
1336 b'format',
1332 b'maxchainlen',
1337 b'maxchainlen',
1333 default=dynamicdefault,
1338 default=dynamicdefault,
1334 experimental=True,
1339 experimental=True,
1335 )
1340 )
1336 coreconfigitem(
1341 coreconfigitem(
1337 b'format',
1342 b'format',
1338 b'obsstore-version',
1343 b'obsstore-version',
1339 default=None,
1344 default=None,
1340 )
1345 )
1341 coreconfigitem(
1346 coreconfigitem(
1342 b'format',
1347 b'format',
1343 b'sparse-revlog',
1348 b'sparse-revlog',
1344 default=True,
1349 default=True,
1345 )
1350 )
1346 coreconfigitem(
1351 coreconfigitem(
1347 b'format',
1352 b'format',
1348 b'revlog-compression',
1353 b'revlog-compression',
1349 default=lambda: [b'zstd', b'zlib'],
1354 default=lambda: [b'zstd', b'zlib'],
1350 alias=[(b'experimental', b'format.compression')],
1355 alias=[(b'experimental', b'format.compression')],
1351 )
1356 )
1352 # Experimental TODOs:
1357 # Experimental TODOs:
1353 #
1358 #
1354 # * Same as for evlogv2 (but for the reduction of the number of files)
1359 # * Same as for evlogv2 (but for the reduction of the number of files)
1355 # * Improvement to investigate
1360 # * Improvement to investigate
1356 # - storing .hgtags fnode
1361 # - storing .hgtags fnode
1357 # - storing `rank` of changesets
1362 # - storing `rank` of changesets
1358 # - storing branch related identifier
1363 # - storing branch related identifier
1359
1364
1360 coreconfigitem(
1365 coreconfigitem(
1361 b'format',
1366 b'format',
1362 b'exp-use-changelog-v2',
1367 b'exp-use-changelog-v2',
1363 default=None,
1368 default=None,
1364 experimental=True,
1369 experimental=True,
1365 )
1370 )
1366 coreconfigitem(
1371 coreconfigitem(
1367 b'format',
1372 b'format',
1368 b'usefncache',
1373 b'usefncache',
1369 default=True,
1374 default=True,
1370 )
1375 )
1371 coreconfigitem(
1376 coreconfigitem(
1372 b'format',
1377 b'format',
1373 b'usegeneraldelta',
1378 b'usegeneraldelta',
1374 default=True,
1379 default=True,
1375 )
1380 )
1376 coreconfigitem(
1381 coreconfigitem(
1377 b'format',
1382 b'format',
1378 b'usestore',
1383 b'usestore',
1379 default=True,
1384 default=True,
1380 )
1385 )
1381
1386
1382
1387
1383 def _persistent_nodemap_default():
1388 def _persistent_nodemap_default():
1384 """compute `use-persistent-nodemap` default value
1389 """compute `use-persistent-nodemap` default value
1385
1390
1386 The feature is disabled unless a fast implementation is available.
1391 The feature is disabled unless a fast implementation is available.
1387 """
1392 """
1388 from . import policy
1393 from . import policy
1389
1394
1390 return policy.importrust('revlog') is not None
1395 return policy.importrust('revlog') is not None
1391
1396
1392
1397
1393 coreconfigitem(
1398 coreconfigitem(
1394 b'format',
1399 b'format',
1395 b'use-persistent-nodemap',
1400 b'use-persistent-nodemap',
1396 default=_persistent_nodemap_default,
1401 default=_persistent_nodemap_default,
1397 )
1402 )
1398 coreconfigitem(
1403 coreconfigitem(
1399 b'format',
1404 b'format',
1400 b'exp-use-copies-side-data-changeset',
1405 b'exp-use-copies-side-data-changeset',
1401 default=False,
1406 default=False,
1402 experimental=True,
1407 experimental=True,
1403 )
1408 )
1404 coreconfigitem(
1409 coreconfigitem(
1405 b'format',
1410 b'format',
1406 b'use-share-safe',
1411 b'use-share-safe',
1407 default=False,
1412 default=False,
1408 )
1413 )
1409 coreconfigitem(
1414 coreconfigitem(
1410 b'format',
1415 b'format',
1411 b'internal-phase',
1416 b'internal-phase',
1412 default=False,
1417 default=False,
1413 experimental=True,
1418 experimental=True,
1414 )
1419 )
1415 coreconfigitem(
1420 coreconfigitem(
1416 b'fsmonitor',
1421 b'fsmonitor',
1417 b'warn_when_unused',
1422 b'warn_when_unused',
1418 default=True,
1423 default=True,
1419 )
1424 )
1420 coreconfigitem(
1425 coreconfigitem(
1421 b'fsmonitor',
1426 b'fsmonitor',
1422 b'warn_update_file_count',
1427 b'warn_update_file_count',
1423 default=50000,
1428 default=50000,
1424 )
1429 )
1425 coreconfigitem(
1430 coreconfigitem(
1426 b'fsmonitor',
1431 b'fsmonitor',
1427 b'warn_update_file_count_rust',
1432 b'warn_update_file_count_rust',
1428 default=400000,
1433 default=400000,
1429 )
1434 )
1430 coreconfigitem(
1435 coreconfigitem(
1431 b'help',
1436 b'help',
1432 br'hidden-command\..*',
1437 br'hidden-command\..*',
1433 default=False,
1438 default=False,
1434 generic=True,
1439 generic=True,
1435 )
1440 )
1436 coreconfigitem(
1441 coreconfigitem(
1437 b'help',
1442 b'help',
1438 br'hidden-topic\..*',
1443 br'hidden-topic\..*',
1439 default=False,
1444 default=False,
1440 generic=True,
1445 generic=True,
1441 )
1446 )
1442 coreconfigitem(
1447 coreconfigitem(
1443 b'hooks',
1448 b'hooks',
1444 b'[^:]*',
1449 b'[^:]*',
1445 default=dynamicdefault,
1450 default=dynamicdefault,
1446 generic=True,
1451 generic=True,
1447 )
1452 )
1448 coreconfigitem(
1453 coreconfigitem(
1449 b'hooks',
1454 b'hooks',
1450 b'.*:run-with-plain',
1455 b'.*:run-with-plain',
1451 default=True,
1456 default=True,
1452 generic=True,
1457 generic=True,
1453 )
1458 )
1454 coreconfigitem(
1459 coreconfigitem(
1455 b'hgweb-paths',
1460 b'hgweb-paths',
1456 b'.*',
1461 b'.*',
1457 default=list,
1462 default=list,
1458 generic=True,
1463 generic=True,
1459 )
1464 )
1460 coreconfigitem(
1465 coreconfigitem(
1461 b'hostfingerprints',
1466 b'hostfingerprints',
1462 b'.*',
1467 b'.*',
1463 default=list,
1468 default=list,
1464 generic=True,
1469 generic=True,
1465 )
1470 )
1466 coreconfigitem(
1471 coreconfigitem(
1467 b'hostsecurity',
1472 b'hostsecurity',
1468 b'ciphers',
1473 b'ciphers',
1469 default=None,
1474 default=None,
1470 )
1475 )
1471 coreconfigitem(
1476 coreconfigitem(
1472 b'hostsecurity',
1477 b'hostsecurity',
1473 b'minimumprotocol',
1478 b'minimumprotocol',
1474 default=dynamicdefault,
1479 default=dynamicdefault,
1475 )
1480 )
1476 coreconfigitem(
1481 coreconfigitem(
1477 b'hostsecurity',
1482 b'hostsecurity',
1478 b'.*:minimumprotocol$',
1483 b'.*:minimumprotocol$',
1479 default=dynamicdefault,
1484 default=dynamicdefault,
1480 generic=True,
1485 generic=True,
1481 )
1486 )
1482 coreconfigitem(
1487 coreconfigitem(
1483 b'hostsecurity',
1488 b'hostsecurity',
1484 b'.*:ciphers$',
1489 b'.*:ciphers$',
1485 default=dynamicdefault,
1490 default=dynamicdefault,
1486 generic=True,
1491 generic=True,
1487 )
1492 )
1488 coreconfigitem(
1493 coreconfigitem(
1489 b'hostsecurity',
1494 b'hostsecurity',
1490 b'.*:fingerprints$',
1495 b'.*:fingerprints$',
1491 default=list,
1496 default=list,
1492 generic=True,
1497 generic=True,
1493 )
1498 )
1494 coreconfigitem(
1499 coreconfigitem(
1495 b'hostsecurity',
1500 b'hostsecurity',
1496 b'.*:verifycertsfile$',
1501 b'.*:verifycertsfile$',
1497 default=None,
1502 default=None,
1498 generic=True,
1503 generic=True,
1499 )
1504 )
1500
1505
1501 coreconfigitem(
1506 coreconfigitem(
1502 b'http_proxy',
1507 b'http_proxy',
1503 b'always',
1508 b'always',
1504 default=False,
1509 default=False,
1505 )
1510 )
1506 coreconfigitem(
1511 coreconfigitem(
1507 b'http_proxy',
1512 b'http_proxy',
1508 b'host',
1513 b'host',
1509 default=None,
1514 default=None,
1510 )
1515 )
1511 coreconfigitem(
1516 coreconfigitem(
1512 b'http_proxy',
1517 b'http_proxy',
1513 b'no',
1518 b'no',
1514 default=list,
1519 default=list,
1515 )
1520 )
1516 coreconfigitem(
1521 coreconfigitem(
1517 b'http_proxy',
1522 b'http_proxy',
1518 b'passwd',
1523 b'passwd',
1519 default=None,
1524 default=None,
1520 )
1525 )
1521 coreconfigitem(
1526 coreconfigitem(
1522 b'http_proxy',
1527 b'http_proxy',
1523 b'user',
1528 b'user',
1524 default=None,
1529 default=None,
1525 )
1530 )
1526
1531
1527 coreconfigitem(
1532 coreconfigitem(
1528 b'http',
1533 b'http',
1529 b'timeout',
1534 b'timeout',
1530 default=None,
1535 default=None,
1531 )
1536 )
1532
1537
1533 coreconfigitem(
1538 coreconfigitem(
1534 b'logtoprocess',
1539 b'logtoprocess',
1535 b'commandexception',
1540 b'commandexception',
1536 default=None,
1541 default=None,
1537 )
1542 )
1538 coreconfigitem(
1543 coreconfigitem(
1539 b'logtoprocess',
1544 b'logtoprocess',
1540 b'commandfinish',
1545 b'commandfinish',
1541 default=None,
1546 default=None,
1542 )
1547 )
1543 coreconfigitem(
1548 coreconfigitem(
1544 b'logtoprocess',
1549 b'logtoprocess',
1545 b'command',
1550 b'command',
1546 default=None,
1551 default=None,
1547 )
1552 )
1548 coreconfigitem(
1553 coreconfigitem(
1549 b'logtoprocess',
1554 b'logtoprocess',
1550 b'develwarn',
1555 b'develwarn',
1551 default=None,
1556 default=None,
1552 )
1557 )
1553 coreconfigitem(
1558 coreconfigitem(
1554 b'logtoprocess',
1559 b'logtoprocess',
1555 b'uiblocked',
1560 b'uiblocked',
1556 default=None,
1561 default=None,
1557 )
1562 )
1558 coreconfigitem(
1563 coreconfigitem(
1559 b'merge',
1564 b'merge',
1560 b'checkunknown',
1565 b'checkunknown',
1561 default=b'abort',
1566 default=b'abort',
1562 )
1567 )
1563 coreconfigitem(
1568 coreconfigitem(
1564 b'merge',
1569 b'merge',
1565 b'checkignored',
1570 b'checkignored',
1566 default=b'abort',
1571 default=b'abort',
1567 )
1572 )
1568 coreconfigitem(
1573 coreconfigitem(
1569 b'experimental',
1574 b'experimental',
1570 b'merge.checkpathconflicts',
1575 b'merge.checkpathconflicts',
1571 default=False,
1576 default=False,
1572 )
1577 )
1573 coreconfigitem(
1578 coreconfigitem(
1574 b'merge',
1579 b'merge',
1575 b'followcopies',
1580 b'followcopies',
1576 default=True,
1581 default=True,
1577 )
1582 )
1578 coreconfigitem(
1583 coreconfigitem(
1579 b'merge',
1584 b'merge',
1580 b'on-failure',
1585 b'on-failure',
1581 default=b'continue',
1586 default=b'continue',
1582 )
1587 )
1583 coreconfigitem(
1588 coreconfigitem(
1584 b'merge',
1589 b'merge',
1585 b'preferancestor',
1590 b'preferancestor',
1586 default=lambda: [b'*'],
1591 default=lambda: [b'*'],
1587 experimental=True,
1592 experimental=True,
1588 )
1593 )
1589 coreconfigitem(
1594 coreconfigitem(
1590 b'merge',
1595 b'merge',
1591 b'strict-capability-check',
1596 b'strict-capability-check',
1592 default=False,
1597 default=False,
1593 )
1598 )
1594 coreconfigitem(
1599 coreconfigitem(
1595 b'merge-tools',
1600 b'merge-tools',
1596 b'.*',
1601 b'.*',
1597 default=None,
1602 default=None,
1598 generic=True,
1603 generic=True,
1599 )
1604 )
1600 coreconfigitem(
1605 coreconfigitem(
1601 b'merge-tools',
1606 b'merge-tools',
1602 br'.*\.args$',
1607 br'.*\.args$',
1603 default=b"$local $base $other",
1608 default=b"$local $base $other",
1604 generic=True,
1609 generic=True,
1605 priority=-1,
1610 priority=-1,
1606 )
1611 )
1607 coreconfigitem(
1612 coreconfigitem(
1608 b'merge-tools',
1613 b'merge-tools',
1609 br'.*\.binary$',
1614 br'.*\.binary$',
1610 default=False,
1615 default=False,
1611 generic=True,
1616 generic=True,
1612 priority=-1,
1617 priority=-1,
1613 )
1618 )
1614 coreconfigitem(
1619 coreconfigitem(
1615 b'merge-tools',
1620 b'merge-tools',
1616 br'.*\.check$',
1621 br'.*\.check$',
1617 default=list,
1622 default=list,
1618 generic=True,
1623 generic=True,
1619 priority=-1,
1624 priority=-1,
1620 )
1625 )
1621 coreconfigitem(
1626 coreconfigitem(
1622 b'merge-tools',
1627 b'merge-tools',
1623 br'.*\.checkchanged$',
1628 br'.*\.checkchanged$',
1624 default=False,
1629 default=False,
1625 generic=True,
1630 generic=True,
1626 priority=-1,
1631 priority=-1,
1627 )
1632 )
1628 coreconfigitem(
1633 coreconfigitem(
1629 b'merge-tools',
1634 b'merge-tools',
1630 br'.*\.executable$',
1635 br'.*\.executable$',
1631 default=dynamicdefault,
1636 default=dynamicdefault,
1632 generic=True,
1637 generic=True,
1633 priority=-1,
1638 priority=-1,
1634 )
1639 )
1635 coreconfigitem(
1640 coreconfigitem(
1636 b'merge-tools',
1641 b'merge-tools',
1637 br'.*\.fixeol$',
1642 br'.*\.fixeol$',
1638 default=False,
1643 default=False,
1639 generic=True,
1644 generic=True,
1640 priority=-1,
1645 priority=-1,
1641 )
1646 )
1642 coreconfigitem(
1647 coreconfigitem(
1643 b'merge-tools',
1648 b'merge-tools',
1644 br'.*\.gui$',
1649 br'.*\.gui$',
1645 default=False,
1650 default=False,
1646 generic=True,
1651 generic=True,
1647 priority=-1,
1652 priority=-1,
1648 )
1653 )
1649 coreconfigitem(
1654 coreconfigitem(
1650 b'merge-tools',
1655 b'merge-tools',
1651 br'.*\.mergemarkers$',
1656 br'.*\.mergemarkers$',
1652 default=b'basic',
1657 default=b'basic',
1653 generic=True,
1658 generic=True,
1654 priority=-1,
1659 priority=-1,
1655 )
1660 )
1656 coreconfigitem(
1661 coreconfigitem(
1657 b'merge-tools',
1662 b'merge-tools',
1658 br'.*\.mergemarkertemplate$',
1663 br'.*\.mergemarkertemplate$',
1659 default=dynamicdefault, # take from command-templates.mergemarker
1664 default=dynamicdefault, # take from command-templates.mergemarker
1660 generic=True,
1665 generic=True,
1661 priority=-1,
1666 priority=-1,
1662 )
1667 )
1663 coreconfigitem(
1668 coreconfigitem(
1664 b'merge-tools',
1669 b'merge-tools',
1665 br'.*\.priority$',
1670 br'.*\.priority$',
1666 default=0,
1671 default=0,
1667 generic=True,
1672 generic=True,
1668 priority=-1,
1673 priority=-1,
1669 )
1674 )
1670 coreconfigitem(
1675 coreconfigitem(
1671 b'merge-tools',
1676 b'merge-tools',
1672 br'.*\.premerge$',
1677 br'.*\.premerge$',
1673 default=dynamicdefault,
1678 default=dynamicdefault,
1674 generic=True,
1679 generic=True,
1675 priority=-1,
1680 priority=-1,
1676 )
1681 )
1677 coreconfigitem(
1682 coreconfigitem(
1678 b'merge-tools',
1683 b'merge-tools',
1679 br'.*\.symlink$',
1684 br'.*\.symlink$',
1680 default=False,
1685 default=False,
1681 generic=True,
1686 generic=True,
1682 priority=-1,
1687 priority=-1,
1683 )
1688 )
1684 coreconfigitem(
1689 coreconfigitem(
1685 b'pager',
1690 b'pager',
1686 b'attend-.*',
1691 b'attend-.*',
1687 default=dynamicdefault,
1692 default=dynamicdefault,
1688 generic=True,
1693 generic=True,
1689 )
1694 )
1690 coreconfigitem(
1695 coreconfigitem(
1691 b'pager',
1696 b'pager',
1692 b'ignore',
1697 b'ignore',
1693 default=list,
1698 default=list,
1694 )
1699 )
1695 coreconfigitem(
1700 coreconfigitem(
1696 b'pager',
1701 b'pager',
1697 b'pager',
1702 b'pager',
1698 default=dynamicdefault,
1703 default=dynamicdefault,
1699 )
1704 )
1700 coreconfigitem(
1705 coreconfigitem(
1701 b'patch',
1706 b'patch',
1702 b'eol',
1707 b'eol',
1703 default=b'strict',
1708 default=b'strict',
1704 )
1709 )
1705 coreconfigitem(
1710 coreconfigitem(
1706 b'patch',
1711 b'patch',
1707 b'fuzz',
1712 b'fuzz',
1708 default=2,
1713 default=2,
1709 )
1714 )
1710 coreconfigitem(
1715 coreconfigitem(
1711 b'paths',
1716 b'paths',
1712 b'default',
1717 b'default',
1713 default=None,
1718 default=None,
1714 )
1719 )
1715 coreconfigitem(
1720 coreconfigitem(
1716 b'paths',
1721 b'paths',
1717 b'default-push',
1722 b'default-push',
1718 default=None,
1723 default=None,
1719 )
1724 )
1720 coreconfigitem(
1725 coreconfigitem(
1721 b'paths',
1726 b'paths',
1722 b'.*',
1727 b'.*',
1723 default=None,
1728 default=None,
1724 generic=True,
1729 generic=True,
1725 )
1730 )
1726 coreconfigitem(
1731 coreconfigitem(
1727 b'phases',
1732 b'phases',
1728 b'checksubrepos',
1733 b'checksubrepos',
1729 default=b'follow',
1734 default=b'follow',
1730 )
1735 )
1731 coreconfigitem(
1736 coreconfigitem(
1732 b'phases',
1737 b'phases',
1733 b'new-commit',
1738 b'new-commit',
1734 default=b'draft',
1739 default=b'draft',
1735 )
1740 )
1736 coreconfigitem(
1741 coreconfigitem(
1737 b'phases',
1742 b'phases',
1738 b'publish',
1743 b'publish',
1739 default=True,
1744 default=True,
1740 )
1745 )
1741 coreconfigitem(
1746 coreconfigitem(
1742 b'profiling',
1747 b'profiling',
1743 b'enabled',
1748 b'enabled',
1744 default=False,
1749 default=False,
1745 )
1750 )
1746 coreconfigitem(
1751 coreconfigitem(
1747 b'profiling',
1752 b'profiling',
1748 b'format',
1753 b'format',
1749 default=b'text',
1754 default=b'text',
1750 )
1755 )
1751 coreconfigitem(
1756 coreconfigitem(
1752 b'profiling',
1757 b'profiling',
1753 b'freq',
1758 b'freq',
1754 default=1000,
1759 default=1000,
1755 )
1760 )
1756 coreconfigitem(
1761 coreconfigitem(
1757 b'profiling',
1762 b'profiling',
1758 b'limit',
1763 b'limit',
1759 default=30,
1764 default=30,
1760 )
1765 )
1761 coreconfigitem(
1766 coreconfigitem(
1762 b'profiling',
1767 b'profiling',
1763 b'nested',
1768 b'nested',
1764 default=0,
1769 default=0,
1765 )
1770 )
1766 coreconfigitem(
1771 coreconfigitem(
1767 b'profiling',
1772 b'profiling',
1768 b'output',
1773 b'output',
1769 default=None,
1774 default=None,
1770 )
1775 )
1771 coreconfigitem(
1776 coreconfigitem(
1772 b'profiling',
1777 b'profiling',
1773 b'showmax',
1778 b'showmax',
1774 default=0.999,
1779 default=0.999,
1775 )
1780 )
1776 coreconfigitem(
1781 coreconfigitem(
1777 b'profiling',
1782 b'profiling',
1778 b'showmin',
1783 b'showmin',
1779 default=dynamicdefault,
1784 default=dynamicdefault,
1780 )
1785 )
1781 coreconfigitem(
1786 coreconfigitem(
1782 b'profiling',
1787 b'profiling',
1783 b'showtime',
1788 b'showtime',
1784 default=True,
1789 default=True,
1785 )
1790 )
1786 coreconfigitem(
1791 coreconfigitem(
1787 b'profiling',
1792 b'profiling',
1788 b'sort',
1793 b'sort',
1789 default=b'inlinetime',
1794 default=b'inlinetime',
1790 )
1795 )
1791 coreconfigitem(
1796 coreconfigitem(
1792 b'profiling',
1797 b'profiling',
1793 b'statformat',
1798 b'statformat',
1794 default=b'hotpath',
1799 default=b'hotpath',
1795 )
1800 )
1796 coreconfigitem(
1801 coreconfigitem(
1797 b'profiling',
1802 b'profiling',
1798 b'time-track',
1803 b'time-track',
1799 default=dynamicdefault,
1804 default=dynamicdefault,
1800 )
1805 )
1801 coreconfigitem(
1806 coreconfigitem(
1802 b'profiling',
1807 b'profiling',
1803 b'type',
1808 b'type',
1804 default=b'stat',
1809 default=b'stat',
1805 )
1810 )
1806 coreconfigitem(
1811 coreconfigitem(
1807 b'progress',
1812 b'progress',
1808 b'assume-tty',
1813 b'assume-tty',
1809 default=False,
1814 default=False,
1810 )
1815 )
1811 coreconfigitem(
1816 coreconfigitem(
1812 b'progress',
1817 b'progress',
1813 b'changedelay',
1818 b'changedelay',
1814 default=1,
1819 default=1,
1815 )
1820 )
1816 coreconfigitem(
1821 coreconfigitem(
1817 b'progress',
1822 b'progress',
1818 b'clear-complete',
1823 b'clear-complete',
1819 default=True,
1824 default=True,
1820 )
1825 )
1821 coreconfigitem(
1826 coreconfigitem(
1822 b'progress',
1827 b'progress',
1823 b'debug',
1828 b'debug',
1824 default=False,
1829 default=False,
1825 )
1830 )
1826 coreconfigitem(
1831 coreconfigitem(
1827 b'progress',
1832 b'progress',
1828 b'delay',
1833 b'delay',
1829 default=3,
1834 default=3,
1830 )
1835 )
1831 coreconfigitem(
1836 coreconfigitem(
1832 b'progress',
1837 b'progress',
1833 b'disable',
1838 b'disable',
1834 default=False,
1839 default=False,
1835 )
1840 )
1836 coreconfigitem(
1841 coreconfigitem(
1837 b'progress',
1842 b'progress',
1838 b'estimateinterval',
1843 b'estimateinterval',
1839 default=60.0,
1844 default=60.0,
1840 )
1845 )
1841 coreconfigitem(
1846 coreconfigitem(
1842 b'progress',
1847 b'progress',
1843 b'format',
1848 b'format',
1844 default=lambda: [b'topic', b'bar', b'number', b'estimate'],
1849 default=lambda: [b'topic', b'bar', b'number', b'estimate'],
1845 )
1850 )
1846 coreconfigitem(
1851 coreconfigitem(
1847 b'progress',
1852 b'progress',
1848 b'refresh',
1853 b'refresh',
1849 default=0.1,
1854 default=0.1,
1850 )
1855 )
1851 coreconfigitem(
1856 coreconfigitem(
1852 b'progress',
1857 b'progress',
1853 b'width',
1858 b'width',
1854 default=dynamicdefault,
1859 default=dynamicdefault,
1855 )
1860 )
1856 coreconfigitem(
1861 coreconfigitem(
1857 b'pull',
1862 b'pull',
1858 b'confirm',
1863 b'confirm',
1859 default=False,
1864 default=False,
1860 )
1865 )
1861 coreconfigitem(
1866 coreconfigitem(
1862 b'push',
1867 b'push',
1863 b'pushvars.server',
1868 b'pushvars.server',
1864 default=False,
1869 default=False,
1865 )
1870 )
1866 coreconfigitem(
1871 coreconfigitem(
1867 b'rewrite',
1872 b'rewrite',
1868 b'backup-bundle',
1873 b'backup-bundle',
1869 default=True,
1874 default=True,
1870 alias=[(b'ui', b'history-editing-backup')],
1875 alias=[(b'ui', b'history-editing-backup')],
1871 )
1876 )
1872 coreconfigitem(
1877 coreconfigitem(
1873 b'rewrite',
1878 b'rewrite',
1874 b'update-timestamp',
1879 b'update-timestamp',
1875 default=False,
1880 default=False,
1876 )
1881 )
1877 coreconfigitem(
1882 coreconfigitem(
1878 b'rewrite',
1883 b'rewrite',
1879 b'empty-successor',
1884 b'empty-successor',
1880 default=b'skip',
1885 default=b'skip',
1881 experimental=True,
1886 experimental=True,
1882 )
1887 )
1883 coreconfigitem(
1888 coreconfigitem(
1884 b'storage',
1889 b'storage',
1885 b'new-repo-backend',
1890 b'new-repo-backend',
1886 default=b'revlogv1',
1891 default=b'revlogv1',
1887 experimental=True,
1892 experimental=True,
1888 )
1893 )
1889 coreconfigitem(
1894 coreconfigitem(
1890 b'storage',
1895 b'storage',
1891 b'revlog.optimize-delta-parent-choice',
1896 b'revlog.optimize-delta-parent-choice',
1892 default=True,
1897 default=True,
1893 alias=[(b'format', b'aggressivemergedeltas')],
1898 alias=[(b'format', b'aggressivemergedeltas')],
1894 )
1899 )
1895 # experimental as long as rust is experimental (or a C version is implemented)
1900 # experimental as long as rust is experimental (or a C version is implemented)
1896 coreconfigitem(
1901 coreconfigitem(
1897 b'storage',
1902 b'storage',
1898 b'revlog.persistent-nodemap.mmap',
1903 b'revlog.persistent-nodemap.mmap',
1899 default=True,
1904 default=True,
1900 )
1905 )
1901 # experimental as long as format.use-persistent-nodemap is.
1906 # experimental as long as format.use-persistent-nodemap is.
1902 coreconfigitem(
1907 coreconfigitem(
1903 b'storage',
1908 b'storage',
1904 b'revlog.persistent-nodemap.slow-path',
1909 b'revlog.persistent-nodemap.slow-path',
1905 default=b"abort",
1910 default=b"abort",
1906 )
1911 )
1907
1912
1908 coreconfigitem(
1913 coreconfigitem(
1909 b'storage',
1914 b'storage',
1910 b'revlog.reuse-external-delta',
1915 b'revlog.reuse-external-delta',
1911 default=True,
1916 default=True,
1912 )
1917 )
1913 coreconfigitem(
1918 coreconfigitem(
1914 b'storage',
1919 b'storage',
1915 b'revlog.reuse-external-delta-parent',
1920 b'revlog.reuse-external-delta-parent',
1916 default=None,
1921 default=None,
1917 )
1922 )
1918 coreconfigitem(
1923 coreconfigitem(
1919 b'storage',
1924 b'storage',
1920 b'revlog.zlib.level',
1925 b'revlog.zlib.level',
1921 default=None,
1926 default=None,
1922 )
1927 )
1923 coreconfigitem(
1928 coreconfigitem(
1924 b'storage',
1929 b'storage',
1925 b'revlog.zstd.level',
1930 b'revlog.zstd.level',
1926 default=None,
1931 default=None,
1927 )
1932 )
1928 coreconfigitem(
1933 coreconfigitem(
1929 b'server',
1934 b'server',
1930 b'bookmarks-pushkey-compat',
1935 b'bookmarks-pushkey-compat',
1931 default=True,
1936 default=True,
1932 )
1937 )
1933 coreconfigitem(
1938 coreconfigitem(
1934 b'server',
1939 b'server',
1935 b'bundle1',
1940 b'bundle1',
1936 default=True,
1941 default=True,
1937 )
1942 )
1938 coreconfigitem(
1943 coreconfigitem(
1939 b'server',
1944 b'server',
1940 b'bundle1gd',
1945 b'bundle1gd',
1941 default=None,
1946 default=None,
1942 )
1947 )
1943 coreconfigitem(
1948 coreconfigitem(
1944 b'server',
1949 b'server',
1945 b'bundle1.pull',
1950 b'bundle1.pull',
1946 default=None,
1951 default=None,
1947 )
1952 )
1948 coreconfigitem(
1953 coreconfigitem(
1949 b'server',
1954 b'server',
1950 b'bundle1gd.pull',
1955 b'bundle1gd.pull',
1951 default=None,
1956 default=None,
1952 )
1957 )
1953 coreconfigitem(
1958 coreconfigitem(
1954 b'server',
1959 b'server',
1955 b'bundle1.push',
1960 b'bundle1.push',
1956 default=None,
1961 default=None,
1957 )
1962 )
1958 coreconfigitem(
1963 coreconfigitem(
1959 b'server',
1964 b'server',
1960 b'bundle1gd.push',
1965 b'bundle1gd.push',
1961 default=None,
1966 default=None,
1962 )
1967 )
1963 coreconfigitem(
1968 coreconfigitem(
1964 b'server',
1969 b'server',
1965 b'bundle2.stream',
1970 b'bundle2.stream',
1966 default=True,
1971 default=True,
1967 alias=[(b'experimental', b'bundle2.stream')],
1972 alias=[(b'experimental', b'bundle2.stream')],
1968 )
1973 )
1969 coreconfigitem(
1974 coreconfigitem(
1970 b'server',
1975 b'server',
1971 b'compressionengines',
1976 b'compressionengines',
1972 default=list,
1977 default=list,
1973 )
1978 )
1974 coreconfigitem(
1979 coreconfigitem(
1975 b'server',
1980 b'server',
1976 b'concurrent-push-mode',
1981 b'concurrent-push-mode',
1977 default=b'check-related',
1982 default=b'check-related',
1978 )
1983 )
1979 coreconfigitem(
1984 coreconfigitem(
1980 b'server',
1985 b'server',
1981 b'disablefullbundle',
1986 b'disablefullbundle',
1982 default=False,
1987 default=False,
1983 )
1988 )
1984 coreconfigitem(
1989 coreconfigitem(
1985 b'server',
1990 b'server',
1986 b'maxhttpheaderlen',
1991 b'maxhttpheaderlen',
1987 default=1024,
1992 default=1024,
1988 )
1993 )
1989 coreconfigitem(
1994 coreconfigitem(
1990 b'server',
1995 b'server',
1991 b'pullbundle',
1996 b'pullbundle',
1992 default=False,
1997 default=False,
1993 )
1998 )
1994 coreconfigitem(
1999 coreconfigitem(
1995 b'server',
2000 b'server',
1996 b'preferuncompressed',
2001 b'preferuncompressed',
1997 default=False,
2002 default=False,
1998 )
2003 )
1999 coreconfigitem(
2004 coreconfigitem(
2000 b'server',
2005 b'server',
2001 b'streamunbundle',
2006 b'streamunbundle',
2002 default=False,
2007 default=False,
2003 )
2008 )
2004 coreconfigitem(
2009 coreconfigitem(
2005 b'server',
2010 b'server',
2006 b'uncompressed',
2011 b'uncompressed',
2007 default=True,
2012 default=True,
2008 )
2013 )
2009 coreconfigitem(
2014 coreconfigitem(
2010 b'server',
2015 b'server',
2011 b'uncompressedallowsecret',
2016 b'uncompressedallowsecret',
2012 default=False,
2017 default=False,
2013 )
2018 )
2014 coreconfigitem(
2019 coreconfigitem(
2015 b'server',
2020 b'server',
2016 b'view',
2021 b'view',
2017 default=b'served',
2022 default=b'served',
2018 )
2023 )
2019 coreconfigitem(
2024 coreconfigitem(
2020 b'server',
2025 b'server',
2021 b'validate',
2026 b'validate',
2022 default=False,
2027 default=False,
2023 )
2028 )
2024 coreconfigitem(
2029 coreconfigitem(
2025 b'server',
2030 b'server',
2026 b'zliblevel',
2031 b'zliblevel',
2027 default=-1,
2032 default=-1,
2028 )
2033 )
2029 coreconfigitem(
2034 coreconfigitem(
2030 b'server',
2035 b'server',
2031 b'zstdlevel',
2036 b'zstdlevel',
2032 default=3,
2037 default=3,
2033 )
2038 )
2034 coreconfigitem(
2039 coreconfigitem(
2035 b'share',
2040 b'share',
2036 b'pool',
2041 b'pool',
2037 default=None,
2042 default=None,
2038 )
2043 )
2039 coreconfigitem(
2044 coreconfigitem(
2040 b'share',
2045 b'share',
2041 b'poolnaming',
2046 b'poolnaming',
2042 default=b'identity',
2047 default=b'identity',
2043 )
2048 )
2044 coreconfigitem(
2049 coreconfigitem(
2045 b'share',
2050 b'share',
2046 b'safe-mismatch.source-not-safe',
2051 b'safe-mismatch.source-not-safe',
2047 default=b'abort',
2052 default=b'abort',
2048 )
2053 )
2049 coreconfigitem(
2054 coreconfigitem(
2050 b'share',
2055 b'share',
2051 b'safe-mismatch.source-safe',
2056 b'safe-mismatch.source-safe',
2052 default=b'abort',
2057 default=b'abort',
2053 )
2058 )
2054 coreconfigitem(
2059 coreconfigitem(
2055 b'share',
2060 b'share',
2056 b'safe-mismatch.source-not-safe.warn',
2061 b'safe-mismatch.source-not-safe.warn',
2057 default=True,
2062 default=True,
2058 )
2063 )
2059 coreconfigitem(
2064 coreconfigitem(
2060 b'share',
2065 b'share',
2061 b'safe-mismatch.source-safe.warn',
2066 b'safe-mismatch.source-safe.warn',
2062 default=True,
2067 default=True,
2063 )
2068 )
2064 coreconfigitem(
2069 coreconfigitem(
2065 b'shelve',
2070 b'shelve',
2066 b'maxbackups',
2071 b'maxbackups',
2067 default=10,
2072 default=10,
2068 )
2073 )
2069 coreconfigitem(
2074 coreconfigitem(
2070 b'smtp',
2075 b'smtp',
2071 b'host',
2076 b'host',
2072 default=None,
2077 default=None,
2073 )
2078 )
2074 coreconfigitem(
2079 coreconfigitem(
2075 b'smtp',
2080 b'smtp',
2076 b'local_hostname',
2081 b'local_hostname',
2077 default=None,
2082 default=None,
2078 )
2083 )
2079 coreconfigitem(
2084 coreconfigitem(
2080 b'smtp',
2085 b'smtp',
2081 b'password',
2086 b'password',
2082 default=None,
2087 default=None,
2083 )
2088 )
2084 coreconfigitem(
2089 coreconfigitem(
2085 b'smtp',
2090 b'smtp',
2086 b'port',
2091 b'port',
2087 default=dynamicdefault,
2092 default=dynamicdefault,
2088 )
2093 )
2089 coreconfigitem(
2094 coreconfigitem(
2090 b'smtp',
2095 b'smtp',
2091 b'tls',
2096 b'tls',
2092 default=b'none',
2097 default=b'none',
2093 )
2098 )
2094 coreconfigitem(
2099 coreconfigitem(
2095 b'smtp',
2100 b'smtp',
2096 b'username',
2101 b'username',
2097 default=None,
2102 default=None,
2098 )
2103 )
2099 coreconfigitem(
2104 coreconfigitem(
2100 b'sparse',
2105 b'sparse',
2101 b'missingwarning',
2106 b'missingwarning',
2102 default=True,
2107 default=True,
2103 experimental=True,
2108 experimental=True,
2104 )
2109 )
2105 coreconfigitem(
2110 coreconfigitem(
2106 b'subrepos',
2111 b'subrepos',
2107 b'allowed',
2112 b'allowed',
2108 default=dynamicdefault, # to make backporting simpler
2113 default=dynamicdefault, # to make backporting simpler
2109 )
2114 )
2110 coreconfigitem(
2115 coreconfigitem(
2111 b'subrepos',
2116 b'subrepos',
2112 b'hg:allowed',
2117 b'hg:allowed',
2113 default=dynamicdefault,
2118 default=dynamicdefault,
2114 )
2119 )
2115 coreconfigitem(
2120 coreconfigitem(
2116 b'subrepos',
2121 b'subrepos',
2117 b'git:allowed',
2122 b'git:allowed',
2118 default=dynamicdefault,
2123 default=dynamicdefault,
2119 )
2124 )
2120 coreconfigitem(
2125 coreconfigitem(
2121 b'subrepos',
2126 b'subrepos',
2122 b'svn:allowed',
2127 b'svn:allowed',
2123 default=dynamicdefault,
2128 default=dynamicdefault,
2124 )
2129 )
2125 coreconfigitem(
2130 coreconfigitem(
2126 b'templates',
2131 b'templates',
2127 b'.*',
2132 b'.*',
2128 default=None,
2133 default=None,
2129 generic=True,
2134 generic=True,
2130 )
2135 )
2131 coreconfigitem(
2136 coreconfigitem(
2132 b'templateconfig',
2137 b'templateconfig',
2133 b'.*',
2138 b'.*',
2134 default=dynamicdefault,
2139 default=dynamicdefault,
2135 generic=True,
2140 generic=True,
2136 )
2141 )
2137 coreconfigitem(
2142 coreconfigitem(
2138 b'trusted',
2143 b'trusted',
2139 b'groups',
2144 b'groups',
2140 default=list,
2145 default=list,
2141 )
2146 )
2142 coreconfigitem(
2147 coreconfigitem(
2143 b'trusted',
2148 b'trusted',
2144 b'users',
2149 b'users',
2145 default=list,
2150 default=list,
2146 )
2151 )
2147 coreconfigitem(
2152 coreconfigitem(
2148 b'ui',
2153 b'ui',
2149 b'_usedassubrepo',
2154 b'_usedassubrepo',
2150 default=False,
2155 default=False,
2151 )
2156 )
2152 coreconfigitem(
2157 coreconfigitem(
2153 b'ui',
2158 b'ui',
2154 b'allowemptycommit',
2159 b'allowemptycommit',
2155 default=False,
2160 default=False,
2156 )
2161 )
2157 coreconfigitem(
2162 coreconfigitem(
2158 b'ui',
2163 b'ui',
2159 b'archivemeta',
2164 b'archivemeta',
2160 default=True,
2165 default=True,
2161 )
2166 )
2162 coreconfigitem(
2167 coreconfigitem(
2163 b'ui',
2168 b'ui',
2164 b'askusername',
2169 b'askusername',
2165 default=False,
2170 default=False,
2166 )
2171 )
2167 coreconfigitem(
2172 coreconfigitem(
2168 b'ui',
2173 b'ui',
2169 b'available-memory',
2174 b'available-memory',
2170 default=None,
2175 default=None,
2171 )
2176 )
2172
2177
2173 coreconfigitem(
2178 coreconfigitem(
2174 b'ui',
2179 b'ui',
2175 b'clonebundlefallback',
2180 b'clonebundlefallback',
2176 default=False,
2181 default=False,
2177 )
2182 )
2178 coreconfigitem(
2183 coreconfigitem(
2179 b'ui',
2184 b'ui',
2180 b'clonebundleprefers',
2185 b'clonebundleprefers',
2181 default=list,
2186 default=list,
2182 )
2187 )
2183 coreconfigitem(
2188 coreconfigitem(
2184 b'ui',
2189 b'ui',
2185 b'clonebundles',
2190 b'clonebundles',
2186 default=True,
2191 default=True,
2187 )
2192 )
2188 coreconfigitem(
2193 coreconfigitem(
2189 b'ui',
2194 b'ui',
2190 b'color',
2195 b'color',
2191 default=b'auto',
2196 default=b'auto',
2192 )
2197 )
2193 coreconfigitem(
2198 coreconfigitem(
2194 b'ui',
2199 b'ui',
2195 b'commitsubrepos',
2200 b'commitsubrepos',
2196 default=False,
2201 default=False,
2197 )
2202 )
2198 coreconfigitem(
2203 coreconfigitem(
2199 b'ui',
2204 b'ui',
2200 b'debug',
2205 b'debug',
2201 default=False,
2206 default=False,
2202 )
2207 )
2203 coreconfigitem(
2208 coreconfigitem(
2204 b'ui',
2209 b'ui',
2205 b'debugger',
2210 b'debugger',
2206 default=None,
2211 default=None,
2207 )
2212 )
2208 coreconfigitem(
2213 coreconfigitem(
2209 b'ui',
2214 b'ui',
2210 b'editor',
2215 b'editor',
2211 default=dynamicdefault,
2216 default=dynamicdefault,
2212 )
2217 )
2213 coreconfigitem(
2218 coreconfigitem(
2214 b'ui',
2219 b'ui',
2215 b'detailed-exit-code',
2220 b'detailed-exit-code',
2216 default=False,
2221 default=False,
2217 experimental=True,
2222 experimental=True,
2218 )
2223 )
2219 coreconfigitem(
2224 coreconfigitem(
2220 b'ui',
2225 b'ui',
2221 b'fallbackencoding',
2226 b'fallbackencoding',
2222 default=None,
2227 default=None,
2223 )
2228 )
2224 coreconfigitem(
2229 coreconfigitem(
2225 b'ui',
2230 b'ui',
2226 b'forcecwd',
2231 b'forcecwd',
2227 default=None,
2232 default=None,
2228 )
2233 )
2229 coreconfigitem(
2234 coreconfigitem(
2230 b'ui',
2235 b'ui',
2231 b'forcemerge',
2236 b'forcemerge',
2232 default=None,
2237 default=None,
2233 )
2238 )
2234 coreconfigitem(
2239 coreconfigitem(
2235 b'ui',
2240 b'ui',
2236 b'formatdebug',
2241 b'formatdebug',
2237 default=False,
2242 default=False,
2238 )
2243 )
2239 coreconfigitem(
2244 coreconfigitem(
2240 b'ui',
2245 b'ui',
2241 b'formatjson',
2246 b'formatjson',
2242 default=False,
2247 default=False,
2243 )
2248 )
2244 coreconfigitem(
2249 coreconfigitem(
2245 b'ui',
2250 b'ui',
2246 b'formatted',
2251 b'formatted',
2247 default=None,
2252 default=None,
2248 )
2253 )
2249 coreconfigitem(
2254 coreconfigitem(
2250 b'ui',
2255 b'ui',
2251 b'interactive',
2256 b'interactive',
2252 default=None,
2257 default=None,
2253 )
2258 )
2254 coreconfigitem(
2259 coreconfigitem(
2255 b'ui',
2260 b'ui',
2256 b'interface',
2261 b'interface',
2257 default=None,
2262 default=None,
2258 )
2263 )
2259 coreconfigitem(
2264 coreconfigitem(
2260 b'ui',
2265 b'ui',
2261 b'interface.chunkselector',
2266 b'interface.chunkselector',
2262 default=None,
2267 default=None,
2263 )
2268 )
2264 coreconfigitem(
2269 coreconfigitem(
2265 b'ui',
2270 b'ui',
2266 b'large-file-limit',
2271 b'large-file-limit',
2267 default=10000000,
2272 default=10000000,
2268 )
2273 )
2269 coreconfigitem(
2274 coreconfigitem(
2270 b'ui',
2275 b'ui',
2271 b'logblockedtimes',
2276 b'logblockedtimes',
2272 default=False,
2277 default=False,
2273 )
2278 )
2274 coreconfigitem(
2279 coreconfigitem(
2275 b'ui',
2280 b'ui',
2276 b'merge',
2281 b'merge',
2277 default=None,
2282 default=None,
2278 )
2283 )
2279 coreconfigitem(
2284 coreconfigitem(
2280 b'ui',
2285 b'ui',
2281 b'mergemarkers',
2286 b'mergemarkers',
2282 default=b'basic',
2287 default=b'basic',
2283 )
2288 )
2284 coreconfigitem(
2289 coreconfigitem(
2285 b'ui',
2290 b'ui',
2286 b'message-output',
2291 b'message-output',
2287 default=b'stdio',
2292 default=b'stdio',
2288 )
2293 )
2289 coreconfigitem(
2294 coreconfigitem(
2290 b'ui',
2295 b'ui',
2291 b'nontty',
2296 b'nontty',
2292 default=False,
2297 default=False,
2293 )
2298 )
2294 coreconfigitem(
2299 coreconfigitem(
2295 b'ui',
2300 b'ui',
2296 b'origbackuppath',
2301 b'origbackuppath',
2297 default=None,
2302 default=None,
2298 )
2303 )
2299 coreconfigitem(
2304 coreconfigitem(
2300 b'ui',
2305 b'ui',
2301 b'paginate',
2306 b'paginate',
2302 default=True,
2307 default=True,
2303 )
2308 )
2304 coreconfigitem(
2309 coreconfigitem(
2305 b'ui',
2310 b'ui',
2306 b'patch',
2311 b'patch',
2307 default=None,
2312 default=None,
2308 )
2313 )
2309 coreconfigitem(
2314 coreconfigitem(
2310 b'ui',
2315 b'ui',
2311 b'portablefilenames',
2316 b'portablefilenames',
2312 default=b'warn',
2317 default=b'warn',
2313 )
2318 )
2314 coreconfigitem(
2319 coreconfigitem(
2315 b'ui',
2320 b'ui',
2316 b'promptecho',
2321 b'promptecho',
2317 default=False,
2322 default=False,
2318 )
2323 )
2319 coreconfigitem(
2324 coreconfigitem(
2320 b'ui',
2325 b'ui',
2321 b'quiet',
2326 b'quiet',
2322 default=False,
2327 default=False,
2323 )
2328 )
2324 coreconfigitem(
2329 coreconfigitem(
2325 b'ui',
2330 b'ui',
2326 b'quietbookmarkmove',
2331 b'quietbookmarkmove',
2327 default=False,
2332 default=False,
2328 )
2333 )
2329 coreconfigitem(
2334 coreconfigitem(
2330 b'ui',
2335 b'ui',
2331 b'relative-paths',
2336 b'relative-paths',
2332 default=b'legacy',
2337 default=b'legacy',
2333 )
2338 )
2334 coreconfigitem(
2339 coreconfigitem(
2335 b'ui',
2340 b'ui',
2336 b'remotecmd',
2341 b'remotecmd',
2337 default=b'hg',
2342 default=b'hg',
2338 )
2343 )
2339 coreconfigitem(
2344 coreconfigitem(
2340 b'ui',
2345 b'ui',
2341 b'report_untrusted',
2346 b'report_untrusted',
2342 default=True,
2347 default=True,
2343 )
2348 )
2344 coreconfigitem(
2349 coreconfigitem(
2345 b'ui',
2350 b'ui',
2346 b'rollback',
2351 b'rollback',
2347 default=True,
2352 default=True,
2348 )
2353 )
2349 coreconfigitem(
2354 coreconfigitem(
2350 b'ui',
2355 b'ui',
2351 b'signal-safe-lock',
2356 b'signal-safe-lock',
2352 default=True,
2357 default=True,
2353 )
2358 )
2354 coreconfigitem(
2359 coreconfigitem(
2355 b'ui',
2360 b'ui',
2356 b'slash',
2361 b'slash',
2357 default=False,
2362 default=False,
2358 )
2363 )
2359 coreconfigitem(
2364 coreconfigitem(
2360 b'ui',
2365 b'ui',
2361 b'ssh',
2366 b'ssh',
2362 default=b'ssh',
2367 default=b'ssh',
2363 )
2368 )
2364 coreconfigitem(
2369 coreconfigitem(
2365 b'ui',
2370 b'ui',
2366 b'ssherrorhint',
2371 b'ssherrorhint',
2367 default=None,
2372 default=None,
2368 )
2373 )
2369 coreconfigitem(
2374 coreconfigitem(
2370 b'ui',
2375 b'ui',
2371 b'statuscopies',
2376 b'statuscopies',
2372 default=False,
2377 default=False,
2373 )
2378 )
2374 coreconfigitem(
2379 coreconfigitem(
2375 b'ui',
2380 b'ui',
2376 b'strict',
2381 b'strict',
2377 default=False,
2382 default=False,
2378 )
2383 )
2379 coreconfigitem(
2384 coreconfigitem(
2380 b'ui',
2385 b'ui',
2381 b'style',
2386 b'style',
2382 default=b'',
2387 default=b'',
2383 )
2388 )
2384 coreconfigitem(
2389 coreconfigitem(
2385 b'ui',
2390 b'ui',
2386 b'supportcontact',
2391 b'supportcontact',
2387 default=None,
2392 default=None,
2388 )
2393 )
2389 coreconfigitem(
2394 coreconfigitem(
2390 b'ui',
2395 b'ui',
2391 b'textwidth',
2396 b'textwidth',
2392 default=78,
2397 default=78,
2393 )
2398 )
2394 coreconfigitem(
2399 coreconfigitem(
2395 b'ui',
2400 b'ui',
2396 b'timeout',
2401 b'timeout',
2397 default=b'600',
2402 default=b'600',
2398 )
2403 )
2399 coreconfigitem(
2404 coreconfigitem(
2400 b'ui',
2405 b'ui',
2401 b'timeout.warn',
2406 b'timeout.warn',
2402 default=0,
2407 default=0,
2403 )
2408 )
2404 coreconfigitem(
2409 coreconfigitem(
2405 b'ui',
2410 b'ui',
2406 b'timestamp-output',
2411 b'timestamp-output',
2407 default=False,
2412 default=False,
2408 )
2413 )
2409 coreconfigitem(
2414 coreconfigitem(
2410 b'ui',
2415 b'ui',
2411 b'traceback',
2416 b'traceback',
2412 default=False,
2417 default=False,
2413 )
2418 )
2414 coreconfigitem(
2419 coreconfigitem(
2415 b'ui',
2420 b'ui',
2416 b'tweakdefaults',
2421 b'tweakdefaults',
2417 default=False,
2422 default=False,
2418 )
2423 )
2419 coreconfigitem(b'ui', b'username', alias=[(b'ui', b'user')])
2424 coreconfigitem(b'ui', b'username', alias=[(b'ui', b'user')])
2420 coreconfigitem(
2425 coreconfigitem(
2421 b'ui',
2426 b'ui',
2422 b'verbose',
2427 b'verbose',
2423 default=False,
2428 default=False,
2424 )
2429 )
2425 coreconfigitem(
2430 coreconfigitem(
2426 b'verify',
2431 b'verify',
2427 b'skipflags',
2432 b'skipflags',
2428 default=None,
2433 default=None,
2429 )
2434 )
2430 coreconfigitem(
2435 coreconfigitem(
2431 b'web',
2436 b'web',
2432 b'allowbz2',
2437 b'allowbz2',
2433 default=False,
2438 default=False,
2434 )
2439 )
2435 coreconfigitem(
2440 coreconfigitem(
2436 b'web',
2441 b'web',
2437 b'allowgz',
2442 b'allowgz',
2438 default=False,
2443 default=False,
2439 )
2444 )
2440 coreconfigitem(
2445 coreconfigitem(
2441 b'web',
2446 b'web',
2442 b'allow-pull',
2447 b'allow-pull',
2443 alias=[(b'web', b'allowpull')],
2448 alias=[(b'web', b'allowpull')],
2444 default=True,
2449 default=True,
2445 )
2450 )
2446 coreconfigitem(
2451 coreconfigitem(
2447 b'web',
2452 b'web',
2448 b'allow-push',
2453 b'allow-push',
2449 alias=[(b'web', b'allow_push')],
2454 alias=[(b'web', b'allow_push')],
2450 default=list,
2455 default=list,
2451 )
2456 )
2452 coreconfigitem(
2457 coreconfigitem(
2453 b'web',
2458 b'web',
2454 b'allowzip',
2459 b'allowzip',
2455 default=False,
2460 default=False,
2456 )
2461 )
2457 coreconfigitem(
2462 coreconfigitem(
2458 b'web',
2463 b'web',
2459 b'archivesubrepos',
2464 b'archivesubrepos',
2460 default=False,
2465 default=False,
2461 )
2466 )
2462 coreconfigitem(
2467 coreconfigitem(
2463 b'web',
2468 b'web',
2464 b'cache',
2469 b'cache',
2465 default=True,
2470 default=True,
2466 )
2471 )
2467 coreconfigitem(
2472 coreconfigitem(
2468 b'web',
2473 b'web',
2469 b'comparisoncontext',
2474 b'comparisoncontext',
2470 default=5,
2475 default=5,
2471 )
2476 )
2472 coreconfigitem(
2477 coreconfigitem(
2473 b'web',
2478 b'web',
2474 b'contact',
2479 b'contact',
2475 default=None,
2480 default=None,
2476 )
2481 )
2477 coreconfigitem(
2482 coreconfigitem(
2478 b'web',
2483 b'web',
2479 b'deny_push',
2484 b'deny_push',
2480 default=list,
2485 default=list,
2481 )
2486 )
2482 coreconfigitem(
2487 coreconfigitem(
2483 b'web',
2488 b'web',
2484 b'guessmime',
2489 b'guessmime',
2485 default=False,
2490 default=False,
2486 )
2491 )
2487 coreconfigitem(
2492 coreconfigitem(
2488 b'web',
2493 b'web',
2489 b'hidden',
2494 b'hidden',
2490 default=False,
2495 default=False,
2491 )
2496 )
2492 coreconfigitem(
2497 coreconfigitem(
2493 b'web',
2498 b'web',
2494 b'labels',
2499 b'labels',
2495 default=list,
2500 default=list,
2496 )
2501 )
2497 coreconfigitem(
2502 coreconfigitem(
2498 b'web',
2503 b'web',
2499 b'logoimg',
2504 b'logoimg',
2500 default=b'hglogo.png',
2505 default=b'hglogo.png',
2501 )
2506 )
2502 coreconfigitem(
2507 coreconfigitem(
2503 b'web',
2508 b'web',
2504 b'logourl',
2509 b'logourl',
2505 default=b'https://mercurial-scm.org/',
2510 default=b'https://mercurial-scm.org/',
2506 )
2511 )
2507 coreconfigitem(
2512 coreconfigitem(
2508 b'web',
2513 b'web',
2509 b'accesslog',
2514 b'accesslog',
2510 default=b'-',
2515 default=b'-',
2511 )
2516 )
2512 coreconfigitem(
2517 coreconfigitem(
2513 b'web',
2518 b'web',
2514 b'address',
2519 b'address',
2515 default=b'',
2520 default=b'',
2516 )
2521 )
2517 coreconfigitem(
2522 coreconfigitem(
2518 b'web',
2523 b'web',
2519 b'allow-archive',
2524 b'allow-archive',
2520 alias=[(b'web', b'allow_archive')],
2525 alias=[(b'web', b'allow_archive')],
2521 default=list,
2526 default=list,
2522 )
2527 )
2523 coreconfigitem(
2528 coreconfigitem(
2524 b'web',
2529 b'web',
2525 b'allow_read',
2530 b'allow_read',
2526 default=list,
2531 default=list,
2527 )
2532 )
2528 coreconfigitem(
2533 coreconfigitem(
2529 b'web',
2534 b'web',
2530 b'baseurl',
2535 b'baseurl',
2531 default=None,
2536 default=None,
2532 )
2537 )
2533 coreconfigitem(
2538 coreconfigitem(
2534 b'web',
2539 b'web',
2535 b'cacerts',
2540 b'cacerts',
2536 default=None,
2541 default=None,
2537 )
2542 )
2538 coreconfigitem(
2543 coreconfigitem(
2539 b'web',
2544 b'web',
2540 b'certificate',
2545 b'certificate',
2541 default=None,
2546 default=None,
2542 )
2547 )
2543 coreconfigitem(
2548 coreconfigitem(
2544 b'web',
2549 b'web',
2545 b'collapse',
2550 b'collapse',
2546 default=False,
2551 default=False,
2547 )
2552 )
2548 coreconfigitem(
2553 coreconfigitem(
2549 b'web',
2554 b'web',
2550 b'csp',
2555 b'csp',
2551 default=None,
2556 default=None,
2552 )
2557 )
2553 coreconfigitem(
2558 coreconfigitem(
2554 b'web',
2559 b'web',
2555 b'deny_read',
2560 b'deny_read',
2556 default=list,
2561 default=list,
2557 )
2562 )
2558 coreconfigitem(
2563 coreconfigitem(
2559 b'web',
2564 b'web',
2560 b'descend',
2565 b'descend',
2561 default=True,
2566 default=True,
2562 )
2567 )
2563 coreconfigitem(
2568 coreconfigitem(
2564 b'web',
2569 b'web',
2565 b'description',
2570 b'description',
2566 default=b"",
2571 default=b"",
2567 )
2572 )
2568 coreconfigitem(
2573 coreconfigitem(
2569 b'web',
2574 b'web',
2570 b'encoding',
2575 b'encoding',
2571 default=lambda: encoding.encoding,
2576 default=lambda: encoding.encoding,
2572 )
2577 )
2573 coreconfigitem(
2578 coreconfigitem(
2574 b'web',
2579 b'web',
2575 b'errorlog',
2580 b'errorlog',
2576 default=b'-',
2581 default=b'-',
2577 )
2582 )
2578 coreconfigitem(
2583 coreconfigitem(
2579 b'web',
2584 b'web',
2580 b'ipv6',
2585 b'ipv6',
2581 default=False,
2586 default=False,
2582 )
2587 )
2583 coreconfigitem(
2588 coreconfigitem(
2584 b'web',
2589 b'web',
2585 b'maxchanges',
2590 b'maxchanges',
2586 default=10,
2591 default=10,
2587 )
2592 )
2588 coreconfigitem(
2593 coreconfigitem(
2589 b'web',
2594 b'web',
2590 b'maxfiles',
2595 b'maxfiles',
2591 default=10,
2596 default=10,
2592 )
2597 )
2593 coreconfigitem(
2598 coreconfigitem(
2594 b'web',
2599 b'web',
2595 b'maxshortchanges',
2600 b'maxshortchanges',
2596 default=60,
2601 default=60,
2597 )
2602 )
2598 coreconfigitem(
2603 coreconfigitem(
2599 b'web',
2604 b'web',
2600 b'motd',
2605 b'motd',
2601 default=b'',
2606 default=b'',
2602 )
2607 )
2603 coreconfigitem(
2608 coreconfigitem(
2604 b'web',
2609 b'web',
2605 b'name',
2610 b'name',
2606 default=dynamicdefault,
2611 default=dynamicdefault,
2607 )
2612 )
2608 coreconfigitem(
2613 coreconfigitem(
2609 b'web',
2614 b'web',
2610 b'port',
2615 b'port',
2611 default=8000,
2616 default=8000,
2612 )
2617 )
2613 coreconfigitem(
2618 coreconfigitem(
2614 b'web',
2619 b'web',
2615 b'prefix',
2620 b'prefix',
2616 default=b'',
2621 default=b'',
2617 )
2622 )
2618 coreconfigitem(
2623 coreconfigitem(
2619 b'web',
2624 b'web',
2620 b'push_ssl',
2625 b'push_ssl',
2621 default=True,
2626 default=True,
2622 )
2627 )
2623 coreconfigitem(
2628 coreconfigitem(
2624 b'web',
2629 b'web',
2625 b'refreshinterval',
2630 b'refreshinterval',
2626 default=20,
2631 default=20,
2627 )
2632 )
2628 coreconfigitem(
2633 coreconfigitem(
2629 b'web',
2634 b'web',
2630 b'server-header',
2635 b'server-header',
2631 default=None,
2636 default=None,
2632 )
2637 )
2633 coreconfigitem(
2638 coreconfigitem(
2634 b'web',
2639 b'web',
2635 b'static',
2640 b'static',
2636 default=None,
2641 default=None,
2637 )
2642 )
2638 coreconfigitem(
2643 coreconfigitem(
2639 b'web',
2644 b'web',
2640 b'staticurl',
2645 b'staticurl',
2641 default=None,
2646 default=None,
2642 )
2647 )
2643 coreconfigitem(
2648 coreconfigitem(
2644 b'web',
2649 b'web',
2645 b'stripes',
2650 b'stripes',
2646 default=1,
2651 default=1,
2647 )
2652 )
2648 coreconfigitem(
2653 coreconfigitem(
2649 b'web',
2654 b'web',
2650 b'style',
2655 b'style',
2651 default=b'paper',
2656 default=b'paper',
2652 )
2657 )
2653 coreconfigitem(
2658 coreconfigitem(
2654 b'web',
2659 b'web',
2655 b'templates',
2660 b'templates',
2656 default=None,
2661 default=None,
2657 )
2662 )
2658 coreconfigitem(
2663 coreconfigitem(
2659 b'web',
2664 b'web',
2660 b'view',
2665 b'view',
2661 default=b'served',
2666 default=b'served',
2662 experimental=True,
2667 experimental=True,
2663 )
2668 )
2664 coreconfigitem(
2669 coreconfigitem(
2665 b'worker',
2670 b'worker',
2666 b'backgroundclose',
2671 b'backgroundclose',
2667 default=dynamicdefault,
2672 default=dynamicdefault,
2668 )
2673 )
2669 # Windows defaults to a limit of 512 open files. A buffer of 128
2674 # Windows defaults to a limit of 512 open files. A buffer of 128
2670 # should give us enough headway.
2675 # should give us enough headway.
2671 coreconfigitem(
2676 coreconfigitem(
2672 b'worker',
2677 b'worker',
2673 b'backgroundclosemaxqueue',
2678 b'backgroundclosemaxqueue',
2674 default=384,
2679 default=384,
2675 )
2680 )
2676 coreconfigitem(
2681 coreconfigitem(
2677 b'worker',
2682 b'worker',
2678 b'backgroundcloseminfilecount',
2683 b'backgroundcloseminfilecount',
2679 default=2048,
2684 default=2048,
2680 )
2685 )
2681 coreconfigitem(
2686 coreconfigitem(
2682 b'worker',
2687 b'worker',
2683 b'backgroundclosethreadcount',
2688 b'backgroundclosethreadcount',
2684 default=4,
2689 default=4,
2685 )
2690 )
2686 coreconfigitem(
2691 coreconfigitem(
2687 b'worker',
2692 b'worker',
2688 b'enabled',
2693 b'enabled',
2689 default=True,
2694 default=True,
2690 )
2695 )
2691 coreconfigitem(
2696 coreconfigitem(
2692 b'worker',
2697 b'worker',
2693 b'numcpus',
2698 b'numcpus',
2694 default=None,
2699 default=None,
2695 )
2700 )
2696
2701
2697 # Rebase related configuration moved to core because other extension are doing
2702 # Rebase related configuration moved to core because other extension are doing
2698 # strange things. For example, shelve import the extensions to reuse some bit
2703 # strange things. For example, shelve import the extensions to reuse some bit
2699 # without formally loading it.
2704 # without formally loading it.
2700 coreconfigitem(
2705 coreconfigitem(
2701 b'commands',
2706 b'commands',
2702 b'rebase.requiredest',
2707 b'rebase.requiredest',
2703 default=False,
2708 default=False,
2704 )
2709 )
2705 coreconfigitem(
2710 coreconfigitem(
2706 b'experimental',
2711 b'experimental',
2707 b'rebaseskipobsolete',
2712 b'rebaseskipobsolete',
2708 default=True,
2713 default=True,
2709 )
2714 )
2710 coreconfigitem(
2715 coreconfigitem(
2711 b'rebase',
2716 b'rebase',
2712 b'singletransaction',
2717 b'singletransaction',
2713 default=False,
2718 default=False,
2714 )
2719 )
2715 coreconfigitem(
2720 coreconfigitem(
2716 b'rebase',
2721 b'rebase',
2717 b'experimental.inmemory',
2722 b'experimental.inmemory',
2718 default=False,
2723 default=False,
2719 )
2724 )
@@ -1,577 +1,597 b''
1 # hgweb/hgwebdir_mod.py - Web interface for a directory of repositories.
1 # hgweb/hgwebdir_mod.py - Web interface for a directory of repositories.
2 #
2 #
3 # Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
3 # Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
4 # Copyright 2005, 2006 Olivia Mackall <olivia@selenic.com>
4 # Copyright 2005, 2006 Olivia Mackall <olivia@selenic.com>
5 #
5 #
6 # This software may be used and distributed according to the terms of the
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version.
7 # GNU General Public License version 2 or any later version.
8
8
9 from __future__ import absolute_import
9 from __future__ import absolute_import
10
10
11 import gc
11 import gc
12 import os
12 import os
13 import time
13 import time
14
14
15 from ..i18n import _
15 from ..i18n import _
16
16
17 from .common import (
17 from .common import (
18 ErrorResponse,
18 ErrorResponse,
19 HTTP_SERVER_ERROR,
19 HTTP_SERVER_ERROR,
20 cspvalues,
20 cspvalues,
21 get_contact,
21 get_contact,
22 get_mtime,
22 get_mtime,
23 ismember,
23 ismember,
24 paritygen,
24 paritygen,
25 staticfile,
25 staticfile,
26 statusmessage,
26 statusmessage,
27 )
27 )
28
28
29 from .. import (
29 from .. import (
30 configitems,
30 configitems,
31 encoding,
31 encoding,
32 error,
32 error,
33 extensions,
33 extensions,
34 hg,
34 hg,
35 pathutil,
35 pathutil,
36 profiling,
36 profiling,
37 pycompat,
37 pycompat,
38 rcutil,
38 rcutil,
39 registrar,
39 registrar,
40 scmutil,
40 scmutil,
41 templater,
41 templater,
42 templateutil,
42 templateutil,
43 ui as uimod,
43 ui as uimod,
44 util,
44 util,
45 )
45 )
46
46
47 from . import (
47 from . import (
48 hgweb_mod,
48 hgweb_mod,
49 request as requestmod,
49 request as requestmod,
50 webutil,
50 webutil,
51 wsgicgi,
51 wsgicgi,
52 )
52 )
53 from ..utils import dateutil
53 from ..utils import dateutil
54
54
55
55
56 def cleannames(items):
56 def cleannames(items):
57 return [(util.pconvert(name).strip(b'/'), path) for name, path in items]
57 return [(util.pconvert(name).strip(b'/'), path) for name, path in items]
58
58
59
59
60 def findrepos(paths):
60 def findrepos(paths):
61 repos = []
61 repos = []
62 for prefix, root in cleannames(paths):
62 for prefix, root in cleannames(paths):
63 roothead, roottail = os.path.split(root)
63 roothead, roottail = os.path.split(root)
64 # "foo = /bar/*" or "foo = /bar/**" lets every repo /bar/N in or below
64 # "foo = /bar/*" or "foo = /bar/**" lets every repo /bar/N in or below
65 # /bar/ be served as as foo/N .
65 # /bar/ be served as as foo/N .
66 # '*' will not search inside dirs with .hg (except .hg/patches),
66 # '*' will not search inside dirs with .hg (except .hg/patches),
67 # '**' will search inside dirs with .hg (and thus also find subrepos).
67 # '**' will search inside dirs with .hg (and thus also find subrepos).
68 try:
68 try:
69 recurse = {b'*': False, b'**': True}[roottail]
69 recurse = {b'*': False, b'**': True}[roottail]
70 except KeyError:
70 except KeyError:
71 repos.append((prefix, root))
71 repos.append((prefix, root))
72 continue
72 continue
73 roothead = os.path.normpath(util.abspath(roothead))
73 roothead = os.path.normpath(util.abspath(roothead))
74 paths = scmutil.walkrepos(roothead, followsym=True, recurse=recurse)
74 paths = scmutil.walkrepos(roothead, followsym=True, recurse=recurse)
75 repos.extend(urlrepos(prefix, roothead, paths))
75 repos.extend(urlrepos(prefix, roothead, paths))
76 return repos
76 return repos
77
77
78
78
79 def urlrepos(prefix, roothead, paths):
79 def urlrepos(prefix, roothead, paths):
80 """yield url paths and filesystem paths from a list of repo paths
80 """yield url paths and filesystem paths from a list of repo paths
81
81
82 >>> conv = lambda seq: [(v, util.pconvert(p)) for v,p in seq]
82 >>> conv = lambda seq: [(v, util.pconvert(p)) for v,p in seq]
83 >>> conv(urlrepos(b'hg', b'/opt', [b'/opt/r', b'/opt/r/r', b'/opt']))
83 >>> conv(urlrepos(b'hg', b'/opt', [b'/opt/r', b'/opt/r/r', b'/opt']))
84 [('hg/r', '/opt/r'), ('hg/r/r', '/opt/r/r'), ('hg', '/opt')]
84 [('hg/r', '/opt/r'), ('hg/r/r', '/opt/r/r'), ('hg', '/opt')]
85 >>> conv(urlrepos(b'', b'/opt', [b'/opt/r', b'/opt/r/r', b'/opt']))
85 >>> conv(urlrepos(b'', b'/opt', [b'/opt/r', b'/opt/r/r', b'/opt']))
86 [('r', '/opt/r'), ('r/r', '/opt/r/r'), ('', '/opt')]
86 [('r', '/opt/r'), ('r/r', '/opt/r/r'), ('', '/opt')]
87 """
87 """
88 for path in paths:
88 for path in paths:
89 path = os.path.normpath(path)
89 path = os.path.normpath(path)
90 yield (
90 yield (
91 prefix + b'/' + util.pconvert(path[len(roothead) :]).lstrip(b'/')
91 prefix + b'/' + util.pconvert(path[len(roothead) :]).lstrip(b'/')
92 ).strip(b'/'), path
92 ).strip(b'/'), path
93
93
94
94
95 def readallowed(ui, req):
95 def readallowed(ui, req):
96 """Check allow_read and deny_read config options of a repo's ui object
96 """Check allow_read and deny_read config options of a repo's ui object
97 to determine user permissions. By default, with neither option set (or
97 to determine user permissions. By default, with neither option set (or
98 both empty), allow all users to read the repo. There are two ways a
98 both empty), allow all users to read the repo. There are two ways a
99 user can be denied read access: (1) deny_read is not empty, and the
99 user can be denied read access: (1) deny_read is not empty, and the
100 user is unauthenticated or deny_read contains user (or *), and (2)
100 user is unauthenticated or deny_read contains user (or *), and (2)
101 allow_read is not empty and the user is not in allow_read. Return True
101 allow_read is not empty and the user is not in allow_read. Return True
102 if user is allowed to read the repo, else return False."""
102 if user is allowed to read the repo, else return False."""
103
103
104 user = req.remoteuser
104 user = req.remoteuser
105
105
106 deny_read = ui.configlist(b'web', b'deny_read', untrusted=True)
106 deny_read = ui.configlist(b'web', b'deny_read', untrusted=True)
107 if deny_read and (not user or ismember(ui, user, deny_read)):
107 if deny_read and (not user or ismember(ui, user, deny_read)):
108 return False
108 return False
109
109
110 allow_read = ui.configlist(b'web', b'allow_read', untrusted=True)
110 allow_read = ui.configlist(b'web', b'allow_read', untrusted=True)
111 # by default, allow reading if no allow_read option has been set
111 # by default, allow reading if no allow_read option has been set
112 if not allow_read or ismember(ui, user, allow_read):
112 if not allow_read or ismember(ui, user, allow_read):
113 return True
113 return True
114
114
115 return False
115 return False
116
116
117
117
118 def rawindexentries(ui, repos, req, subdir=b''):
118 def rawindexentries(ui, repos, req, subdir=b''):
119 descend = ui.configbool(b'web', b'descend')
119 descend = ui.configbool(b'web', b'descend')
120 collapse = ui.configbool(b'web', b'collapse')
120 collapse = ui.configbool(b'web', b'collapse')
121 seenrepos = set()
121 seenrepos = set()
122 seendirs = set()
122 seendirs = set()
123 for name, path in repos:
123 for name, path in repos:
124
124
125 if not name.startswith(subdir):
125 if not name.startswith(subdir):
126 continue
126 continue
127 name = name[len(subdir) :]
127 name = name[len(subdir) :]
128 directory = False
128 directory = False
129
129
130 if b'/' in name:
130 if b'/' in name:
131 if not descend:
131 if not descend:
132 continue
132 continue
133
133
134 nameparts = name.split(b'/')
134 nameparts = name.split(b'/')
135 rootname = nameparts[0]
135 rootname = nameparts[0]
136
136
137 if not collapse:
137 if not collapse:
138 pass
138 pass
139 elif rootname in seendirs:
139 elif rootname in seendirs:
140 continue
140 continue
141 elif rootname in seenrepos:
141 elif rootname in seenrepos:
142 pass
142 pass
143 else:
143 else:
144 directory = True
144 directory = True
145 name = rootname
145 name = rootname
146
146
147 # redefine the path to refer to the directory
147 # redefine the path to refer to the directory
148 discarded = b'/'.join(nameparts[1:])
148 discarded = b'/'.join(nameparts[1:])
149
149
150 # remove name parts plus accompanying slash
150 # remove name parts plus accompanying slash
151 path = path[: -len(discarded) - 1]
151 path = path[: -len(discarded) - 1]
152
152
153 try:
153 try:
154 hg.repository(ui, path)
154 hg.repository(ui, path)
155 directory = False
155 directory = False
156 except (IOError, error.RepoError):
156 except (IOError, error.RepoError):
157 pass
157 pass
158
158
159 parts = [
159 parts = [
160 req.apppath.strip(b'/'),
160 req.apppath.strip(b'/'),
161 subdir.strip(b'/'),
161 subdir.strip(b'/'),
162 name.strip(b'/'),
162 name.strip(b'/'),
163 ]
163 ]
164 url = b'/' + b'/'.join(p for p in parts if p) + b'/'
164 url = b'/' + b'/'.join(p for p in parts if p) + b'/'
165
165
166 # show either a directory entry or a repository
166 # show either a directory entry or a repository
167 if directory:
167 if directory:
168 # get the directory's time information
168 # get the directory's time information
169 try:
169 try:
170 d = (get_mtime(path), dateutil.makedate()[1])
170 d = (get_mtime(path), dateutil.makedate()[1])
171 except OSError:
171 except OSError:
172 continue
172 continue
173
173
174 # add '/' to the name to make it obvious that
174 # add '/' to the name to make it obvious that
175 # the entry is a directory, not a regular repository
175 # the entry is a directory, not a regular repository
176 row = {
176 row = {
177 b'contact': b"",
177 b'contact': b"",
178 b'contact_sort': b"",
178 b'contact_sort': b"",
179 b'name': name + b'/',
179 b'name': name + b'/',
180 b'name_sort': name,
180 b'name_sort': name,
181 b'url': url,
181 b'url': url,
182 b'description': b"",
182 b'description': b"",
183 b'description_sort': b"",
183 b'description_sort': b"",
184 b'lastchange': d,
184 b'lastchange': d,
185 b'lastchange_sort': d[1] - d[0],
185 b'lastchange_sort': d[1] - d[0],
186 b'archives': templateutil.mappinglist([]),
186 b'archives': templateutil.mappinglist([]),
187 b'isdirectory': True,
187 b'isdirectory': True,
188 b'labels': templateutil.hybridlist([], name=b'label'),
188 b'labels': templateutil.hybridlist([], name=b'label'),
189 }
189 }
190
190
191 seendirs.add(name)
191 seendirs.add(name)
192 yield row
192 yield row
193 continue
193 continue
194
194
195 u = ui.copy()
195 u = ui.copy()
196 if rcutil.use_repo_hgrc():
196 if rcutil.use_repo_hgrc():
197 try:
197 try:
198 u.readconfig(os.path.join(path, b'.hg', b'hgrc'))
198 u.readconfig(os.path.join(path, b'.hg', b'hgrc'))
199 except Exception as e:
199 except Exception as e:
200 u.warn(_(b'error reading %s/.hg/hgrc: %s\n') % (path, e))
200 u.warn(_(b'error reading %s/.hg/hgrc: %s\n') % (path, e))
201 continue
201 continue
202
202
203 def get(section, name, default=uimod._unset):
203 def get(section, name, default=uimod._unset):
204 return u.config(section, name, default, untrusted=True)
204 return u.config(section, name, default, untrusted=True)
205
205
206 if u.configbool(b"web", b"hidden", untrusted=True):
206 if u.configbool(b"web", b"hidden", untrusted=True):
207 continue
207 continue
208
208
209 if not readallowed(u, req):
209 if not readallowed(u, req):
210 continue
210 continue
211
211
212 # update time with local timezone
212 # update time with local timezone
213 try:
213 try:
214 r = hg.repository(ui, path)
214 r = hg.repository(ui, path)
215 except IOError:
215 except IOError:
216 u.warn(_(b'error accessing repository at %s\n') % path)
216 u.warn(_(b'error accessing repository at %s\n') % path)
217 continue
217 continue
218 except error.RepoError:
218 except error.RepoError:
219 u.warn(_(b'error accessing repository at %s\n') % path)
219 u.warn(_(b'error accessing repository at %s\n') % path)
220 continue
220 continue
221 try:
221 try:
222 d = (get_mtime(r.spath), dateutil.makedate()[1])
222 d = (get_mtime(r.spath), dateutil.makedate()[1])
223 except OSError:
223 except OSError:
224 continue
224 continue
225
225
226 contact = get_contact(get)
226 contact = get_contact(get)
227 description = get(b"web", b"description")
227 description = get(b"web", b"description")
228 seenrepos.add(name)
228 seenrepos.add(name)
229 name = get(b"web", b"name", name)
229 name = get(b"web", b"name", name)
230 labels = u.configlist(b'web', b'labels', untrusted=True)
230 labels = u.configlist(b'web', b'labels', untrusted=True)
231 row = {
231 row = {
232 b'contact': contact or b"unknown",
232 b'contact': contact or b"unknown",
233 b'contact_sort': contact.upper() or b"unknown",
233 b'contact_sort': contact.upper() or b"unknown",
234 b'name': name,
234 b'name': name,
235 b'name_sort': name,
235 b'name_sort': name,
236 b'url': url,
236 b'url': url,
237 b'description': description or b"unknown",
237 b'description': description or b"unknown",
238 b'description_sort': description.upper() or b"unknown",
238 b'description_sort': description.upper() or b"unknown",
239 b'lastchange': d,
239 b'lastchange': d,
240 b'lastchange_sort': d[1] - d[0],
240 b'lastchange_sort': d[1] - d[0],
241 b'archives': webutil.archivelist(u, b"tip", url),
241 b'archives': webutil.archivelist(u, b"tip", url),
242 b'isdirectory': None,
242 b'isdirectory': None,
243 b'labels': templateutil.hybridlist(labels, name=b'label'),
243 b'labels': templateutil.hybridlist(labels, name=b'label'),
244 }
244 }
245
245
246 yield row
246 yield row
247
247
248
248
249 def _indexentriesgen(
249 def _indexentriesgen(
250 context, ui, repos, req, stripecount, sortcolumn, descending, subdir
250 context, ui, repos, req, stripecount, sortcolumn, descending, subdir
251 ):
251 ):
252 rows = rawindexentries(ui, repos, req, subdir=subdir)
252 rows = rawindexentries(ui, repos, req, subdir=subdir)
253
253
254 sortdefault = None, False
254 sortdefault = None, False
255
255
256 if sortcolumn and sortdefault != (sortcolumn, descending):
256 if sortcolumn and sortdefault != (sortcolumn, descending):
257 sortkey = b'%s_sort' % sortcolumn
257 sortkey = b'%s_sort' % sortcolumn
258 rows = sorted(rows, key=lambda x: x[sortkey], reverse=descending)
258 rows = sorted(rows, key=lambda x: x[sortkey], reverse=descending)
259
259
260 for row, parity in zip(rows, paritygen(stripecount)):
260 for row, parity in zip(rows, paritygen(stripecount)):
261 row[b'parity'] = parity
261 row[b'parity'] = parity
262 yield row
262 yield row
263
263
264
264
265 def indexentries(
265 def indexentries(
266 ui, repos, req, stripecount, sortcolumn=b'', descending=False, subdir=b''
266 ui, repos, req, stripecount, sortcolumn=b'', descending=False, subdir=b''
267 ):
267 ):
268 args = (ui, repos, req, stripecount, sortcolumn, descending, subdir)
268 args = (ui, repos, req, stripecount, sortcolumn, descending, subdir)
269 return templateutil.mappinggenerator(_indexentriesgen, args=args)
269 return templateutil.mappinggenerator(_indexentriesgen, args=args)
270
270
271
271
272 class hgwebdir(object):
272 class hgwebdir(object):
273 """HTTP server for multiple repositories.
273 """HTTP server for multiple repositories.
274
274
275 Given a configuration, different repositories will be served depending
275 Given a configuration, different repositories will be served depending
276 on the request path.
276 on the request path.
277
277
278 Instances are typically used as WSGI applications.
278 Instances are typically used as WSGI applications.
279 """
279 """
280
280
281 def __init__(self, conf, baseui=None):
281 def __init__(self, conf, baseui=None):
282 self.conf = conf
282 self.conf = conf
283 self.baseui = baseui
283 self.baseui = baseui
284 self.ui = None
284 self.ui = None
285 self.lastrefresh = 0
285 self.lastrefresh = 0
286 self.motd = None
286 self.motd = None
287 self.refresh()
287 self.refresh()
288 self.requests_count = 0
288 if not baseui:
289 if not baseui:
289 # set up environment for new ui
290 # set up environment for new ui
290 extensions.loadall(self.ui)
291 extensions.loadall(self.ui)
291 extensions.populateui(self.ui)
292 extensions.populateui(self.ui)
292
293
293 def refresh(self):
294 def refresh(self):
294 if self.ui:
295 if self.ui:
295 refreshinterval = self.ui.configint(b'web', b'refreshinterval')
296 refreshinterval = self.ui.configint(b'web', b'refreshinterval')
296 else:
297 else:
297 item = configitems.coreitems[b'web'][b'refreshinterval']
298 item = configitems.coreitems[b'web'][b'refreshinterval']
298 refreshinterval = item.default
299 refreshinterval = item.default
299
300
300 # refreshinterval <= 0 means to always refresh.
301 # refreshinterval <= 0 means to always refresh.
301 if (
302 if (
302 refreshinterval > 0
303 refreshinterval > 0
303 and self.lastrefresh + refreshinterval > time.time()
304 and self.lastrefresh + refreshinterval > time.time()
304 ):
305 ):
305 return
306 return
306
307
307 if self.baseui:
308 if self.baseui:
308 u = self.baseui.copy()
309 u = self.baseui.copy()
309 else:
310 else:
310 u = uimod.ui.load()
311 u = uimod.ui.load()
311 u.setconfig(b'ui', b'report_untrusted', b'off', b'hgwebdir')
312 u.setconfig(b'ui', b'report_untrusted', b'off', b'hgwebdir')
312 u.setconfig(b'ui', b'nontty', b'true', b'hgwebdir')
313 u.setconfig(b'ui', b'nontty', b'true', b'hgwebdir')
313 # displaying bundling progress bar while serving feels wrong and may
314 # displaying bundling progress bar while serving feels wrong and may
314 # break some wsgi implementations.
315 # break some wsgi implementations.
315 u.setconfig(b'progress', b'disable', b'true', b'hgweb')
316 u.setconfig(b'progress', b'disable', b'true', b'hgweb')
316
317
317 if not isinstance(self.conf, (dict, list, tuple)):
318 if not isinstance(self.conf, (dict, list, tuple)):
318 map = {b'paths': b'hgweb-paths'}
319 map = {b'paths': b'hgweb-paths'}
319 if not os.path.exists(self.conf):
320 if not os.path.exists(self.conf):
320 raise error.Abort(_(b'config file %s not found!') % self.conf)
321 raise error.Abort(_(b'config file %s not found!') % self.conf)
321 u.readconfig(self.conf, remap=map, trust=True)
322 u.readconfig(self.conf, remap=map, trust=True)
322 paths = []
323 paths = []
323 for name, ignored in u.configitems(b'hgweb-paths'):
324 for name, ignored in u.configitems(b'hgweb-paths'):
324 for path in u.configlist(b'hgweb-paths', name):
325 for path in u.configlist(b'hgweb-paths', name):
325 paths.append((name, path))
326 paths.append((name, path))
326 elif isinstance(self.conf, (list, tuple)):
327 elif isinstance(self.conf, (list, tuple)):
327 paths = self.conf
328 paths = self.conf
328 elif isinstance(self.conf, dict):
329 elif isinstance(self.conf, dict):
329 paths = self.conf.items()
330 paths = self.conf.items()
330 extensions.populateui(u)
331 extensions.populateui(u)
331
332
332 repos = findrepos(paths)
333 repos = findrepos(paths)
333 for prefix, root in u.configitems(b'collections'):
334 for prefix, root in u.configitems(b'collections'):
334 prefix = util.pconvert(prefix)
335 prefix = util.pconvert(prefix)
335 for path in scmutil.walkrepos(root, followsym=True):
336 for path in scmutil.walkrepos(root, followsym=True):
336 repo = os.path.normpath(path)
337 repo = os.path.normpath(path)
337 name = util.pconvert(repo)
338 name = util.pconvert(repo)
338 if name.startswith(prefix):
339 if name.startswith(prefix):
339 name = name[len(prefix) :]
340 name = name[len(prefix) :]
340 repos.append((name.lstrip(b'/'), repo))
341 repos.append((name.lstrip(b'/'), repo))
341
342
342 self.repos = repos
343 self.repos = repos
343 self.ui = u
344 self.ui = u
345 self.gc_full_collect_rate = self.ui.configint(
346 b'experimental', b'web.full-garbage-collection-rate'
347 )
348 self.gc_full_collections_done = 0
344 encoding.encoding = self.ui.config(b'web', b'encoding')
349 encoding.encoding = self.ui.config(b'web', b'encoding')
345 self.style = self.ui.config(b'web', b'style')
350 self.style = self.ui.config(b'web', b'style')
346 self.templatepath = self.ui.config(
351 self.templatepath = self.ui.config(
347 b'web', b'templates', untrusted=False
352 b'web', b'templates', untrusted=False
348 )
353 )
349 self.stripecount = self.ui.config(b'web', b'stripes')
354 self.stripecount = self.ui.config(b'web', b'stripes')
350 if self.stripecount:
355 if self.stripecount:
351 self.stripecount = int(self.stripecount)
356 self.stripecount = int(self.stripecount)
352 prefix = self.ui.config(b'web', b'prefix')
357 prefix = self.ui.config(b'web', b'prefix')
353 if prefix.startswith(b'/'):
358 if prefix.startswith(b'/'):
354 prefix = prefix[1:]
359 prefix = prefix[1:]
355 if prefix.endswith(b'/'):
360 if prefix.endswith(b'/'):
356 prefix = prefix[:-1]
361 prefix = prefix[:-1]
357 self.prefix = prefix
362 self.prefix = prefix
358 self.lastrefresh = time.time()
363 self.lastrefresh = time.time()
359
364
360 def run(self):
365 def run(self):
361 if not encoding.environ.get(b'GATEWAY_INTERFACE', b'').startswith(
366 if not encoding.environ.get(b'GATEWAY_INTERFACE', b'').startswith(
362 b"CGI/1."
367 b"CGI/1."
363 ):
368 ):
364 raise RuntimeError(
369 raise RuntimeError(
365 b"This function is only intended to be "
370 b"This function is only intended to be "
366 b"called while running as a CGI script."
371 b"called while running as a CGI script."
367 )
372 )
368 wsgicgi.launch(self)
373 wsgicgi.launch(self)
369
374
370 def __call__(self, env, respond):
375 def __call__(self, env, respond):
371 baseurl = self.ui.config(b'web', b'baseurl')
376 baseurl = self.ui.config(b'web', b'baseurl')
372 req = requestmod.parserequestfromenv(env, altbaseurl=baseurl)
377 req = requestmod.parserequestfromenv(env, altbaseurl=baseurl)
373 res = requestmod.wsgiresponse(req, respond)
378 res = requestmod.wsgiresponse(req, respond)
374
379
375 return self.run_wsgi(req, res)
380 return self.run_wsgi(req, res)
376
381
377 def run_wsgi(self, req, res):
382 def run_wsgi(self, req, res):
378 profile = self.ui.configbool(b'profiling', b'enabled')
383 profile = self.ui.configbool(b'profiling', b'enabled')
379 with profiling.profile(self.ui, enabled=profile):
384 with profiling.profile(self.ui, enabled=profile):
380 try:
385 try:
381 for r in self._runwsgi(req, res):
386 for r in self._runwsgi(req, res):
382 yield r
387 yield r
383 finally:
388 finally:
384 # There are known cycles in localrepository that prevent
389 # There are known cycles in localrepository that prevent
385 # those objects (and tons of held references) from being
390 # those objects (and tons of held references) from being
386 # collected through normal refcounting. We mitigate those
391 # collected through normal refcounting.
387 # leaks by performing an explicit GC on every request.
392 # In some cases, the resulting memory consumption can
388 # TODO remove this once leaks are fixed.
393 # be tamed by performing explicit garbage collections.
389 # TODO only run this on requests that create localrepository
394 # In presence of actual leaks or big long-lived caches, the
390 # instances instead of every request.
395 # impact on performance of such collections can become a
391 gc.collect()
396 # problem, hence the rate shouldn't be set too low.
397 # See "Collecting the oldest generation" in
398 # https://devguide.python.org/garbage_collector
399 # for more about such trade-offs.
400 rate = self.gc_full_collect_rate
401
402 # this is not thread safe, but the consequence (skipping
403 # a garbage collection) is arguably better than risking
404 # to have several threads perform a collection in parallel
405 # (long useless wait on all threads).
406 self.requests_count += 1
407 if rate > 0 and self.requests_count % rate == 0:
408 gc.collect()
409 self.gc_full_collections_done += 1
410 else:
411 gc.collect(generation=1)
392
412
393 def _runwsgi(self, req, res):
413 def _runwsgi(self, req, res):
394 try:
414 try:
395 self.refresh()
415 self.refresh()
396
416
397 csp, nonce = cspvalues(self.ui)
417 csp, nonce = cspvalues(self.ui)
398 if csp:
418 if csp:
399 res.headers[b'Content-Security-Policy'] = csp
419 res.headers[b'Content-Security-Policy'] = csp
400
420
401 virtual = req.dispatchpath.strip(b'/')
421 virtual = req.dispatchpath.strip(b'/')
402 tmpl = self.templater(req, nonce)
422 tmpl = self.templater(req, nonce)
403 ctype = tmpl.render(b'mimetype', {b'encoding': encoding.encoding})
423 ctype = tmpl.render(b'mimetype', {b'encoding': encoding.encoding})
404
424
405 # Global defaults. These can be overridden by any handler.
425 # Global defaults. These can be overridden by any handler.
406 res.status = b'200 Script output follows'
426 res.status = b'200 Script output follows'
407 res.headers[b'Content-Type'] = ctype
427 res.headers[b'Content-Type'] = ctype
408
428
409 # a static file
429 # a static file
410 if virtual.startswith(b'static/') or b'static' in req.qsparams:
430 if virtual.startswith(b'static/') or b'static' in req.qsparams:
411 if virtual.startswith(b'static/'):
431 if virtual.startswith(b'static/'):
412 fname = virtual[7:]
432 fname = virtual[7:]
413 else:
433 else:
414 fname = req.qsparams[b'static']
434 fname = req.qsparams[b'static']
415 static = self.ui.config(b"web", b"static", untrusted=False)
435 static = self.ui.config(b"web", b"static", untrusted=False)
416 staticfile(self.templatepath, static, fname, res)
436 staticfile(self.templatepath, static, fname, res)
417 return res.sendresponse()
437 return res.sendresponse()
418
438
419 # top-level index
439 # top-level index
420
440
421 repos = dict(self.repos)
441 repos = dict(self.repos)
422
442
423 if (not virtual or virtual == b'index') and virtual not in repos:
443 if (not virtual or virtual == b'index') and virtual not in repos:
424 return self.makeindex(req, res, tmpl)
444 return self.makeindex(req, res, tmpl)
425
445
426 # nested indexes and hgwebs
446 # nested indexes and hgwebs
427
447
428 if virtual.endswith(b'/index') and virtual not in repos:
448 if virtual.endswith(b'/index') and virtual not in repos:
429 subdir = virtual[: -len(b'index')]
449 subdir = virtual[: -len(b'index')]
430 if any(r.startswith(subdir) for r in repos):
450 if any(r.startswith(subdir) for r in repos):
431 return self.makeindex(req, res, tmpl, subdir)
451 return self.makeindex(req, res, tmpl, subdir)
432
452
433 def _virtualdirs():
453 def _virtualdirs():
434 # Check the full virtual path, and each parent
454 # Check the full virtual path, and each parent
435 yield virtual
455 yield virtual
436 for p in pathutil.finddirs(virtual):
456 for p in pathutil.finddirs(virtual):
437 yield p
457 yield p
438
458
439 for virtualrepo in _virtualdirs():
459 for virtualrepo in _virtualdirs():
440 real = repos.get(virtualrepo)
460 real = repos.get(virtualrepo)
441 if real:
461 if real:
442 # Re-parse the WSGI environment to take into account our
462 # Re-parse the WSGI environment to take into account our
443 # repository path component.
463 # repository path component.
444 uenv = req.rawenv
464 uenv = req.rawenv
445 if pycompat.ispy3:
465 if pycompat.ispy3:
446 uenv = {
466 uenv = {
447 k.decode('latin1'): v
467 k.decode('latin1'): v
448 for k, v in pycompat.iteritems(uenv)
468 for k, v in pycompat.iteritems(uenv)
449 }
469 }
450 req = requestmod.parserequestfromenv(
470 req = requestmod.parserequestfromenv(
451 uenv,
471 uenv,
452 reponame=virtualrepo,
472 reponame=virtualrepo,
453 altbaseurl=self.ui.config(b'web', b'baseurl'),
473 altbaseurl=self.ui.config(b'web', b'baseurl'),
454 # Reuse wrapped body file object otherwise state
474 # Reuse wrapped body file object otherwise state
455 # tracking can get confused.
475 # tracking can get confused.
456 bodyfh=req.bodyfh,
476 bodyfh=req.bodyfh,
457 )
477 )
458 try:
478 try:
459 # ensure caller gets private copy of ui
479 # ensure caller gets private copy of ui
460 repo = hg.repository(self.ui.copy(), real)
480 repo = hg.repository(self.ui.copy(), real)
461 return hgweb_mod.hgweb(repo).run_wsgi(req, res)
481 return hgweb_mod.hgweb(repo).run_wsgi(req, res)
462 except IOError as inst:
482 except IOError as inst:
463 msg = encoding.strtolocal(inst.strerror)
483 msg = encoding.strtolocal(inst.strerror)
464 raise ErrorResponse(HTTP_SERVER_ERROR, msg)
484 raise ErrorResponse(HTTP_SERVER_ERROR, msg)
465 except error.RepoError as inst:
485 except error.RepoError as inst:
466 raise ErrorResponse(HTTP_SERVER_ERROR, bytes(inst))
486 raise ErrorResponse(HTTP_SERVER_ERROR, bytes(inst))
467
487
468 # browse subdirectories
488 # browse subdirectories
469 subdir = virtual + b'/'
489 subdir = virtual + b'/'
470 if [r for r in repos if r.startswith(subdir)]:
490 if [r for r in repos if r.startswith(subdir)]:
471 return self.makeindex(req, res, tmpl, subdir)
491 return self.makeindex(req, res, tmpl, subdir)
472
492
473 # prefixes not found
493 # prefixes not found
474 res.status = b'404 Not Found'
494 res.status = b'404 Not Found'
475 res.setbodygen(tmpl.generate(b'notfound', {b'repo': virtual}))
495 res.setbodygen(tmpl.generate(b'notfound', {b'repo': virtual}))
476 return res.sendresponse()
496 return res.sendresponse()
477
497
478 except ErrorResponse as e:
498 except ErrorResponse as e:
479 res.status = statusmessage(e.code, pycompat.bytestr(e))
499 res.status = statusmessage(e.code, pycompat.bytestr(e))
480 res.setbodygen(
500 res.setbodygen(
481 tmpl.generate(b'error', {b'error': e.message or b''})
501 tmpl.generate(b'error', {b'error': e.message or b''})
482 )
502 )
483 return res.sendresponse()
503 return res.sendresponse()
484 finally:
504 finally:
485 del tmpl
505 del tmpl
486
506
487 def makeindex(self, req, res, tmpl, subdir=b""):
507 def makeindex(self, req, res, tmpl, subdir=b""):
488 self.refresh()
508 self.refresh()
489 sortable = [b"name", b"description", b"contact", b"lastchange"]
509 sortable = [b"name", b"description", b"contact", b"lastchange"]
490 sortcolumn, descending = None, False
510 sortcolumn, descending = None, False
491 if b'sort' in req.qsparams:
511 if b'sort' in req.qsparams:
492 sortcolumn = req.qsparams[b'sort']
512 sortcolumn = req.qsparams[b'sort']
493 descending = sortcolumn.startswith(b'-')
513 descending = sortcolumn.startswith(b'-')
494 if descending:
514 if descending:
495 sortcolumn = sortcolumn[1:]
515 sortcolumn = sortcolumn[1:]
496 if sortcolumn not in sortable:
516 if sortcolumn not in sortable:
497 sortcolumn = b""
517 sortcolumn = b""
498
518
499 sort = [
519 sort = [
500 (
520 (
501 b"sort_%s" % column,
521 b"sort_%s" % column,
502 b"%s%s"
522 b"%s%s"
503 % (
523 % (
504 (not descending and column == sortcolumn) and b"-" or b"",
524 (not descending and column == sortcolumn) and b"-" or b"",
505 column,
525 column,
506 ),
526 ),
507 )
527 )
508 for column in sortable
528 for column in sortable
509 ]
529 ]
510
530
511 self.refresh()
531 self.refresh()
512
532
513 entries = indexentries(
533 entries = indexentries(
514 self.ui,
534 self.ui,
515 self.repos,
535 self.repos,
516 req,
536 req,
517 self.stripecount,
537 self.stripecount,
518 sortcolumn=sortcolumn,
538 sortcolumn=sortcolumn,
519 descending=descending,
539 descending=descending,
520 subdir=subdir,
540 subdir=subdir,
521 )
541 )
522
542
523 mapping = {
543 mapping = {
524 b'entries': entries,
544 b'entries': entries,
525 b'subdir': subdir,
545 b'subdir': subdir,
526 b'pathdef': hgweb_mod.makebreadcrumb(b'/' + subdir, self.prefix),
546 b'pathdef': hgweb_mod.makebreadcrumb(b'/' + subdir, self.prefix),
527 b'sortcolumn': sortcolumn,
547 b'sortcolumn': sortcolumn,
528 b'descending': descending,
548 b'descending': descending,
529 }
549 }
530 mapping.update(sort)
550 mapping.update(sort)
531 res.setbodygen(tmpl.generate(b'index', mapping))
551 res.setbodygen(tmpl.generate(b'index', mapping))
532 return res.sendresponse()
552 return res.sendresponse()
533
553
534 def templater(self, req, nonce):
554 def templater(self, req, nonce):
535 def config(*args, **kwargs):
555 def config(*args, **kwargs):
536 kwargs.setdefault('untrusted', True)
556 kwargs.setdefault('untrusted', True)
537 return self.ui.config(*args, **kwargs)
557 return self.ui.config(*args, **kwargs)
538
558
539 vars = {}
559 vars = {}
540 styles, (style, mapfile, fp) = hgweb_mod.getstyle(
560 styles, (style, mapfile, fp) = hgweb_mod.getstyle(
541 req, config, self.templatepath
561 req, config, self.templatepath
542 )
562 )
543 if style == styles[0]:
563 if style == styles[0]:
544 vars[b'style'] = style
564 vars[b'style'] = style
545
565
546 sessionvars = webutil.sessionvars(vars, b'?')
566 sessionvars = webutil.sessionvars(vars, b'?')
547 logourl = config(b'web', b'logourl')
567 logourl = config(b'web', b'logourl')
548 logoimg = config(b'web', b'logoimg')
568 logoimg = config(b'web', b'logoimg')
549 staticurl = (
569 staticurl = (
550 config(b'web', b'staticurl')
570 config(b'web', b'staticurl')
551 or req.apppath.rstrip(b'/') + b'/static/'
571 or req.apppath.rstrip(b'/') + b'/static/'
552 )
572 )
553 if not staticurl.endswith(b'/'):
573 if not staticurl.endswith(b'/'):
554 staticurl += b'/'
574 staticurl += b'/'
555
575
556 defaults = {
576 defaults = {
557 b"encoding": encoding.encoding,
577 b"encoding": encoding.encoding,
558 b"url": req.apppath + b'/',
578 b"url": req.apppath + b'/',
559 b"logourl": logourl,
579 b"logourl": logourl,
560 b"logoimg": logoimg,
580 b"logoimg": logoimg,
561 b"staticurl": staticurl,
581 b"staticurl": staticurl,
562 b"sessionvars": sessionvars,
582 b"sessionvars": sessionvars,
563 b"style": style,
583 b"style": style,
564 b"nonce": nonce,
584 b"nonce": nonce,
565 }
585 }
566 templatekeyword = registrar.templatekeyword(defaults)
586 templatekeyword = registrar.templatekeyword(defaults)
567
587
568 @templatekeyword(b'motd', requires=())
588 @templatekeyword(b'motd', requires=())
569 def motd(context, mapping):
589 def motd(context, mapping):
570 if self.motd is not None:
590 if self.motd is not None:
571 yield self.motd
591 yield self.motd
572 else:
592 else:
573 yield config(b'web', b'motd')
593 yield config(b'web', b'motd')
574
594
575 return templater.templater.frommapfile(
595 return templater.templater.frommapfile(
576 mapfile, fp=fp, defaults=defaults
596 mapfile, fp=fp, defaults=defaults
577 )
597 )
General Comments 0
You need to be logged in to leave comments. Login now