ui: less links to parentui
authorMatt Mackall <mpm@selenic.com>
Sun, 26 Apr 2009 16:50:43 -0500
changeset 8187 d2504744e7a5
parent 8186 6a0018cdb2fe
child 8188 f3abe032fc89
ui: less links to parentui
mercurial/config.py
mercurial/ui.py
--- a/mercurial/config.py	Sun Apr 26 16:50:43 2009 -0500
+++ b/mercurial/config.py	Sun Apr 26 16:50:43 2009 -0500
@@ -6,8 +6,6 @@
     def __init__(self, data=None):
         self._list = []
         if data:
-            if hasattr(data, '_list'):
-                self._list = list(data._list)
             self.update(data)
     def copy(self):
         return sortdict(self)
--- a/mercurial/ui.py	Sun Apr 26 16:50:43 2009 -0500
+++ b/mercurial/ui.py	Sun Apr 26 16:50:43 2009 -0500
@@ -25,24 +25,19 @@
         self.trusted_groups = {}
 
         if parentui:
-            # parentui may point to an ui object which is already a child
             self.parentui = parentui.parentui or parentui
-            self.cdata.update(self.parentui.cdata)
-            self.ucdata.update(self.parentui.ucdata)
-            # we want the overlay from the parent, not the root
-            self.overlay.update(parentui.overlay)
-            self.buffers = parentui.buffers
+            self.cdata = self.parentui.cdata.copy()
+            self.ucdata = self.parentui.ucdata.copy()
+            self.overlay = parentui.overlay.copy()
             self.trusted_users = parentui.trusted_users.copy()
             self.trusted_groups = parentui.trusted_groups.copy()
+            self.buffers = parentui.buffers
             self.fixconfig()
         else:
             # we always trust global config files
             for f in util.rcpath():
                 self.readconfig(f, assumetrusted=True)
 
-    def __getattr__(self, key):
-        return getattr(self.parentui, key)
-
     _isatty = None
     def isatty(self):
         if ui._isatty is None: