changeset 32990:1d5d7e2b7ab5

configitems: register 'patch.fuzz' as first example for 'configint' This exercise the default value handling in 'configint'.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 17 Jun 2017 13:17:10 +0200
parents 149b68224b08
children 03608e8d09e9
files mercurial/configitems.py mercurial/patch.py
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/configitems.py	Sat Jun 17 13:08:03 2017 +0200
+++ b/mercurial/configitems.py	Sat Jun 17 13:17:10 2017 +0200
@@ -36,6 +36,9 @@
 
 # Registering actual config items
 
+coreconfigitem('patch', 'fuzz',
+    default=2,
+)
 coreconfigitem('ui', 'quiet',
     default=False,
 )
--- a/mercurial/patch.py	Sat Jun 17 13:08:03 2017 +0200
+++ b/mercurial/patch.py	Sat Jun 17 13:17:10 2017 +0200
@@ -803,7 +803,7 @@
         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