# HG changeset patch # User Pierre-Yves David # Date 1407298584 25200 # Node ID 8665c647da6ea24fbc54cc60a8fd80147ed3820e # Parent f1528ef123f4e380b7d345cae4c0e4e2a59eac28 config: fix restoreconfig of non existing config When the section, but no value existed, the `del` call raised a key error. diff -r f1528ef123f4 -r 8665c647da6e 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):