mercurial/config.py
branchstable
changeset 19087 7d82ad4b3727
parent 17537 31f32a96e1e3
child 20789 d19c9bdbbf35
--- a/mercurial/config.py	Fri Apr 26 23:16:25 2013 +0900
+++ b/mercurial/config.py	Fri Apr 26 23:36:12 2013 +0900
@@ -44,6 +44,7 @@
     def __init__(self, data=None):
         self._data = {}
         self._source = {}
+        self._unset = []
         if data:
             for k in data._data:
                 self._data[k] = data[k].copy()
@@ -58,6 +59,10 @@
         for d in self.sections():
             yield d
     def update(self, src):
+        for s, n in src._unset:
+            if s in self and n in self._data[s]:
+                del self._data[s][n]
+                del self._source[(s, n)]
         for s in src:
             if s not in self:
                 self._data[s] = sortdict()
@@ -173,6 +178,7 @@
                     continue
                 if self.get(section, name) is not None:
                     del self._data[section][name]
+                self._unset.append((section, name))
                 continue
 
             raise error.ParseError(l.rstrip(), ("%s:%s" % (src, line)))