diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -597,6 +597,13 @@ def debugcheckstate(ui, repo): if errors: raise util.Abort(".hg/dirstate inconsistent with current parent's manifest") +def debugconfig(ui): + try: + repo = hg.repository(ui) + except: pass + for section, name, value in ui.walkconfig(): + ui.write('%s.%s=%s\n' % (section, name, value)) + def debugstate(ui, repo): """show the contents of the current dirstate""" repo.dirstate.read() @@ -1308,6 +1315,7 @@ table = { 'hg commit [OPTION]... [FILE]...'), "copy": (copy, [], 'hg copy SOURCE DEST'), "debugcheckstate": (debugcheckstate, [], 'debugcheckstate'), + "debugconfig": (debugconfig, [], 'debugconfig'), "debugstate": (debugstate, [], 'debugstate'), "debugindex": (debugindex, [], 'debugindex FILE'), "debugindexdot": (debugindexdot, [], 'debugindexdot FILE'), @@ -1446,7 +1454,7 @@ globalopts = [('v', 'verbose', None, 've ('', 'time', None, 'time how long the command takes'), ] -norepo = "clone init version help debugindex debugindexdot paths" +norepo = "clone init version help debugconfig debugindex debugindexdot paths" def find(cmd): for e in table.keys(): diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -52,6 +52,17 @@ class ui: return self.cdata.items(section) return [] + def walkconfig(self): + seen = {} + for (section, name), value in self.overlay.iteritems(): + yield section, name, value + seen[section, name] = 1 + for section in self.cdata.sections(): + for name, value in self.cdata.items(section): + if (section, name) in seen: continue + yield section, name, value.replace('\n', '\\n') + seen[section, name] = 1 + def username(self): return (os.environ.get("HGUSER") or self.config("ui", "username") or