[PATCH 7 of 10] ui.py: don't query parentui.cdata when looking up config items

Alexis S. L. Carvalho alexis at cecm.usp.br
Thu Sep 21 22:05:19 UTC 2006


# HG changeset patch
# User Alexis S. L. Carvalho <alexis at cecm.usp.br>
# Date 1158879798 10800
# Node ID 21fcb3bf9c21428ad5d2bec9b6891d0ebe51034a
# Parent  743e846e7212d8d28481f4d64ec5a439f0dfb254
ui.py: don't query parentui.cdata when looking up config items.

We copied the contents of parentui.cdata on initialization.

diff -r 743e846e7212 -r 21fcb3bf9c21 mercurial/ui.py
--- a/mercurial/ui.py	Thu Sep 21 20:03:17 2006 -0300
+++ b/mercurial/ui.py	Thu Sep 21 20:03:18 2006 -0300
@@ -103,10 +103,7 @@ class ui(object):
                 raise util.Abort(_("Error in configuration section [%s] "
                                    "parameter '%s':\n%s")
                                  % (section, name, inst))
-        if self.parentui is None:
-            return default
-        else:
-            return self.parentui._config(section, name, default, funcname)
+        return default
 
     def config(self, section, name, default=None):
         return self._config(section, name, default, 'get')
@@ -129,8 +126,6 @@ class ui(object):
 
     def configitems(self, section):
         items = {}
-        if self.parentui is not None:
-            items = dict(self.parentui.configitems(section))
         if self.cdata.has_section(section):
             try:
                 items.update(dict(self.cdata.items(section)))
@@ -141,9 +136,8 @@ class ui(object):
         x.sort()
         return x
 
-    def walkconfig(self, seen=None):
-        if seen is None:
-            seen = {}
+    def walkconfig(self):
+        seen = {}
         for (section, name), value in self.overlay.iteritems():
             yield section, name, value
             seen[section, name] = 1
@@ -154,9 +148,6 @@ class ui(object):
                 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
 
     def extensions(self):
         result = self.configitems("extensions")



More information about the Mercurial mailing list