# HG changeset patch # User Pierre-Yves David # Date 2014-08-06 04:16:24 # 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 --git a/mercurial/config.py b/mercurial/config.py --- a/mercurial/config.py +++ b/mercurial/config.py @@ -76,7 +76,7 @@ class config(object): # 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):