comparison mercurial/hg.py @ 20790:49f2d5644f04

config: set a 'source' in most cases where config don't come from file but code Some extensions set configuration settings that showed up in 'hg showconfig --debug' with 'none' as source. That was confusing. Instead, they will now tell which extension they come from. This change tries to be consistent and specify a source everywhere - also where it perhaps is less relevant.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 19 Mar 2014 02:45:14 +0100
parents 7d269e7620c4
children 069bf1b821c8
comparison
equal deleted inserted replaced
20789:d19c9bdbbf35 20790:49f2d5644f04
403 u.passwd = None 403 u.passwd = None
404 defaulturl = str(u) 404 defaulturl = str(u)
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:
412 checkout = srcpeer.lookup(update) 412 checkout = srcpeer.lookup(update)
413 uprev = None 413 uprev = None
611 611
612 # copy ssh-specific options 612 # copy ssh-specific options
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