# HG changeset patch # User Pierre-Yves David # Date 2014-10-02 17:39:37 # Node ID 3b1c0e1ede4cfcabc36030338b2cf6b11f12861f # Parent 45e50d8546d9dbdda97c8131c536923151a085be util: fix sorteddict.pop When using `.pop` on such object the list was not cleared of the popped key, leading to crash. diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -252,6 +252,12 @@ class sortdict(dict): def __delitem__(self, key): dict.__delitem__(self, key) self._list.remove(key) + def pop(self, key, *args, **kwargs): + dict.pop(self, key, *args, **kwargs) + try: + self._list.remove(key) + except ValueError: + pass def keys(self): return self._list def iterkeys(self):