config: fix restoreconfig of non existing config
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 05 Aug 2014 21:16:24 -0700
changeset 22037 8665c647da6e
parent 22036 f1528ef123f4
child 22038 021becbf024a
config: fix restoreconfig of non existing config When the section, but no value existed, the `del` call raised a key error.
mercurial/config.py
--- a/mercurial/config.py	Thu Jul 31 13:51:17 2014 -0700
+++ b/mercurial/config.py	Tue Aug 05 21:16:24 2014 -0700
@@ -76,7 +76,7 @@
             # no data before, remove everything
             section, item = data
             if section in self._data:
-                del self._data[section][item]
+                self._data[section].pop(item, None)
             self._source.pop((section, item), None)
 
     def parse(self, src, data, sections=None, remap=None, include=None):