ui.py: make walkconfig use configitems
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Tue, 10 Oct 2006 18:43:20 -0300
changeset 3342 4eeb79b4da30
parent 3341 a7cec14c9b40
child 3343 ab406cfa1b99
ui.py: make walkconfig use configitems Also make it sort the available config sections while we're at it.
mercurial/ui.py
--- a/mercurial/ui.py	Tue Oct 10 18:43:20 2006 -0300
+++ b/mercurial/ui.py	Tue Oct 10 18:43:20 2006 -0300
@@ -142,15 +142,13 @@
         for (section, name), value in self.overlay.iteritems():
             yield section, name, value
             seen[section, name] = 1
-        for section in self.cdata.sections():
-            try:
-                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
-            except ConfigParser.InterpolationError, inst:
-                raise util.Abort(_("Error in configuration section [%s]:\n%s")
-                                 % (section, inst))
+        sections = self.cdata.sections()
+        sections.sort()
+        for section in sections:
+            for name, value in self.configitems(section):
+                if (section, name) in seen: continue
+                yield section, name, value.replace('\n', '\\n')
+                seen[section, name] = 1
         if self.parentui is not None:
             for parent in self.parentui.walkconfig(seen):
                 yield parent