comparison mercurial/ui.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 4f81068ed8cd
children 6d5a62a549fa
comparison
equal deleted inserted replaced
1027:cb31576ed3e4 1028:25e7ea0f2cff
49 49
50 def configitems(self, section): 50 def configitems(self, section):
51 if self.cdata.has_section(section): 51 if self.cdata.has_section(section):
52 return self.cdata.items(section) 52 return self.cdata.items(section)
53 return [] 53 return []
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
54 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
58 os.environ.get("EMAIL") or 69 os.environ.get("EMAIL") or