##// END OF EJS Templates
config: set a 'source' in most cases where config don't come from file but code...
Mads Kiilerich -
r20790:49f2d564 default
parent child Browse files
Show More
@@ -151,7 +151,7 b' class eolfile(object):'
151 self.cfg = config.config()
151 self.cfg = config.config()
152 # Our files should not be touched. The pattern must be
152 # Our files should not be touched. The pattern must be
153 # inserted first override a '** = native' pattern.
153 # inserted first override a '** = native' pattern.
154 self.cfg.set('patterns', '.hg*', 'BIN')
154 self.cfg.set('patterns', '.hg*', 'BIN', 'eol')
155 # We can then parse the user's patterns.
155 # We can then parse the user's patterns.
156 self.cfg.parse('.hgeol', data)
156 self.cfg.parse('.hgeol', data)
157
157
@@ -176,14 +176,14 b' class eolfile(object):'
176 for pattern, style in self.cfg.items('patterns'):
176 for pattern, style in self.cfg.items('patterns'):
177 key = style.upper()
177 key = style.upper()
178 try:
178 try:
179 ui.setconfig('decode', pattern, self._decode[key])
179 ui.setconfig('decode', pattern, self._decode[key], 'eol')
180 ui.setconfig('encode', pattern, self._encode[key])
180 ui.setconfig('encode', pattern, self._encode[key], 'eol')
181 except KeyError:
181 except KeyError:
182 ui.warn(_("ignoring unknown EOL style '%s' from %s\n")
182 ui.warn(_("ignoring unknown EOL style '%s' from %s\n")
183 % (style, self.cfg.source('patterns', pattern)))
183 % (style, self.cfg.source('patterns', pattern)))
184 # eol.only-consistent can be specified in ~/.hgrc or .hgeol
184 # eol.only-consistent can be specified in ~/.hgrc or .hgeol
185 for k, v in self.cfg.items('eol'):
185 for k, v in self.cfg.items('eol'):
186 ui.setconfig('eol', k, v)
186 ui.setconfig('eol', k, v, 'eol')
187
187
188 def checkrev(self, repo, ctx, files):
188 def checkrev(self, repo, ctx, files):
189 failed = []
189 failed = []
@@ -261,7 +261,7 b' def preupdate(ui, repo, hooktype, parent'
261 return False
261 return False
262
262
263 def uisetup(ui):
263 def uisetup(ui):
264 ui.setconfig('hooks', 'preupdate.eol', preupdate)
264 ui.setconfig('hooks', 'preupdate.eol', preupdate, 'eol')
265
265
266 def extsetup(ui):
266 def extsetup(ui):
267 try:
267 try:
@@ -280,7 +280,7 b' def reposetup(ui, repo):'
280 for name, fn in filters.iteritems():
280 for name, fn in filters.iteritems():
281 repo.adddatafilter(name, fn)
281 repo.adddatafilter(name, fn)
282
282
283 ui.setconfig('patch', 'eol', 'auto')
283 ui.setconfig('patch', 'eol', 'auto', 'eol')
284
284
285 class eolrepo(repo.__class__):
285 class eolrepo(repo.__class__):
286
286
@@ -198,7 +198,8 b' def commitfuncfor(repo, src):'
198 def commitfunc(**kwargs):
198 def commitfunc(**kwargs):
199 phasebackup = repo.ui.backupconfig('phases', 'new-commit')
199 phasebackup = repo.ui.backupconfig('phases', 'new-commit')
200 try:
200 try:
201 repo.ui.setconfig('phases', 'new-commit', phasemin)
201 repo.ui.setconfig('phases', 'new-commit', phasemin,
202 'histedit')
202 extra = kwargs.get('extra', {}).copy()
203 extra = kwargs.get('extra', {}).copy()
203 extra['histedit_source'] = src.hex()
204 extra['histedit_source'] = src.hex()
204 kwargs['extra'] = extra
205 kwargs['extra'] = extra
@@ -220,11 +221,12 b' def applychanges(ui, repo, ctx, opts):'
220 else:
221 else:
221 try:
222 try:
222 # ui.forcemerge is an internal variable, do not document
223 # ui.forcemerge is an internal variable, do not document
223 repo.ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
224 repo.ui.setconfig('ui', 'forcemerge', opts.get('tool', ''),
225 'histedit')
224 stats = mergemod.update(repo, ctx.node(), True, True, False,
226 stats = mergemod.update(repo, ctx.node(), True, True, False,
225 ctx.p1().node())
227 ctx.p1().node())
226 finally:
228 finally:
227 repo.ui.setconfig('ui', 'forcemerge', '')
229 repo.ui.setconfig('ui', 'forcemerge', '', 'histedit')
228 repo.setparents(wcpar, node.nullid)
230 repo.setparents(wcpar, node.nullid)
229 repo.dirstate.write()
231 repo.dirstate.write()
230 # fix up dirstate for copies and renames
232 # fix up dirstate for copies and renames
@@ -375,7 +377,7 b' def finishfold(ui, repo, ctx, oldctx, ne'
375 phasebackup = repo.ui.backupconfig('phases', 'new-commit')
377 phasebackup = repo.ui.backupconfig('phases', 'new-commit')
376 try:
378 try:
377 phasemin = max(ctx.phase(), oldctx.phase())
379 phasemin = max(ctx.phase(), oldctx.phase())
378 repo.ui.setconfig('phases', 'new-commit', phasemin)
380 repo.ui.setconfig('phases', 'new-commit', phasemin, 'histedit')
379 n = collapse(repo, ctx, repo[newnode], commitopts)
381 n = collapse(repo, ctx, repo[newnode], commitopts)
380 finally:
382 finally:
381 repo.ui.restoreconfig(phasebackup)
383 repo.ui.restoreconfig(phasebackup)
@@ -385,10 +385,10 b' def demo(ui, repo, *args, **opts):'
385 tmpdir = tempfile.mkdtemp('', 'kwdemo.')
385 tmpdir = tempfile.mkdtemp('', 'kwdemo.')
386 ui.note(_('creating temporary repository at %s\n') % tmpdir)
386 ui.note(_('creating temporary repository at %s\n') % tmpdir)
387 repo = localrepo.localrepository(repo.baseui, tmpdir, True)
387 repo = localrepo.localrepository(repo.baseui, tmpdir, True)
388 ui.setconfig('keyword', fn, '')
388 ui.setconfig('keyword', fn, '', 'keyword')
389 svn = ui.configbool('keywordset', 'svn')
389 svn = ui.configbool('keywordset', 'svn')
390 # explicitly set keywordset for demo output
390 # explicitly set keywordset for demo output
391 ui.setconfig('keywordset', 'svn', svn)
391 ui.setconfig('keywordset', 'svn', svn, 'keyword')
392
392
393 uikwmaps = ui.configitems('keywordmaps')
393 uikwmaps = ui.configitems('keywordmaps')
394 if args or opts.get('rcfile'):
394 if args or opts.get('rcfile'):
@@ -419,7 +419,7 b' def demo(ui, repo, *args, **opts):'
419 if uikwmaps:
419 if uikwmaps:
420 ui.status(_('\tdisabling current template maps\n'))
420 ui.status(_('\tdisabling current template maps\n'))
421 for k, v in kwmaps.iteritems():
421 for k, v in kwmaps.iteritems():
422 ui.setconfig('keywordmaps', k, v)
422 ui.setconfig('keywordmaps', k, v, 'keyword')
423 else:
423 else:
424 ui.status(_('\n\tconfiguration using current keyword template maps\n'))
424 ui.status(_('\n\tconfiguration using current keyword template maps\n'))
425 if uikwmaps:
425 if uikwmaps:
@@ -445,7 +445,7 b' def demo(ui, repo, *args, **opts):'
445 wlock.release()
445 wlock.release()
446 for name, cmd in ui.configitems('hooks'):
446 for name, cmd in ui.configitems('hooks'):
447 if name.split('.', 1)[0].find('commit') > -1:
447 if name.split('.', 1)[0].find('commit') > -1:
448 repo.ui.setconfig('hooks', name, '')
448 repo.ui.setconfig('hooks', name, '', 'keyword')
449 msg = _('hg keyword configuration and expansion example')
449 msg = _('hg keyword configuration and expansion example')
450 ui.note(("hg ci -m '%s'\n" % msg))
450 ui.note(("hg ci -m '%s'\n" % msg))
451 repo.commit(text=msg)
451 repo.commit(text=msg)
@@ -510,5 +510,6 b' def reposetup(ui, repo):'
510 repo.requirements.add('largefiles')
510 repo.requirements.add('largefiles')
511 repo._writerequirements()
511 repo._writerequirements()
512
512
513 ui.setconfig('hooks', 'changegroup.lfiles', checkrequireslfiles)
513 ui.setconfig('hooks', 'changegroup.lfiles', checkrequireslfiles,
514 ui.setconfig('hooks', 'commit.lfiles', checkrequireslfiles)
514 'largefiles')
515 ui.setconfig('hooks', 'commit.lfiles', checkrequireslfiles, 'largefiles')
@@ -304,7 +304,7 b' def newcommit(repo, phase, *args, **kwar'
304 backup = repo.ui.backupconfig('phases', 'new-commit')
304 backup = repo.ui.backupconfig('phases', 'new-commit')
305 try:
305 try:
306 if phase is not None:
306 if phase is not None:
307 repo.ui.setconfig('phases', 'new-commit', phase)
307 repo.ui.setconfig('phases', 'new-commit', phase, 'mq')
308 return repo.commit(*args, **kwargs)
308 return repo.commit(*args, **kwargs)
309 finally:
309 finally:
310 if phase is not None:
310 if phase is not None:
@@ -129,8 +129,8 b' def uisetup(ui):'
129 if (always or auto and
129 if (always or auto and
130 (cmd in attend or
130 (cmd in attend or
131 (cmd not in ignore and not attend))):
131 (cmd not in ignore and not attend))):
132 ui.setconfig('ui', 'formatted', ui.formatted())
132 ui.setconfig('ui', 'formatted', ui.formatted(), 'pager')
133 ui.setconfig('ui', 'interactive', False)
133 ui.setconfig('ui', 'interactive', False, 'pager')
134 if util.safehasattr(signal, "SIGPIPE"):
134 if util.safehasattr(signal, "SIGPIPE"):
135 signal.signal(signal.SIGPIPE, signal.SIG_DFL)
135 signal.signal(signal.SIGPIPE, signal.SIG_DFL)
136 _runpager(ui, p)
136 _runpager(ui, p)
@@ -546,11 +546,11 b' def patchbomb(ui, repo, *revs, **opts):'
546 if not sendmail:
546 if not sendmail:
547 verifycert = ui.config('smtp', 'verifycert')
547 verifycert = ui.config('smtp', 'verifycert')
548 if opts.get('insecure'):
548 if opts.get('insecure'):
549 ui.setconfig('smtp', 'verifycert', 'loose')
549 ui.setconfig('smtp', 'verifycert', 'loose', 'patchbomb')
550 try:
550 try:
551 sendmail = mail.connect(ui, mbox=mbox)
551 sendmail = mail.connect(ui, mbox=mbox)
552 finally:
552 finally:
553 ui.setconfig('smtp', 'verifycert', verifycert)
553 ui.setconfig('smtp', 'verifycert', verifycert, 'patchbomb')
554 ui.status(_('sending '), subj, ' ...\n')
554 ui.status(_('sending '), subj, ' ...\n')
555 ui.progress(_('sending'), i, item=subj, total=len(msgs))
555 ui.progress(_('sending'), i, item=subj, total=len(msgs))
556 if not mbox:
556 if not mbox:
@@ -330,14 +330,15 b' def rebase(ui, repo, **opts):'
330 repo.ui.debug('resuming interrupted rebase\n')
330 repo.ui.debug('resuming interrupted rebase\n')
331 else:
331 else:
332 try:
332 try:
333 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
333 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''),
334 'rebase')
334 stats = rebasenode(repo, rev, p1, state, collapsef)
335 stats = rebasenode(repo, rev, p1, state, collapsef)
335 if stats and stats[3] > 0:
336 if stats and stats[3] > 0:
336 raise error.InterventionRequired(
337 raise error.InterventionRequired(
337 _('unresolved conflicts (see hg '
338 _('unresolved conflicts (see hg '
338 'resolve, then hg rebase --continue)'))
339 'resolve, then hg rebase --continue)'))
339 finally:
340 finally:
340 ui.setconfig('ui', 'forcemerge', '')
341 ui.setconfig('ui', 'forcemerge', '', 'rebase')
341 cmdutil.duplicatecopies(repo, rev, target)
342 cmdutil.duplicatecopies(repo, rev, target)
342 if not collapsef:
343 if not collapsef:
343 newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn,
344 newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn,
@@ -193,7 +193,7 b' class bundlerepository(localrepo.localre'
193 self._tempparent = tempfile.mkdtemp()
193 self._tempparent = tempfile.mkdtemp()
194 localrepo.instance(ui, self._tempparent, 1)
194 localrepo.instance(ui, self._tempparent, 1)
195 localrepo.localrepository.__init__(self, ui, self._tempparent)
195 localrepo.localrepository.__init__(self, ui, self._tempparent)
196 self.ui.setconfig('phases', 'publish', False)
196 self.ui.setconfig('phases', 'publish', False, 'bundlerepo')
197
197
198 if path:
198 if path:
199 self._url = 'bundle:' + util.expandpath(path) + '+' + bundlename
199 self._url = 'bundle:' + util.expandpath(path) + '+' + bundlename
@@ -1982,10 +1982,10 b' def amend(ui, repo, commitfunc, old, ext'
1982 commitphase = 'secret'
1982 commitphase = 'secret'
1983 else:
1983 else:
1984 commitphase = old.phase()
1984 commitphase = old.phase()
1985 repo.ui.setconfig('phases', 'new-commit', commitphase)
1985 repo.ui.setconfig('phases', 'new-commit', commitphase, 'amend')
1986 newid = repo.commitctx(new)
1986 newid = repo.commitctx(new)
1987 finally:
1987 finally:
1988 repo.ui.setconfig('phases', 'new-commit', ph)
1988 repo.ui.setconfig('phases', 'new-commit', ph, 'amend')
1989 if newid != old.node():
1989 if newid != old.node():
1990 # Reroute the working copy parent to the new changeset
1990 # Reroute the working copy parent to the new changeset
1991 repo.setparents(newid, nullid)
1991 repo.setparents(newid, nullid)
@@ -465,7 +465,8 b' def backout(ui, repo, node=None, rev=Non'
465 rctx = scmutil.revsingle(repo, hex(parent))
465 rctx = scmutil.revsingle(repo, hex(parent))
466 if not opts.get('merge') and op1 != node:
466 if not opts.get('merge') and op1 != node:
467 try:
467 try:
468 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
468 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''),
469 'backout')
469 stats = mergemod.update(repo, parent, True, True, False,
470 stats = mergemod.update(repo, parent, True, True, False,
470 node, False)
471 node, False)
471 repo.setparents(op1, op2)
472 repo.setparents(op1, op2)
@@ -479,7 +480,7 b' def backout(ui, repo, node=None, rev=Non'
479 ui.status(msg % short(node))
480 ui.status(msg % short(node))
480 return stats[3] > 0
481 return stats[3] > 0
481 finally:
482 finally:
482 ui.setconfig('ui', 'forcemerge', '')
483 ui.setconfig('ui', 'forcemerge', '', '')
483 else:
484 else:
484 hg.clean(repo, node, show_stats=False)
485 hg.clean(repo, node, show_stats=False)
485 repo.dirstate.setbranch(branch)
486 repo.dirstate.setbranch(branch)
@@ -507,10 +508,11 b' def backout(ui, repo, node=None, rev=Non'
507 ui.status(_('merging with changeset %s\n')
508 ui.status(_('merging with changeset %s\n')
508 % nice(repo.changelog.tip()))
509 % nice(repo.changelog.tip()))
509 try:
510 try:
510 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
511 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''),
512 'backout')
511 return hg.merge(repo, hex(repo.changelog.tip()))
513 return hg.merge(repo, hex(repo.changelog.tip()))
512 finally:
514 finally:
513 ui.setconfig('ui', 'forcemerge', '')
515 ui.setconfig('ui', 'forcemerge', '', '')
514 finally:
516 finally:
515 wlock.release()
517 wlock.release()
516 return 0
518 return 0
@@ -1361,7 +1363,7 b' def commit(ui, repo, *pats, **opts):'
1361 if opts.get('amend'):
1363 if opts.get('amend'):
1362 raise util.Abort(_('cannot amend with --subrepos'))
1364 raise util.Abort(_('cannot amend with --subrepos'))
1363 # Let --subrepos on the command line override config setting.
1365 # Let --subrepos on the command line override config setting.
1364 ui.setconfig('ui', 'commitsubrepos', True)
1366 ui.setconfig('ui', 'commitsubrepos', True, 'commit')
1365
1367
1366 # Save this for restoring it later
1368 # Save this for restoring it later
1367 oldcommitphase = ui.config('phases', 'new-commit')
1369 oldcommitphase = ui.config('phases', 'new-commit')
@@ -1436,15 +1438,17 b' def commit(ui, repo, *pats, **opts):'
1436 def commitfunc(ui, repo, message, match, opts):
1438 def commitfunc(ui, repo, message, match, opts):
1437 try:
1439 try:
1438 if opts.get('secret'):
1440 if opts.get('secret'):
1439 ui.setconfig('phases', 'new-commit', 'secret')
1441 ui.setconfig('phases', 'new-commit', 'secret', 'commit')
1440 # Propagate to subrepos
1442 # Propagate to subrepos
1441 repo.baseui.setconfig('phases', 'new-commit', 'secret')
1443 repo.baseui.setconfig('phases', 'new-commit', 'secret',
1444 'commit')
1442
1445
1443 return repo.commit(message, opts.get('user'), opts.get('date'),
1446 return repo.commit(message, opts.get('user'), opts.get('date'),
1444 match, editor=e, extra=extra)
1447 match, editor=e, extra=extra)
1445 finally:
1448 finally:
1446 ui.setconfig('phases', 'new-commit', oldcommitphase)
1449 ui.setconfig('phases', 'new-commit', oldcommitphase, 'commit')
1447 repo.baseui.setconfig('phases', 'new-commit', oldcommitphase)
1450 repo.baseui.setconfig('phases', 'new-commit', oldcommitphase,
1451 'commit')
1448
1452
1449
1453
1450 node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
1454 node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
@@ -3196,11 +3200,12 b' def graft(ui, repo, *revs, **opts):'
3196 # perform the graft merge with p1(rev) as 'ancestor'
3200 # perform the graft merge with p1(rev) as 'ancestor'
3197 try:
3201 try:
3198 # ui.forcemerge is an internal variable, do not document
3202 # ui.forcemerge is an internal variable, do not document
3199 repo.ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
3203 repo.ui.setconfig('ui', 'forcemerge', opts.get('tool', ''),
3204 'graft')
3200 stats = mergemod.update(repo, ctx.node(), True, True, False,
3205 stats = mergemod.update(repo, ctx.node(), True, True, False,
3201 ctx.p1().node())
3206 ctx.p1().node())
3202 finally:
3207 finally:
3203 repo.ui.setconfig('ui', 'forcemerge', '')
3208 repo.ui.setconfig('ui', 'forcemerge', '', 'graft')
3204 # report any conflicts
3209 # report any conflicts
3205 if stats and stats[3] > 0:
3210 if stats and stats[3] > 0:
3206 # write out state for --continue
3211 # write out state for --continue
@@ -4325,10 +4330,10 b' def merge(ui, repo, node=None, **opts):'
4325
4330
4326 try:
4331 try:
4327 # ui.forcemerge is an internal variable, do not document
4332 # ui.forcemerge is an internal variable, do not document
4328 repo.ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
4333 repo.ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'merge')
4329 return hg.merge(repo, node, force=opts.get('force'))
4334 return hg.merge(repo, node, force=opts.get('force'))
4330 finally:
4335 finally:
4331 ui.setconfig('ui', 'forcemerge', '')
4336 ui.setconfig('ui', 'forcemerge', '', 'merge')
4332
4337
4333 @command('outgoing|out',
4338 @command('outgoing|out',
4334 [('f', 'force', None, _('run even when the destination is unrelated')),
4339 [('f', 'force', None, _('run even when the destination is unrelated')),
@@ -4708,7 +4713,7 b' def push(ui, repo, dest=None, **opts):'
4708 """
4713 """
4709
4714
4710 if opts.get('bookmark'):
4715 if opts.get('bookmark'):
4711 ui.setconfig('bookmarks', 'pushing', opts['bookmark'])
4716 ui.setconfig('bookmarks', 'pushing', opts['bookmark'], 'push')
4712 for b in opts['bookmark']:
4717 for b in opts['bookmark']:
4713 # translate -B options to -r so changesets get pushed
4718 # translate -B options to -r so changesets get pushed
4714 if b in repo._bookmarks:
4719 if b in repo._bookmarks:
@@ -4984,11 +4989,12 b' def resolve(ui, repo, *pats, **opts):'
4984
4989
4985 try:
4990 try:
4986 # resolve file
4991 # resolve file
4987 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
4992 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''),
4993 'resolve')
4988 if ms.resolve(f, wctx):
4994 if ms.resolve(f, wctx):
4989 ret = 1
4995 ret = 1
4990 finally:
4996 finally:
4991 ui.setconfig('ui', 'forcemerge', '')
4997 ui.setconfig('ui', 'forcemerge', '', 'resolve')
4992 ms.commit()
4998 ms.commit()
4993
4999
4994 # replace filemerge's .orig file with our resolve file
5000 # replace filemerge's .orig file with our resolve file
@@ -5205,9 +5211,9 b' def serve(ui, repo, **opts):'
5205 val = opts.get(o, '')
5211 val = opts.get(o, '')
5206 if val in (None, ''): # should check against default options instead
5212 if val in (None, ''): # should check against default options instead
5207 continue
5213 continue
5208 baseui.setconfig("web", o, val)
5214 baseui.setconfig("web", o, val, 'serve')
5209 if repo and repo.ui != baseui:
5215 if repo and repo.ui != baseui:
5210 repo.ui.setconfig("web", o, val)
5216 repo.ui.setconfig("web", o, val, 'serve')
5211
5217
5212 o = opts.get('web_conf') or opts.get('webdir_conf')
5218 o = opts.get('web_conf') or opts.get('webdir_conf')
5213 if not o:
5219 if not o:
@@ -405,7 +405,7 b' def clone(ui, peeropts, source, dest=Non'
405 fp.write("default = %s\n" % defaulturl)
405 fp.write("default = %s\n" % defaulturl)
406 fp.close()
406 fp.close()
407
407
408 destrepo.ui.setconfig('paths', 'default', defaulturl)
408 destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone')
409
409
410 if update:
410 if update:
411 if update is not True:
411 if update is not True:
@@ -613,19 +613,19 b' def remoteui(src, opts):'
613 for o in 'ssh', 'remotecmd':
613 for o in 'ssh', 'remotecmd':
614 v = opts.get(o) or src.config('ui', o)
614 v = opts.get(o) or src.config('ui', o)
615 if v:
615 if v:
616 dst.setconfig("ui", o, v)
616 dst.setconfig("ui", o, v, 'copied')
617
617
618 # copy bundle-specific options
618 # copy bundle-specific options
619 r = src.config('bundle', 'mainreporoot')
619 r = src.config('bundle', 'mainreporoot')
620 if r:
620 if r:
621 dst.setconfig('bundle', 'mainreporoot', r)
621 dst.setconfig('bundle', 'mainreporoot', r, 'copied')
622
622
623 # copy selected local settings to the remote ui
623 # copy selected local settings to the remote ui
624 for sect in ('auth', 'hostfingerprints', 'http_proxy'):
624 for sect in ('auth', 'hostfingerprints', 'http_proxy'):
625 for key, val in src.configitems(sect):
625 for key, val in src.configitems(sect):
626 dst.setconfig(sect, key, val)
626 dst.setconfig(sect, key, val, 'copied')
627 v = src.config('web', 'cacerts')
627 v = src.config('web', 'cacerts')
628 if v:
628 if v:
629 dst.setconfig('web', 'cacerts', util.expandpath(v))
629 dst.setconfig('web', 'cacerts', util.expandpath(v), 'copied')
630
630
631 return dst
631 return dst
@@ -64,10 +64,10 b' class hgweb(object):'
64 r = repo
64 r = repo
65
65
66 r = self._getview(r)
66 r = self._getview(r)
67 r.ui.setconfig('ui', 'report_untrusted', 'off')
67 r.ui.setconfig('ui', 'report_untrusted', 'off', 'hgweb')
68 r.baseui.setconfig('ui', 'report_untrusted', 'off')
68 r.baseui.setconfig('ui', 'report_untrusted', 'off', 'hgweb')
69 r.ui.setconfig('ui', 'nontty', 'true')
69 r.ui.setconfig('ui', 'nontty', 'true', 'hgweb')
70 r.baseui.setconfig('ui', 'nontty', 'true')
70 r.baseui.setconfig('ui', 'nontty', 'true', 'hgweb')
71 self.repo = r
71 self.repo = r
72 hook.redirect(True)
72 hook.redirect(True)
73 self.mtime = -1
73 self.mtime = -1
@@ -96,8 +96,8 b' class hgwebdir(object):'
96 u = self.baseui.copy()
96 u = self.baseui.copy()
97 else:
97 else:
98 u = ui.ui()
98 u = ui.ui()
99 u.setconfig('ui', 'report_untrusted', 'off')
99 u.setconfig('ui', 'report_untrusted', 'off', 'hgwebdir')
100 u.setconfig('ui', 'nontty', 'true')
100 u.setconfig('ui', 'nontty', 'true', 'hgwebdir')
101
101
102 if not isinstance(self.conf, (dict, list, tuple)):
102 if not isinstance(self.conf, (dict, list, tuple)):
103 map = {'paths': 'hgweb-paths'}
103 map = {'paths': 'hgweb-paths'}
@@ -512,8 +512,8 b' class hgsubrepo(abstractsubrepo):'
512 for s, k in [('ui', 'commitsubrepos')]:
512 for s, k in [('ui', 'commitsubrepos')]:
513 v = r.ui.config(s, k)
513 v = r.ui.config(s, k)
514 if v:
514 if v:
515 self._repo.ui.setconfig(s, k, v)
515 self._repo.ui.setconfig(s, k, v, 'subrepo')
516 self._repo.ui.setconfig('ui', '_usedassubrepo', 'True')
516 self._repo.ui.setconfig('ui', '_usedassubrepo', 'True', 'subrepo')
517 self._initrepo(r, state[0], create)
517 self._initrepo(r, state[0], create)
518
518
519 def storeclean(self, path):
519 def storeclean(self, path):
@@ -594,7 +594,7 b' class hgsubrepo(abstractsubrepo):'
594 def addpathconfig(key, value):
594 def addpathconfig(key, value):
595 if value:
595 if value:
596 fp.write('%s = %s\n' % (key, value))
596 fp.write('%s = %s\n' % (key, value))
597 self._repo.ui.setconfig('paths', key, value)
597 self._repo.ui.setconfig('paths', key, value, 'subrepo')
598
598
599 defpath = _abssource(self._repo, abort=False)
599 defpath = _abssource(self._repo, abort=False)
600 defpushpath = _abssource(self._repo, True, abort=False)
600 defpushpath = _abssource(self._repo, True, abort=False)
@@ -170,7 +170,7 b' class unionpeer(localrepo.localpeer):'
170 class unionrepository(localrepo.localrepository):
170 class unionrepository(localrepo.localrepository):
171 def __init__(self, ui, path, path2):
171 def __init__(self, ui, path, path2):
172 localrepo.localrepository.__init__(self, ui, path)
172 localrepo.localrepository.__init__(self, ui, path)
173 self.ui.setconfig('phases', 'publish', False)
173 self.ui.setconfig('phases', 'publish', False, 'unionrepo')
174
174
175 self._url = 'union:%s+%s' % (util.expandpath(path),
175 self._url = 'union:%s+%s' % (util.expandpath(path),
176 util.expandpath(path2))
176 util.expandpath(path2))
General Comments 0
You need to be logged in to leave comments. Login now