diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -797,10 +797,16 @@ def showconfig(ui, repo, *values, **opts 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 --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -151,6 +151,9 @@ class ui(object): 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: