##// END OF EJS Templates
Add commands.debugconfig....
Bryan O'Sullivan -
r1028:25e7ea0f default
parent child Browse files
Show More
@@ -597,6 +597,13 b' def debugcheckstate(ui, repo):'
597 if errors:
597 if errors:
598 raise util.Abort(".hg/dirstate inconsistent with current parent's manifest")
598 raise util.Abort(".hg/dirstate inconsistent with current parent's manifest")
599
599
600 def debugconfig(ui):
601 try:
602 repo = hg.repository(ui)
603 except: pass
604 for section, name, value in ui.walkconfig():
605 ui.write('%s.%s=%s\n' % (section, name, value))
606
600 def debugstate(ui, repo):
607 def debugstate(ui, repo):
601 """show the contents of the current dirstate"""
608 """show the contents of the current dirstate"""
602 repo.dirstate.read()
609 repo.dirstate.read()
@@ -1308,6 +1315,7 b' table = {'
1308 'hg commit [OPTION]... [FILE]...'),
1315 'hg commit [OPTION]... [FILE]...'),
1309 "copy": (copy, [], 'hg copy SOURCE DEST'),
1316 "copy": (copy, [], 'hg copy SOURCE DEST'),
1310 "debugcheckstate": (debugcheckstate, [], 'debugcheckstate'),
1317 "debugcheckstate": (debugcheckstate, [], 'debugcheckstate'),
1318 "debugconfig": (debugconfig, [], 'debugconfig'),
1311 "debugstate": (debugstate, [], 'debugstate'),
1319 "debugstate": (debugstate, [], 'debugstate'),
1312 "debugindex": (debugindex, [], 'debugindex FILE'),
1320 "debugindex": (debugindex, [], 'debugindex FILE'),
1313 "debugindexdot": (debugindexdot, [], 'debugindexdot FILE'),
1321 "debugindexdot": (debugindexdot, [], 'debugindexdot FILE'),
@@ -1446,7 +1454,7 b" globalopts = [('v', 'verbose', None, 've"
1446 ('', 'time', None, 'time how long the command takes'),
1454 ('', 'time', None, 'time how long the command takes'),
1447 ]
1455 ]
1448
1456
1449 norepo = "clone init version help debugindex debugindexdot paths"
1457 norepo = "clone init version help debugconfig debugindex debugindexdot paths"
1450
1458
1451 def find(cmd):
1459 def find(cmd):
1452 for e in table.keys():
1460 for e in table.keys():
@@ -52,6 +52,17 b' class ui:'
52 return self.cdata.items(section)
52 return self.cdata.items(section)
53 return []
53 return []
54
54
55 def walkconfig(self):
56 seen = {}
57 for (section, name), value in self.overlay.iteritems():
58 yield section, name, value
59 seen[section, name] = 1
60 for section in self.cdata.sections():
61 for name, value in self.cdata.items(section):
62 if (section, name) in seen: continue
63 yield section, name, value.replace('\n', '\\n')
64 seen[section, name] = 1
65
55 def username(self):
66 def username(self):
56 return (os.environ.get("HGUSER") or
67 return (os.environ.get("HGUSER") or
57 self.config("ui", "username") or
68 self.config("ui", "username") or
General Comments 0
You need to be logged in to leave comments. Login now