changeset 22037:8665c647da6e

config: fix restoreconfig of non existing config When the section, but no value existed, the `del` call raised a key error.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 05 Aug 2014 21:16:24 -0700
parents f1528ef123f4
children 021becbf024a
files mercurial/config.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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):