# HG changeset patch # User Pierre-Yves David # Date 2017-06-17 11:17:10 # Node ID 1d5d7e2b7ab5798c535cd00fee2bad691587b19a # Parent 149b68224b08a3b72701b177d118ba77fc09aa4f configitems: register 'patch.fuzz' as first example for 'configint' This exercise the default value handling in 'configint'. diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -36,6 +36,9 @@ def coreconfigitem(*args, **kwargs): # Registering actual config items +coreconfigitem('patch', 'fuzz', + default=2, +) coreconfigitem('ui', 'quiet', default=False, ) diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -803,7 +803,7 @@ class patchfile(object): for x, s in enumerate(self.lines): self.hash.setdefault(s, []).append(x) - for fuzzlen in xrange(self.ui.configint("patch", "fuzz", 2) + 1): + for fuzzlen in xrange(self.ui.configint("patch", "fuzz") + 1): for toponly in [True, False]: old, oldstart, new, newstart = h.fuzzit(fuzzlen, toponly) oldstart = oldstart + self.offset + self.skew