comparison mercurial/subrepo.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 d4f804caa0ed
children c7d543eebe1a
comparison
equal deleted inserted replaced
20789:d19c9bdbbf35 20790:49f2d5644f04
510 util.makedirs(root) 510 util.makedirs(root)
511 self._repo = hg.repository(r.baseui, root, create=create) 511 self._repo = hg.repository(r.baseui, root, create=create)
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):
520 clean = True 520 clean = True
521 lock = self._repo.lock() 521 lock = self._repo.lock()
592 fp.write('[paths]\n') 592 fp.write('[paths]\n')
593 593
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)
601 addpathconfig('default', defpath) 601 addpathconfig('default', defpath)
602 if defpath != defpushpath: 602 if defpath != defpushpath: