config.sortdict: override clear method stable
authorSune Foldager <cryo@cyanite.org>
Mon, 20 Jun 2011 10:51:37 +0200
branchstable
changeset 14696 5fb3cb7266e5
parent 14695 e4d3370fa234
child 14697 b1880474e3ad
child 14698 df902fe3d79e
config.sortdict: override clear method Overrides dict.clear. It's not currently used, but was broken for sortdict. Contributed by Stepan Koltsov <yozh@mx1.ru>
mercurial/config.py
--- a/mercurial/config.py	Mon Jun 20 09:30:03 2011 +0200
+++ b/mercurial/config.py	Mon Jun 20 10:51:37 2011 +0200
@@ -27,6 +27,9 @@
     def update(self, src):
         for k in src:
             self[k] = src[k]
+    def clear(self):
+        dict.clear(self)
+        self._list = []
     def items(self):
         return [(k, self[k]) for k in self._list]
     def __delitem__(self, key):