diff mercurial/commands.py @ 1028:25e7ea0f2cff

Add commands.debugconfig. This lets us both view the actual config data that hg is using, and drive editors that need to see this information.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 23 Aug 2005 21:30:12 -0700
parents 1b6eb272b238
children 28e2f13ca7c4
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Aug 23 16:46:10 2005 -0700
+++ b/mercurial/commands.py	Tue Aug 23 21:30:12 2005 -0700
@@ -597,6 +597,13 @@
     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 @@
          '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 @@
               ('', '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():