profiling: cope with configwith default value handling changes
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 21 Jun 2017 10:46:18 +0200
changeset 32978 41b081ac2145
parent 32977 27ba0d8dc26c
child 32979 66117dae87f9
profiling: cope with configwith default value handling changes Changeset 6ff6eb33f353 change 'configwith' behavior so that the default value is run through the conversion function. In parallel a new user of 'configwith' got introduced unaware of this coming behavior change. This broke profiling. We resolve the situation by having the new conversion function cope with a default value already using the right type.
mercurial/profiling.py
--- a/mercurial/profiling.py	Tue Jun 20 14:00:41 2017 -0700
+++ b/mercurial/profiling.py	Wed Jun 21 10:46:18 2017 +0200
@@ -126,6 +126,8 @@
         kwargs = {}
 
         def fraction(s):
+            if isinstance(s, (float, int)):
+                return float(s)
             if s.endswith('%'):
                 v = float(s[:-1]) / 100
             else: