configitems: register the 'progress.estimate' config
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 30 Jun 2017 03:44:04 +0200
changeset 33250 bbc57a7e8823
parent 33249 391da1416038
child 33251 a5cb2e4460de
configitems: register the 'progress.estimate' config
mercurial/configitems.py
mercurial/progress.py
--- a/mercurial/configitems.py	Fri Jun 30 03:44:02 2017 +0200
+++ b/mercurial/configitems.py	Fri Jun 30 03:44:04 2017 +0200
@@ -152,6 +152,9 @@
 coreconfigitem('progress', 'clear-complete',
     default=True,
 )
+coreconfigitem('progress', 'estimate',
+    default=2,
+)
 coreconfigitem('server', 'bundle1',
     default=True,
 )
--- a/mercurial/progress.py	Fri Jun 30 03:44:02 2017 +0200
+++ b/mercurial/progress.py	Fri Jun 30 03:44:04 2017 +0200
@@ -217,7 +217,7 @@
             elapsed = now - self.starttimes[topic]
             # experimental config: progress.estimate
             if elapsed > float(
-                self.ui.config('progress', 'estimate', default=2)):
+                self.ui.config('progress', 'estimate')):
                 seconds = (elapsed * (target - delta)) // delta + 1
                 return fmtremaining(seconds)
         return ''
@@ -227,7 +227,7 @@
         delta = pos - initialpos
         elapsed = now - self.starttimes[topic]
         if elapsed > float(
-            self.ui.config('progress', 'estimate', default=2)):
+            self.ui.config('progress', 'estimate')):
             return _('%d %s/sec') % (delta / elapsed, unit)
         return ''