##// END OF EJS Templates
codemod: register core configitems using a script...
Jun Wu -
r33499:0407a51b default
parent child Browse files
Show More
@@ -303,7 +303,7 b' class journalstorage(object):'
303 # default to 600 seconds timeout
303 # default to 600 seconds timeout
304 l = lock.lock(
304 l = lock.lock(
305 vfs, 'namejournal.lock',
305 vfs, 'namejournal.lock',
306 int(self.ui.config("ui", "timeout", "600")), desc=desc)
306 int(self.ui.config("ui", "timeout")), desc=desc)
307 self.ui.warn(_("got lock after %s seconds\n") % l.delay)
307 self.ui.warn(_("got lock after %s seconds\n") % l.delay)
308 self._lockref = weakref.ref(l)
308 self._lockref = weakref.ref(l)
309 return l
309 return l
@@ -973,7 +973,7 b' def overridearchive(orig, repo, dest, no'
973
973
974 archiver = archival.archivers[kind](dest, mtime or ctx.date()[0])
974 archiver = archival.archivers[kind](dest, mtime or ctx.date()[0])
975
975
976 if repo.ui.configbool("ui", "archivemeta", True):
976 if repo.ui.configbool("ui", "archivemeta"):
977 write('.hg_archival.txt', 0o644, False,
977 write('.hg_archival.txt', 0o644, False,
978 lambda: archival.buildmetadata(ctx))
978 lambda: archival.buildmetadata(ctx))
979
979
@@ -307,7 +307,7 b' def archive(repo, dest, node, kind, deco'
307 ctx = repo[node]
307 ctx = repo[node]
308 archiver = archivers[kind](dest, mtime or ctx.date()[0])
308 archiver = archivers[kind](dest, mtime or ctx.date()[0])
309
309
310 if repo.ui.configbool("ui", "archivemeta", True):
310 if repo.ui.configbool("ui", "archivemeta"):
311 name = '.hg_archival.txt'
311 name = '.hg_archival.txt'
312 if not matchfn or matchfn(name):
312 if not matchfn or matchfn(name):
313 write(name, 0o644, False, lambda: buildmetadata(ctx))
313 write(name, 0o644, False, lambda: buildmetadata(ctx))
@@ -533,7 +533,7 b' def updatefromremote(ui, repo, remotemar'
533
533
534 status = ui.status
534 status = ui.status
535 warn = ui.warn
535 warn = ui.warn
536 if ui.configbool('ui', 'quietbookmarkmove', False):
536 if ui.configbool('ui', 'quietbookmarkmove'):
537 status = warn = ui.debug
537 status = warn = ui.debug
538
538
539 explicit = set(explicit)
539 explicit = set(explicit)
@@ -1801,7 +1801,7 b' def handleobsmarker(op, inpart):'
1801 """add a stream of obsmarkers to the repo"""
1801 """add a stream of obsmarkers to the repo"""
1802 tr = op.gettransaction()
1802 tr = op.gettransaction()
1803 markerdata = inpart.read()
1803 markerdata = inpart.read()
1804 if op.ui.config('experimental', 'obsmarkers-exchange-debug', False):
1804 if op.ui.config('experimental', 'obsmarkers-exchange-debug'):
1805 op.ui.write(('obsmarker-exchange: %i bytes received\n')
1805 op.ui.write(('obsmarker-exchange: %i bytes received\n')
1806 % len(markerdata))
1806 % len(markerdata))
1807 # The mergemarkers call will crash if marker creation is not enabled.
1807 # The mergemarkers call will crash if marker creation is not enabled.
@@ -485,7 +485,7 b' class chgunixservicehandler(object):'
485
485
486 def __init__(self, ui):
486 def __init__(self, ui):
487 self.ui = ui
487 self.ui = ui
488 self._idletimeout = ui.configint('chgserver', 'idletimeout', 3600)
488 self._idletimeout = ui.configint('chgserver', 'idletimeout')
489 self._lastactive = time.time()
489 self._lastactive = time.time()
490
490
491 def bindsocket(self, sock, address):
491 def bindsocket(self, sock, address):
@@ -497,7 +497,7 b' class chgunixservicehandler(object):'
497
497
498 def _inithashstate(self, address):
498 def _inithashstate(self, address):
499 self._baseaddress = address
499 self._baseaddress = address
500 if self.ui.configbool('chgserver', 'skiphash', False):
500 if self.ui.configbool('chgserver', 'skiphash'):
501 self._hashstate = None
501 self._hashstate = None
502 self._realaddress = address
502 self._realaddress = address
503 return
503 return
@@ -208,7 +208,7 b' def recordfilter(ui, originalhunks, oper'
208 (see patch.filterpatch).
208 (see patch.filterpatch).
209 """
209 """
210 usecurses = crecordmod.checkcurses(ui)
210 usecurses = crecordmod.checkcurses(ui)
211 testfile = ui.config('experimental', 'crecordtest', None)
211 testfile = ui.config('experimental', 'crecordtest')
212 oldwrite = setupwrapcolorwrite(ui)
212 oldwrite = setupwrapcolorwrite(ui)
213 try:
213 try:
214 newchunks, newopts = filterchunks(ui, originalhunks, usecurses,
214 newchunks, newopts = filterchunks(ui, originalhunks, usecurses,
@@ -1687,7 +1687,7 b' def _lookuplogtemplate(ui, tmpl, style):'
1687 if tmpl:
1687 if tmpl:
1688 return logtemplatespec(templater.unquotestring(tmpl), None)
1688 return logtemplatespec(templater.unquotestring(tmpl), None)
1689 else:
1689 else:
1690 style = util.expandpath(ui.config('ui', 'style', ''))
1690 style = util.expandpath(ui.config('ui', 'style'))
1691
1691
1692 if not tmpl and style:
1692 if not tmpl and style:
1693 mapfile = style
1693 mapfile = style
@@ -3406,8 +3406,7 b' def _performrevert(repo, parents, ctx, a'
3406 if node != parent:
3406 if node != parent:
3407 operation = 'revert'
3407 operation = 'revert'
3408 reversehunks = repo.ui.configbool('experimental',
3408 reversehunks = repo.ui.configbool('experimental',
3409 'revertalternateinteractivemode',
3409 'revertalternateinteractivemode')
3410 True)
3411 if reversehunks:
3410 if reversehunks:
3412 diff = patch.diff(repo, ctx.node(), None, m, opts=diffopts)
3411 diff = patch.diff(repo, ctx.node(), None, m, opts=diffopts)
3413 else:
3412 else:
@@ -1227,9 +1227,9 b' def bundle(ui, repo, fname, dest=None, *'
1227
1227
1228
1228
1229 contentopts = {'cg.version': cgversion}
1229 contentopts = {'cg.version': cgversion}
1230 if repo.ui.configbool('experimental', 'evolution.bundle-obsmarker', False):
1230 if repo.ui.configbool('experimental', 'evolution.bundle-obsmarker'):
1231 contentopts['obsolescence'] = True
1231 contentopts['obsolescence'] = True
1232 if repo.ui.configbool('experimental', 'bundle-phases', False):
1232 if repo.ui.configbool('experimental', 'bundle-phases'):
1233 contentopts['phases'] = True
1233 contentopts['phases'] = True
1234 bundle2.writenewbundle(ui, repo, 'bundle', fname, bversion, outgoing,
1234 bundle2.writenewbundle(ui, repo, 'bundle', fname, bversion, outgoing,
1235 contentopts, compression=bcompression,
1235 contentopts, compression=bcompression,
@@ -4524,7 +4524,7 b' def rollback(ui, repo, **opts):'
4524
4524
4525 Returns 0 on success, 1 if no rollback data is available.
4525 Returns 0 on success, 1 if no rollback data is available.
4526 """
4526 """
4527 if not ui.configbool('ui', 'rollback', True):
4527 if not ui.configbool('ui', 'rollback'):
4528 raise error.Abort(_('rollback is disabled because it is unsafe'),
4528 raise error.Abort(_('rollback is disabled because it is unsafe'),
4529 hint=('see `hg help -v rollback` for information'))
4529 hint=('see `hg help -v rollback` for information'))
4530 return repo.rollback(dryrun=opts.get(r'dry_run'),
4530 return repo.rollback(dryrun=opts.get(r'dry_run'),
@@ -156,7 +156,7 b' class server(object):'
156 self.cwd = pycompat.getcwd()
156 self.cwd = pycompat.getcwd()
157
157
158 # developer config: cmdserver.log
158 # developer config: cmdserver.log
159 logpath = ui.config("cmdserver", "log", None)
159 logpath = ui.config("cmdserver", "log")
160 if logpath:
160 if logpath:
161 global logfile
161 global logfile
162 if logpath == '-':
162 if logpath == '-':
@@ -76,12 +76,30 b" coreconfigitem('bundle', 'mainreporoot',"
76 coreconfigitem('bundle', 'reorder',
76 coreconfigitem('bundle', 'reorder',
77 default='auto',
77 default='auto',
78 )
78 )
79 coreconfigitem('censor', 'policy',
80 default='abort',
81 )
82 coreconfigitem('chgserver', 'idletimeout',
83 default=3600,
84 )
85 coreconfigitem('chgserver', 'skiphash',
86 default=False,
87 )
88 coreconfigitem('cmdserver', 'log',
89 default=None,
90 )
79 coreconfigitem('color', 'mode',
91 coreconfigitem('color', 'mode',
80 default='auto',
92 default='auto',
81 )
93 )
82 coreconfigitem('color', 'pagermode',
94 coreconfigitem('color', 'pagermode',
83 default=dynamicdefault,
95 default=dynamicdefault,
84 )
96 )
97 coreconfigitem('commands', 'status.relative',
98 default=False,
99 )
100 coreconfigitem('commands', 'update.requiredest',
101 default=False,
102 )
85 coreconfigitem('devel', 'all-warnings',
103 coreconfigitem('devel', 'all-warnings',
86 default=False,
104 default=False,
87 )
105 )
@@ -94,6 +112,12 b" coreconfigitem('devel', 'check-locks',"
94 coreconfigitem('devel', 'check-relroot',
112 coreconfigitem('devel', 'check-relroot',
95 default=False,
113 default=False,
96 )
114 )
115 coreconfigitem('devel', 'default-date',
116 default=None,
117 )
118 coreconfigitem('devel', 'deprec-warn',
119 default=False,
120 )
97 coreconfigitem('devel', 'disableloaddefaultcerts',
121 coreconfigitem('devel', 'disableloaddefaultcerts',
98 default=False,
122 default=False,
99 )
123 )
@@ -112,6 +136,99 b" coreconfigitem('devel', 'serverrequirece"
112 coreconfigitem('devel', 'strip-obsmarkers',
136 coreconfigitem('devel', 'strip-obsmarkers',
113 default=True,
137 default=True,
114 )
138 )
139 coreconfigitem('email', 'charsets',
140 default=list,
141 )
142 coreconfigitem('email', 'method',
143 default='smtp',
144 )
145 coreconfigitem('experimental', 'bundle-phases',
146 default=False,
147 )
148 coreconfigitem('experimental', 'bundle2-advertise',
149 default=True,
150 )
151 coreconfigitem('experimental', 'bundle2-output-capture',
152 default=False,
153 )
154 coreconfigitem('experimental', 'bundle2.pushback',
155 default=False,
156 )
157 coreconfigitem('experimental', 'bundle2lazylocking',
158 default=False,
159 )
160 coreconfigitem('experimental', 'bundlecomplevel',
161 default=None,
162 )
163 coreconfigitem('experimental', 'changegroup3',
164 default=False,
165 )
166 coreconfigitem('experimental', 'clientcompressionengines',
167 default=list,
168 )
169 coreconfigitem('experimental', 'crecordtest',
170 default=None,
171 )
172 coreconfigitem('experimental', 'disablecopytrace',
173 default=False,
174 )
175 coreconfigitem('experimental', 'editortmpinhg',
176 default=False,
177 )
178 coreconfigitem('experimental', 'evolution',
179 default=list,
180 )
181 coreconfigitem('experimental', 'evolution.bundle-obsmarker',
182 default=False,
183 )
184 coreconfigitem('experimental', 'evolution.track-operation',
185 default=False,
186 )
187 coreconfigitem('experimental', 'exportableenviron',
188 default=list,
189 )
190 coreconfigitem('experimental', 'extendedheader.index',
191 default=None,
192 )
193 coreconfigitem('experimental', 'extendedheader.similarity',
194 default=False,
195 )
196 coreconfigitem('experimental', 'format.compression',
197 default='zlib',
198 )
199 coreconfigitem('experimental', 'graphshorten',
200 default=False,
201 )
202 coreconfigitem('experimental', 'hook-track-tags',
203 default=False,
204 )
205 coreconfigitem('experimental', 'httppostargs',
206 default=False,
207 )
208 coreconfigitem('experimental', 'manifestv2',
209 default=False,
210 )
211 coreconfigitem('experimental', 'mergedriver',
212 default=None,
213 )
214 coreconfigitem('experimental', 'obsmarkers-exchange-debug',
215 default=False,
216 )
217 coreconfigitem('experimental', 'revertalternateinteractivemode',
218 default=True,
219 )
220 coreconfigitem('experimental', 'revlogv2',
221 default=None,
222 )
223 coreconfigitem('experimental', 'spacemovesdown',
224 default=False,
225 )
226 coreconfigitem('experimental', 'treemanifest',
227 default=False,
228 )
229 coreconfigitem('experimental', 'updatecheck',
230 default=None,
231 )
115 coreconfigitem('format', 'aggressivemergedeltas',
232 coreconfigitem('format', 'aggressivemergedeltas',
116 default=False,
233 default=False,
117 )
234 )
@@ -148,21 +265,90 b" coreconfigitem('hostsecurity', 'ciphers'"
148 coreconfigitem('hostsecurity', 'disabletls10warning',
265 coreconfigitem('hostsecurity', 'disabletls10warning',
149 default=False,
266 default=False,
150 )
267 )
268 coreconfigitem('http_proxy', 'always',
269 default=False,
270 )
271 coreconfigitem('http_proxy', 'host',
272 default=None,
273 )
274 coreconfigitem('http_proxy', 'no',
275 default=list,
276 )
277 coreconfigitem('http_proxy', 'passwd',
278 default=None,
279 )
280 coreconfigitem('http_proxy', 'user',
281 default=None,
282 )
283 coreconfigitem('merge', 'followcopies',
284 default=True,
285 )
286 coreconfigitem('pager', 'ignore',
287 default=list,
288 )
151 coreconfigitem('patch', 'eol',
289 coreconfigitem('patch', 'eol',
152 default='strict',
290 default='strict',
153 )
291 )
154 coreconfigitem('patch', 'fuzz',
292 coreconfigitem('patch', 'fuzz',
155 default=2,
293 default=2,
156 )
294 )
295 coreconfigitem('paths', 'default',
296 default=None,
297 )
298 coreconfigitem('paths', 'default-push',
299 default=None,
300 )
301 coreconfigitem('phases', 'checksubrepos',
302 default='follow',
303 )
304 coreconfigitem('phases', 'publish',
305 default=True,
306 )
307 coreconfigitem('profiling', 'enabled',
308 default=False,
309 )
310 coreconfigitem('profiling', 'format',
311 default='text',
312 )
313 coreconfigitem('profiling', 'freq',
314 default=1000,
315 )
316 coreconfigitem('profiling', 'limit',
317 default=30,
318 )
319 coreconfigitem('profiling', 'nested',
320 default=0,
321 )
322 coreconfigitem('profiling', 'sort',
323 default='inlinetime',
324 )
325 coreconfigitem('profiling', 'statformat',
326 default='hotpath',
327 )
157 coreconfigitem('progress', 'assume-tty',
328 coreconfigitem('progress', 'assume-tty',
158 default=False,
329 default=False,
159 )
330 )
331 coreconfigitem('progress', 'changedelay',
332 default=1,
333 )
160 coreconfigitem('progress', 'clear-complete',
334 coreconfigitem('progress', 'clear-complete',
161 default=True,
335 default=True,
162 )
336 )
337 coreconfigitem('progress', 'debug',
338 default=False,
339 )
340 coreconfigitem('progress', 'delay',
341 default=3,
342 )
343 coreconfigitem('progress', 'disable',
344 default=False,
345 )
163 coreconfigitem('progress', 'estimate',
346 coreconfigitem('progress', 'estimate',
164 default=2,
347 default=2,
165 )
348 )
349 coreconfigitem('progress', 'refresh',
350 default=0.1,
351 )
166 coreconfigitem('progress', 'width',
352 coreconfigitem('progress', 'width',
167 default=dynamicdefault,
353 default=dynamicdefault,
168 )
354 )
@@ -187,6 +373,9 b" coreconfigitem('server', 'maxhttpheaderl"
187 coreconfigitem('server', 'preferuncompressed',
373 coreconfigitem('server', 'preferuncompressed',
188 default=False,
374 default=False,
189 )
375 )
376 coreconfigitem('server', 'uncompressed',
377 default=True,
378 )
190 coreconfigitem('server', 'uncompressedallowsecret',
379 coreconfigitem('server', 'uncompressedallowsecret',
191 default=False,
380 default=False,
192 )
381 )
@@ -196,18 +385,171 b" coreconfigitem('server', 'validate',"
196 coreconfigitem('server', 'zliblevel',
385 coreconfigitem('server', 'zliblevel',
197 default=-1,
386 default=-1,
198 )
387 )
388 coreconfigitem('smtp', 'host',
389 default=None,
390 )
391 coreconfigitem('smtp', 'local_hostname',
392 default=None,
393 )
394 coreconfigitem('smtp', 'password',
395 default=None,
396 )
397 coreconfigitem('smtp', 'tls',
398 default='none',
399 )
400 coreconfigitem('smtp', 'username',
401 default=None,
402 )
403 coreconfigitem('sparse', 'missingwarning',
404 default=True,
405 )
406 coreconfigitem('trusted', 'groups',
407 default=list,
408 )
409 coreconfigitem('trusted', 'users',
410 default=list,
411 )
412 coreconfigitem('ui', '_usedassubrepo',
413 default=False,
414 )
415 coreconfigitem('ui', 'allowemptycommit',
416 default=False,
417 )
418 coreconfigitem('ui', 'archivemeta',
419 default=True,
420 )
421 coreconfigitem('ui', 'askusername',
422 default=False,
423 )
424 coreconfigitem('ui', 'clonebundlefallback',
425 default=False,
426 )
199 coreconfigitem('ui', 'clonebundleprefers',
427 coreconfigitem('ui', 'clonebundleprefers',
200 default=list,
428 default=list,
201 )
429 )
430 coreconfigitem('ui', 'clonebundles',
431 default=True,
432 )
433 coreconfigitem('ui', 'commitsubrepos',
434 default=False,
435 )
436 coreconfigitem('ui', 'debug',
437 default=False,
438 )
439 coreconfigitem('ui', 'debugger',
440 default=None,
441 )
442 coreconfigitem('ui', 'forcemerge',
443 default=None,
444 )
445 coreconfigitem('ui', 'formatdebug',
446 default=False,
447 )
448 coreconfigitem('ui', 'formatjson',
449 default=False,
450 )
451 coreconfigitem('ui', 'formatted',
452 default=None,
453 )
454 coreconfigitem('ui', 'graphnodetemplate',
455 default=None,
456 )
457 coreconfigitem('ui', 'http2debuglevel',
458 default=None,
459 )
202 coreconfigitem('ui', 'interactive',
460 coreconfigitem('ui', 'interactive',
203 default=None,
461 default=None,
204 )
462 )
463 coreconfigitem('ui', 'interface',
464 default=None,
465 )
466 coreconfigitem('ui', 'logblockedtimes',
467 default=False,
468 )
469 coreconfigitem('ui', 'logtemplate',
470 default=None,
471 )
472 coreconfigitem('ui', 'merge',
473 default=None,
474 )
475 coreconfigitem('ui', 'mergemarkers',
476 default='basic',
477 )
478 coreconfigitem('ui', 'nontty',
479 default=False,
480 )
481 coreconfigitem('ui', 'origbackuppath',
482 default=None,
483 )
484 coreconfigitem('ui', 'paginate',
485 default=True,
486 )
487 coreconfigitem('ui', 'patch',
488 default=None,
489 )
490 coreconfigitem('ui', 'portablefilenames',
491 default='warn',
492 )
493 coreconfigitem('ui', 'promptecho',
494 default=False,
495 )
205 coreconfigitem('ui', 'quiet',
496 coreconfigitem('ui', 'quiet',
206 default=False,
497 default=False,
207 )
498 )
499 coreconfigitem('ui', 'quietbookmarkmove',
500 default=False,
501 )
502 coreconfigitem('ui', 'remotecmd',
503 default='hg',
504 )
505 coreconfigitem('ui', 'report_untrusted',
506 default=True,
507 )
508 coreconfigitem('ui', 'rollback',
509 default=True,
510 )
511 coreconfigitem('ui', 'slash',
512 default=False,
513 )
514 coreconfigitem('ui', 'ssh',
515 default='ssh',
516 )
517 coreconfigitem('ui', 'statuscopies',
518 default=False,
519 )
520 coreconfigitem('ui', 'strict',
521 default=False,
522 )
523 coreconfigitem('ui', 'style',
524 default='',
525 )
526 coreconfigitem('ui', 'supportcontact',
527 default=None,
528 )
529 coreconfigitem('ui', 'textwidth',
530 default=78,
531 )
532 coreconfigitem('ui', 'timeout',
533 default='600',
534 )
535 coreconfigitem('ui', 'traceback',
536 default=False,
537 )
538 coreconfigitem('ui', 'tweakdefaults',
539 default=False,
540 )
541 coreconfigitem('ui', 'usehttp2',
542 default=False,
543 )
208 coreconfigitem('ui', 'username',
544 coreconfigitem('ui', 'username',
209 alias=[('ui', 'user')]
545 alias=[('ui', 'user')]
210 )
546 )
547 coreconfigitem('ui', 'verbose',
548 default=False,
549 )
550 coreconfigitem('verify', 'skipflags',
551 default=None,
552 )
211 coreconfigitem('worker', 'backgroundclose',
553 coreconfigitem('worker', 'backgroundclose',
212 default=dynamicdefault,
554 default=dynamicdefault,
213 )
555 )
@@ -1231,7 +1231,7 b' class filectx(basefilectx):'
1231 try:
1231 try:
1232 return self._filelog.read(self._filenode)
1232 return self._filelog.read(self._filenode)
1233 except error.CensoredNodeError:
1233 except error.CensoredNodeError:
1234 if self._repo.ui.config("censor", "policy", "abort") == "ignore":
1234 if self._repo.ui.config("censor", "policy") == "ignore":
1235 return ""
1235 return ""
1236 raise error.Abort(_("censored node: %s") % short(self._filenode),
1236 raise error.Abort(_("censored node: %s") % short(self._filenode),
1237 hint=_("set censor.policy to ignore errors"))
1237 hint=_("set censor.policy to ignore errors"))
@@ -916,7 +916,7 b' def _exceptionwarning(ui):'
916 # version number and try updating.
916 # version number and try updating.
917 ct = util.versiontuple(n=2)
917 ct = util.versiontuple(n=2)
918 worst = None, ct, ''
918 worst = None, ct, ''
919 if ui.config('ui', 'supportcontact', None) is None:
919 if ui.config('ui', 'supportcontact') is None:
920 for name, mod in extensions.extensions():
920 for name, mod in extensions.extensions():
921 testedwith = getattr(mod, 'testedwith', '')
921 testedwith = getattr(mod, 'testedwith', '')
922 if pycompat.ispy3 and isinstance(testedwith, str):
922 if pycompat.ispy3 and isinstance(testedwith, str):
@@ -950,7 +950,7 b' def _exceptionwarning(ui):'
950 '** If that fixes the bug please report it to %s\n')
950 '** If that fixes the bug please report it to %s\n')
951 % (name, testedwith, name, report))
951 % (name, testedwith, name, report))
952 else:
952 else:
953 bugtracker = ui.config('ui', 'supportcontact', None)
953 bugtracker = ui.config('ui', 'supportcontact')
954 if bugtracker is None:
954 if bugtracker is None:
955 bugtracker = _("https://mercurial-scm.org/wiki/BugTracker")
955 bugtracker = _("https://mercurial-scm.org/wiki/BugTracker")
956 warning = (_("** unknown exception encountered, "
956 warning = (_("** unknown exception encountered, "
@@ -547,7 +547,7 b' def _pushdiscoveryphase(pushop):'
547 unfi = pushop.repo.unfiltered()
547 unfi = pushop.repo.unfiltered()
548 remotephases = pushop.remote.listkeys('phases')
548 remotephases = pushop.remote.listkeys('phases')
549 publishing = remotephases.get('publishing', False)
549 publishing = remotephases.get('publishing', False)
550 if (pushop.ui.configbool('ui', '_usedassubrepo', False)
550 if (pushop.ui.configbool('ui', '_usedassubrepo')
551 and remotephases # server supports phases
551 and remotephases # server supports phases
552 and not pushop.outgoing.missing # no changesets to be pushed
552 and not pushop.outgoing.missing # no changesets to be pushed
553 and publishing):
553 and publishing):
@@ -993,7 +993,7 b' def _pushsyncphase(pushop):'
993 cheads = pushop.commonheads
993 cheads = pushop.commonheads
994 # even when we don't push, exchanging phase data is useful
994 # even when we don't push, exchanging phase data is useful
995 remotephases = pushop.remote.listkeys('phases')
995 remotephases = pushop.remote.listkeys('phases')
996 if (pushop.ui.configbool('ui', '_usedassubrepo', False)
996 if (pushop.ui.configbool('ui', '_usedassubrepo')
997 and remotephases # server supports phases
997 and remotephases # server supports phases
998 and pushop.cgresult is None # nothing was pushed
998 and pushop.cgresult is None # nothing was pushed
999 and remotephases.get('publishing', False)):
999 and remotephases.get('publishing', False)):
@@ -1726,8 +1726,7 b' def unbundle(repo, cg, heads, source, ur'
1726 lockandtr = [None, None, None]
1726 lockandtr = [None, None, None]
1727 recordout = None
1727 recordout = None
1728 # quick fix for output mismatch with bundle2 in 3.4
1728 # quick fix for output mismatch with bundle2 in 3.4
1729 captureoutput = repo.ui.configbool('experimental', 'bundle2-output-capture',
1729 captureoutput = repo.ui.configbool('experimental', 'bundle2-output-capture')
1730 False)
1731 if url.startswith('remote:http:') or url.startswith('remote:https:'):
1730 if url.startswith('remote:http:') or url.startswith('remote:https:'):
1732 captureoutput = True
1731 captureoutput = True
1733 try:
1732 try:
@@ -1792,7 +1791,7 b' def _maybeapplyclonebundle(pullop):'
1792 repo = pullop.repo
1791 repo = pullop.repo
1793 remote = pullop.remote
1792 remote = pullop.remote
1794
1793
1795 if not repo.ui.configbool('ui', 'clonebundles', True):
1794 if not repo.ui.configbool('ui', 'clonebundles'):
1796 return
1795 return
1797
1796
1798 # Only run if local repo is empty.
1797 # Only run if local repo is empty.
@@ -1841,7 +1840,7 b' def _maybeapplyclonebundle(pullop):'
1841 # We abort by default to avoid the thundering herd of
1840 # We abort by default to avoid the thundering herd of
1842 # clients flooding a server that was expecting expensive
1841 # clients flooding a server that was expecting expensive
1843 # clone load to be offloaded.
1842 # clone load to be offloaded.
1844 elif repo.ui.configbool('ui', 'clonebundlefallback', False):
1843 elif repo.ui.configbool('ui', 'clonebundlefallback'):
1845 repo.ui.warn(_('falling back to normal clone\n'))
1844 repo.ui.warn(_('falling back to normal clone\n'))
1846 else:
1845 else:
1847 raise error.Abort(_('error applying bundle'),
1846 raise error.Abort(_('error applying bundle'),
@@ -685,7 +685,7 b' def _filemerge(premerge, repo, mynode, o'
685
685
686 r = 1
686 r = 1
687 try:
687 try:
688 markerstyle = ui.config('ui', 'mergemarkers', 'basic')
688 markerstyle = ui.config('ui', 'mergemarkers')
689 if not labels:
689 if not labels:
690 labels = _defaultconflictlabels
690 labels = _defaultconflictlabels
691 if markerstyle != 'basic':
691 if markerstyle != 'basic':
@@ -647,7 +647,7 b' def formattedhelp(ui, commands, name, ke'
647 subtopic = remaining
647 subtopic = remaining
648 else:
648 else:
649 section = remaining
649 section = remaining
650 textwidth = ui.configint('ui', 'textwidth', 78)
650 textwidth = ui.configint('ui', 'textwidth')
651 termwidth = ui.termwidth() - 2
651 termwidth = ui.termwidth() - 2
652 if textwidth <= 0 or termwidth < textwidth:
652 if textwidth <= 0 or termwidth < textwidth:
653 textwidth = termwidth
653 textwidth = termwidth
@@ -141,7 +141,7 b' class http2handler(urlreq.httphandler, u'
141 self.pwmgr = pwmgr
141 self.pwmgr = pwmgr
142 self._connections = {}
142 self._connections = {}
143 # developer config: ui.http2debuglevel
143 # developer config: ui.http2debuglevel
144 loglevel = ui.config('ui', 'http2debuglevel', default=None)
144 loglevel = ui.config('ui', 'http2debuglevel')
145 if loglevel and not _configuredlogging:
145 if loglevel and not _configuredlogging:
146 _configuredlogging = True
146 _configuredlogging = True
147 logger = logging.getLogger('mercurial.httpclient')
147 logger = logging.getLogger('mercurial.httpclient')
@@ -181,7 +181,7 b' class httppeer(wireproto.wirepeer):'
181 size = data.length
181 size = data.length
182 elif data is not None:
182 elif data is not None:
183 size = len(data)
183 size = len(data)
184 if size and self.ui.configbool('ui', 'usehttp2', False):
184 if size and self.ui.configbool('ui', 'usehttp2'):
185 headers['Expect'] = '100-Continue'
185 headers['Expect'] = '100-Continue'
186 headers['X-HgHttp2'] = '1'
186 headers['X-HgHttp2'] = '1'
187 if data is not None and 'Content-Type' not in headers:
187 if data is not None and 'Content-Type' not in headers:
@@ -532,7 +532,7 b' class localrepository(object):'
532 self._revbranchcache.write()
532 self._revbranchcache.write()
533
533
534 def _restrictcapabilities(self, caps):
534 def _restrictcapabilities(self, caps):
535 if self.ui.configbool('experimental', 'bundle2-advertise', True):
535 if self.ui.configbool('experimental', 'bundle2-advertise'):
536 caps = set(caps)
536 caps = set(caps)
537 capsblob = bundle2.encodecaps(bundle2.getrepocaps(self))
537 capsblob = bundle2.encodecaps(bundle2.getrepocaps(self))
538 caps.add('bundle2=' + urlreq.quote(capsblob))
538 caps.add('bundle2=' + urlreq.quote(capsblob))
@@ -951,7 +951,7 b' class localrepository(object):'
951 def publishing(self):
951 def publishing(self):
952 # it's safe (and desirable) to trust the publish flag unconditionally
952 # it's safe (and desirable) to trust the publish flag unconditionally
953 # so that we don't finalize changes shared between users via ssh or nfs
953 # so that we don't finalize changes shared between users via ssh or nfs
954 return self.ui.configbool('phases', 'publish', True, untrusted=True)
954 return self.ui.configbool('phases', 'publish', untrusted=True)
955
955
956 def cancopy(self):
956 def cancopy(self):
957 # so statichttprepo's override of local() works
957 # so statichttprepo's override of local() works
@@ -1149,8 +1149,7 b' class localrepository(object):'
1149 # "+M": tag is moved (new value),
1149 # "+M": tag is moved (new value),
1150 tracktags = lambda x: None
1150 tracktags = lambda x: None
1151 # experimental config: experimental.hook-track-tags
1151 # experimental config: experimental.hook-track-tags
1152 shouldtracktags = self.ui.configbool('experimental', 'hook-track-tags',
1152 shouldtracktags = self.ui.configbool('experimental', 'hook-track-tags')
1153 False)
1154 if desc != 'strip' and shouldtracktags:
1153 if desc != 'strip' and shouldtracktags:
1155 oldheads = self.changelog.headrevs()
1154 oldheads = self.changelog.headrevs()
1156 def tracktags(tr2):
1155 def tracktags(tr2):
@@ -1506,7 +1505,7 b' class localrepository(object):'
1506 (desc, inst.locker))
1505 (desc, inst.locker))
1507 # default to 600 seconds timeout
1506 # default to 600 seconds timeout
1508 l = lockmod.lock(vfs, lockname,
1507 l = lockmod.lock(vfs, lockname,
1509 int(self.ui.config("ui", "timeout", "600")),
1508 int(self.ui.config("ui", "timeout")),
1510 releasefn=releasefn, acquirefn=acquirefn,
1509 releasefn=releasefn, acquirefn=acquirefn,
1511 desc=desc)
1510 desc=desc)
1512 self.ui.warn(_("got lock after %s seconds\n") % l.delay)
1511 self.ui.warn(_("got lock after %s seconds\n") % l.delay)
@@ -2218,7 +2217,7 b' def newreporequirements(repo):'
2218 if ui.configbool('format', 'dotencode'):
2217 if ui.configbool('format', 'dotencode'):
2219 requirements.add('dotencode')
2218 requirements.add('dotencode')
2220
2219
2221 compengine = ui.config('experimental', 'format.compression', 'zlib')
2220 compengine = ui.config('experimental', 'format.compression')
2222 if compengine not in util.compengines:
2221 if compengine not in util.compengines:
2223 raise error.Abort(_('compression engine %s defined by '
2222 raise error.Abort(_('compression engine %s defined by '
2224 'experimental.format.compression not available') %
2223 'experimental.format.compression not available') %
@@ -2232,9 +2231,9 b' def newreporequirements(repo):'
2232
2231
2233 if scmutil.gdinitconfig(ui):
2232 if scmutil.gdinitconfig(ui):
2234 requirements.add('generaldelta')
2233 requirements.add('generaldelta')
2235 if ui.configbool('experimental', 'treemanifest', False):
2234 if ui.configbool('experimental', 'treemanifest'):
2236 requirements.add('treemanifest')
2235 requirements.add('treemanifest')
2237 if ui.configbool('experimental', 'manifestv2', False):
2236 if ui.configbool('experimental', 'manifestv2'):
2238 requirements.add('manifestv2')
2237 requirements.add('manifestv2')
2239
2238
2240 revlogv2 = ui.config('experimental', 'revlogv2')
2239 revlogv2 = ui.config('experimental', 'revlogv2')
@@ -78,7 +78,7 b' class SMTPS(smtplib.SMTP):'
78 def _smtp(ui):
78 def _smtp(ui):
79 '''build an smtp connection and return a function to send mail'''
79 '''build an smtp connection and return a function to send mail'''
80 local_hostname = ui.config('smtp', 'local_hostname')
80 local_hostname = ui.config('smtp', 'local_hostname')
81 tls = ui.config('smtp', 'tls', 'none')
81 tls = ui.config('smtp', 'tls')
82 # backward compatible: when tls = true, we use starttls.
82 # backward compatible: when tls = true, we use starttls.
83 starttls = tls == 'starttls' or util.parsebool(tls)
83 starttls = tls == 'starttls' or util.parsebool(tls)
84 smtps = tls == 'smtps'
84 smtps = tls == 'smtps'
@@ -135,7 +135,7 b' def _smtp(ui):'
135
135
136 def _sendmail(ui, sender, recipients, msg):
136 def _sendmail(ui, sender, recipients, msg):
137 '''send mail using sendmail.'''
137 '''send mail using sendmail.'''
138 program = ui.config('email', 'method', 'smtp')
138 program = ui.config('email', 'method')
139 cmdline = '%s -f %s %s' % (program, util.email(sender),
139 cmdline = '%s -f %s %s' % (program, util.email(sender),
140 ' '.join(map(util.email, recipients)))
140 ' '.join(map(util.email, recipients)))
141 ui.note(_('sending mail: %s\n') % cmdline)
141 ui.note(_('sending mail: %s\n') % cmdline)
@@ -164,7 +164,7 b' def connect(ui, mbox=None):'
164 if mbox:
164 if mbox:
165 open(mbox, 'wb').close()
165 open(mbox, 'wb').close()
166 return lambda s, r, m: _mbox(mbox, s, r, m)
166 return lambda s, r, m: _mbox(mbox, s, r, m)
167 if ui.config('email', 'method', 'smtp') == 'smtp':
167 if ui.config('email', 'method') == 'smtp':
168 return _smtp(ui)
168 return _smtp(ui)
169 return lambda s, r, m: _sendmail(ui, s, r, m)
169 return lambda s, r, m: _sendmail(ui, s, r, m)
170
170
@@ -174,7 +174,7 b' def sendmail(ui, sender, recipients, msg'
174
174
175 def validateconfig(ui):
175 def validateconfig(ui):
176 '''determine if we have enough config data to try sending email.'''
176 '''determine if we have enough config data to try sending email.'''
177 method = ui.config('email', 'method', 'smtp')
177 method = ui.config('email', 'method')
178 if method == 'smtp':
178 if method == 'smtp':
179 if not ui.config('smtp', 'host'):
179 if not ui.config('smtp', 'host'):
180 raise error.Abort(_('smtp specified as email transport, '
180 raise error.Abort(_('smtp specified as email transport, '
@@ -1613,7 +1613,7 b' def update(repo, node, branchmerge, forc'
1613 pas = [p1]
1613 pas = [p1]
1614
1614
1615 # deprecated config: merge.followcopies
1615 # deprecated config: merge.followcopies
1616 followcopies = repo.ui.configbool('merge', 'followcopies', True)
1616 followcopies = repo.ui.configbool('merge', 'followcopies')
1617 if overwrite:
1617 if overwrite:
1618 followcopies = False
1618 followcopies = False
1619 elif not pas[0]:
1619 elif not pas[0]:
@@ -991,8 +991,7 b' def createmarkers(repo, relations, flag='
991 if 'user' not in metadata:
991 if 'user' not in metadata:
992 metadata['user'] = repo.ui.username()
992 metadata['user'] = repo.ui.username()
993 useoperation = repo.ui.configbool('experimental',
993 useoperation = repo.ui.configbool('experimental',
994 'evolution.track-operation',
994 'evolution.track-operation')
995 False)
996 if useoperation and operation:
995 if useoperation and operation:
997 metadata['operation'] = operation
996 metadata['operation'] = operation
998 tr = repo.transaction('add-obsolescence-marker')
997 tr = repo.transaction('add-obsolescence-marker')
@@ -30,10 +30,10 b' def _loadprofiler(ui, profiler):'
30
30
31 @contextlib.contextmanager
31 @contextlib.contextmanager
32 def lsprofile(ui, fp):
32 def lsprofile(ui, fp):
33 format = ui.config('profiling', 'format', default='text')
33 format = ui.config('profiling', 'format')
34 field = ui.config('profiling', 'sort', default='inlinetime')
34 field = ui.config('profiling', 'sort')
35 limit = ui.configint('profiling', 'limit', default=30)
35 limit = ui.configint('profiling', 'limit')
36 climit = ui.configint('profiling', 'nested', default=0)
36 climit = ui.configint('profiling', 'nested')
37
37
38 if format not in ['text', 'kcachegrind']:
38 if format not in ['text', 'kcachegrind']:
39 ui.warn(_("unrecognized profiling format '%s'"
39 ui.warn(_("unrecognized profiling format '%s'"
@@ -72,7 +72,7 b' def flameprofile(ui, fp):'
72 'flamegraph not available - install from '
72 'flamegraph not available - install from '
73 'https://github.com/evanhempel/python-flamegraph'))
73 'https://github.com/evanhempel/python-flamegraph'))
74 # developer config: profiling.freq
74 # developer config: profiling.freq
75 freq = ui.configint('profiling', 'freq', default=1000)
75 freq = ui.configint('profiling', 'freq')
76 filter_ = None
76 filter_ = None
77 collapse_recursion = True
77 collapse_recursion = True
78 thread = flamegraph.ProfileThread(fp, 1.0 / freq,
78 thread = flamegraph.ProfileThread(fp, 1.0 / freq,
@@ -92,7 +92,7 b' def flameprofile(ui, fp):'
92 def statprofile(ui, fp):
92 def statprofile(ui, fp):
93 from . import statprof
93 from . import statprof
94
94
95 freq = ui.configint('profiling', 'freq', default=1000)
95 freq = ui.configint('profiling', 'freq')
96 if freq > 0:
96 if freq > 0:
97 # Cannot reset when profiler is already active. So silently no-op.
97 # Cannot reset when profiler is already active. So silently no-op.
98 if statprof.state.profile_level == 0:
98 if statprof.state.profile_level == 0:
@@ -107,7 +107,7 b' def statprofile(ui, fp):'
107 finally:
107 finally:
108 data = statprof.stop()
108 data = statprof.stop()
109
109
110 profformat = ui.config('profiling', 'statformat', 'hotpath')
110 profformat = ui.config('profiling', 'statformat')
111
111
112 formats = {
112 formats = {
113 'byline': statprof.DisplayFormats.ByLine,
113 'byline': statprof.DisplayFormats.ByLine,
@@ -92,15 +92,15 b' class progbar(object):'
92 self.startvals = {}
92 self.startvals = {}
93 self.printed = False
93 self.printed = False
94 self.lastprint = time.time() + float(self.ui.config(
94 self.lastprint = time.time() + float(self.ui.config(
95 'progress', 'delay', default=3))
95 'progress', 'delay'))
96 self.curtopic = None
96 self.curtopic = None
97 self.lasttopic = None
97 self.lasttopic = None
98 self.indetcount = 0
98 self.indetcount = 0
99 self.refresh = float(self.ui.config(
99 self.refresh = float(self.ui.config(
100 'progress', 'refresh', default=0.1))
100 'progress', 'refresh'))
101 self.changedelay = max(3 * self.refresh,
101 self.changedelay = max(3 * self.refresh,
102 float(self.ui.config(
102 float(self.ui.config(
103 'progress', 'changedelay', default=1)))
103 'progress', 'changedelay')))
104 self.order = self.ui.configlist(
104 self.order = self.ui.configlist(
105 'progress', 'format',
105 'progress', 'format',
106 default=['topic', 'bar', 'number', 'estimate'])
106 default=['topic', 'bar', 'number', 'estimate'])
@@ -282,7 +282,7 b' def checkportable(ui, f):'
282 def checkportabilityalert(ui):
282 def checkportabilityalert(ui):
283 '''check if the user's config requests nothing, a warning, or abort for
283 '''check if the user's config requests nothing, a warning, or abort for
284 non-portable filenames'''
284 non-portable filenames'''
285 val = ui.config('ui', 'portablefilenames', 'warn')
285 val = ui.config('ui', 'portablefilenames')
286 lval = val.lower()
286 lval = val.lower()
287 bval = util.parsebool(val)
287 bval = util.parsebool(val)
288 abort = pycompat.osname == 'nt' or lval == 'abort'
288 abort = pycompat.osname == 'nt' or lval == 'abort'
@@ -553,7 +553,7 b' def origpath(ui, repo, filepath):'
553 Fetch user defined path from config file: [ui] origbackuppath = <path>
553 Fetch user defined path from config file: [ui] origbackuppath = <path>
554 Fall back to default (filepath) if not specified
554 Fall back to default (filepath) if not specified
555 '''
555 '''
556 origbackuppath = ui.config('ui', 'origbackuppath', None)
556 origbackuppath = ui.config('ui', 'origbackuppath')
557 if origbackuppath is None:
557 if origbackuppath is None:
558 return filepath + ".orig"
558 return filepath + ".orig"
559
559
@@ -106,7 +106,7 b' def patternsforrev(repo, rev):'
106 "in rev %s - ignoring it\n" % (profile, ctx))
106 "in rev %s - ignoring it\n" % (profile, ctx))
107 # experimental config: sparse.missingwarning
107 # experimental config: sparse.missingwarning
108 if repo.ui.configbool(
108 if repo.ui.configbool(
109 'sparse', 'missingwarning', True):
109 'sparse', 'missingwarning'):
110 repo.ui.warn(msg)
110 repo.ui.warn(msg)
111 else:
111 else:
112 repo.ui.debug(msg)
112 repo.ui.debug(msg)
@@ -146,8 +146,8 b' class sshpeer(wireproto.wirepeer):'
146 self.port = u.port
146 self.port = u.port
147 self.path = u.path or "."
147 self.path = u.path or "."
148
148
149 sshcmd = self.ui.config("ui", "ssh", "ssh")
149 sshcmd = self.ui.config("ui", "ssh")
150 remotecmd = self.ui.config("ui", "remotecmd", "hg")
150 remotecmd = self.ui.config("ui", "remotecmd")
151
151
152 args = util.sshargs(sshcmd,
152 args = util.sshargs(sshcmd,
153 _serverquote(self.host),
153 _serverquote(self.host),
@@ -165,7 +165,7 b' def maybeperformlegacystreamclone(pullop'
165
165
166 def allowservergeneration(repo):
166 def allowservergeneration(repo):
167 """Whether streaming clones are allowed from the server."""
167 """Whether streaming clones are allowed from the server."""
168 if not repo.ui.configbool('server', 'uncompressed', True, untrusted=True):
168 if not repo.ui.configbool('server', 'uncompressed', untrusted=True):
169 return False
169 return False
170
170
171 # The way stream clone works makes it impossible to hide secret changesets.
171 # The way stream clone works makes it impossible to hide secret changesets.
@@ -401,7 +401,7 b' def newcommitphase(ui, ctx):'
401 substate = getattr(ctx, "substate", None)
401 substate = getattr(ctx, "substate", None)
402 if not substate:
402 if not substate:
403 return commitphase
403 return commitphase
404 check = ui.config('phases', 'checksubrepos', 'follow')
404 check = ui.config('phases', 'checksubrepos')
405 if check not in ('ignore', 'follow', 'abort'):
405 if check not in ('ignore', 'follow', 'abort'):
406 raise error.Abort(_('invalid phases.checksubrepos configuration: %s')
406 raise error.Abort(_('invalid phases.checksubrepos configuration: %s')
407 % (check))
407 % (check))
@@ -408,8 +408,8 b' class ui(object):'
408 if self.verbose and self.quiet:
408 if self.verbose and self.quiet:
409 self.quiet = self.verbose = False
409 self.quiet = self.verbose = False
410 self._reportuntrusted = self.debugflag or self.configbool("ui",
410 self._reportuntrusted = self.debugflag or self.configbool("ui",
411 "report_untrusted", True)
411 "report_untrusted")
412 self.tracebackflag = self.configbool('ui', 'traceback', False)
412 self.tracebackflag = self.configbool('ui', 'traceback')
413 self.logblockedtimes = self.configbool('ui', 'logblockedtimes')
413 self.logblockedtimes = self.configbool('ui', 'logblockedtimes')
414
414
415 if section in (None, 'trusted'):
415 if section in (None, 'trusted'):
@@ -924,7 +924,7 b' class ui(object):'
924 (util.timer() - starttime) * 1000
924 (util.timer() - starttime) * 1000
925
925
926 def _isatty(self, fh):
926 def _isatty(self, fh):
927 if self.configbool('ui', 'nontty', False):
927 if self.configbool('ui', 'nontty'):
928 return False
928 return False
929 return util.isatty(fh)
929 return util.isatty(fh)
930
930
@@ -947,7 +947,7 b' class ui(object):'
947 if (self._disablepager
947 if (self._disablepager
948 or self.pageractive
948 or self.pageractive
949 or command in self.configlist('pager', 'ignore')
949 or command in self.configlist('pager', 'ignore')
950 or not self.configbool('ui', 'paginate', True)
950 or not self.configbool('ui', 'paginate')
951 or not self.configbool('pager', 'attend-' + command, True)
951 or not self.configbool('pager', 'attend-' + command, True)
952 # TODO: if we want to allow HGPLAINEXCEPT=pager,
952 # TODO: if we want to allow HGPLAINEXCEPT=pager,
953 # formatted() will need some adjustment.
953 # formatted() will need some adjustment.
@@ -1112,7 +1112,7 b' class ui(object):'
1112
1112
1113 # Default interface for all the features
1113 # Default interface for all the features
1114 defaultinterface = "text"
1114 defaultinterface = "text"
1115 i = self.config("ui", "interface", None)
1115 i = self.config("ui", "interface")
1116 if i in alldefaults:
1116 if i in alldefaults:
1117 defaultinterface = i
1117 defaultinterface = i
1118
1118
@@ -1186,7 +1186,7 b' class ui(object):'
1186 if self.plain():
1186 if self.plain():
1187 return False
1187 return False
1188
1188
1189 i = self.configbool("ui", "formatted", None)
1189 i = self.configbool("ui", "formatted")
1190 if i is None:
1190 if i is None:
1191 # some environments replace stdout without implementing isatty
1191 # some environments replace stdout without implementing isatty
1192 # usually those are non-interactive
1192 # usually those are non-interactive
@@ -1464,7 +1464,7 b' class ui(object):'
1464 def _progbar(self):
1464 def _progbar(self):
1465 """setup the progbar singleton to the ui object"""
1465 """setup the progbar singleton to the ui object"""
1466 if (self.quiet or self.debugflag
1466 if (self.quiet or self.debugflag
1467 or self.configbool('progress', 'disable', False)
1467 or self.configbool('progress', 'disable')
1468 or not progress.shouldprint(self)):
1468 or not progress.shouldprint(self)):
1469 return None
1469 return None
1470 return getprogbar(self)
1470 return getprogbar(self)
@@ -454,7 +454,7 b' def opener(ui, authinfo=None):'
454 authinfo will be added to the password manager
454 authinfo will be added to the password manager
455 '''
455 '''
456 # experimental config: ui.usehttp2
456 # experimental config: ui.usehttp2
457 if ui.configbool('ui', 'usehttp2', False):
457 if ui.configbool('ui', 'usehttp2'):
458 handlers = [
458 handlers = [
459 httpconnectionmod.http2handler(
459 httpconnectionmod.http2handler(
460 ui,
460 ui,
@@ -443,7 +443,7 b' class verifier(object):'
443 (l2, l1), f)
443 (l2, l1), f)
444 except error.CensoredNodeError:
444 except error.CensoredNodeError:
445 # experimental config: censor.policy
445 # experimental config: censor.policy
446 if ui.config("censor", "policy", "abort") == "abort":
446 if ui.config("censor", "policy") == "abort":
447 self.err(lr, _("censored file data"), f)
447 self.err(lr, _("censored file data"), f)
448 except Exception as inst:
448 except Exception as inst:
449 self.exc(lr, _("unpacking %s") % short(n), inst, f)
449 self.exc(lr, _("unpacking %s") % short(n), inst, f)
@@ -764,7 +764,7 b' def _capabilities(repo, proto):'
764 # otherwise, add 'streamreqs' detailing our local revlog format
764 # otherwise, add 'streamreqs' detailing our local revlog format
765 else:
765 else:
766 caps.append('streamreqs=%s' % ','.join(sorted(requiredformats)))
766 caps.append('streamreqs=%s' % ','.join(sorted(requiredformats)))
767 if repo.ui.configbool('experimental', 'bundle2-advertise', True):
767 if repo.ui.configbool('experimental', 'bundle2-advertise'):
768 capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo))
768 capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo))
769 caps.append('bundle2=' + urlreq.quote(capsblob))
769 caps.append('bundle2=' + urlreq.quote(capsblob))
770 caps.append('unbundle=%s' % ','.join(bundle2.bundlepriority))
770 caps.append('unbundle=%s' % ','.join(bundle2.bundlepriority))
@@ -772,7 +772,7 b' def _capabilities(repo, proto):'
772 if proto.name == 'http':
772 if proto.name == 'http':
773 caps.append('httpheader=%d' %
773 caps.append('httpheader=%d' %
774 repo.ui.configint('server', 'maxhttpheaderlen'))
774 repo.ui.configint('server', 'maxhttpheaderlen'))
775 if repo.ui.configbool('experimental', 'httppostargs', False):
775 if repo.ui.configbool('experimental', 'httppostargs'):
776 caps.append('httppostargs')
776 caps.append('httppostargs')
777
777
778 # FUTURE advertise 0.2rx once support is implemented
778 # FUTURE advertise 0.2rx once support is implemented
General Comments 0
You need to be logged in to leave comments. Login now