# HG changeset patch # User Matt Mackall # Date 1240782643 18000 # Node ID b97abc7c1135cf09663ca7a4390fe207289a1133 # Parent 03d93882fc93c682e01e477cefd9940537534e1e showconfig: show source file and line with --debug diff -r 03d93882fc93 -r b97abc7c1135 mercurial/commands.py --- a/mercurial/commands.py Sun Apr 26 16:50:43 2009 -0500 +++ b/mercurial/commands.py Sun Apr 26 16:50:43 2009 -0500 @@ -797,10 +797,16 @@ if values: for v in values: if v == section: + ui.debug('%s: ' % + ui.configsource(section, name, untrusted)) ui.write('%s=%s\n' % (sectname, value)) elif v == sectname: + ui.debug('%s: ' % + ui.configsource(section, name, untrusted)) ui.write(value, '\n') else: + ui.debug('%s: ' % + ui.configsource(section, name, untrusted)) ui.write('%s=%s\n' % (sectname, value)) def debugsetparents(ui, repo, rev1, rev2=None): diff -r 03d93882fc93 -r b97abc7c1135 mercurial/ui.py --- a/mercurial/ui.py Sun Apr 26 16:50:43 2009 -0500 +++ b/mercurial/ui.py Sun Apr 26 16:50:43 2009 -0500 @@ -151,6 +151,9 @@ return self.ucdata return self.cdata + def configsource(self, section, name, untrusted=False): + return self._get_cdata(untrusted).getsource(section, name) or 'none' + def config(self, section, name, default=None, untrusted=False): value = self._get_cdata(untrusted).get(section, name, default) if self.debugflag and not untrusted: