diff mercurial/ui.py @ 3342:4eeb79b4da30

ui.py: make walkconfig use configitems Also make it sort the available config sections while we're at it.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Tue, 10 Oct 2006 18:43:20 -0300
parents a7cec14c9b40
children ab406cfa1b99
line wrap: on
line diff
--- 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