changeset 33250:bbc57a7e8823

configitems: register the 'progress.estimate' config
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 30 Jun 2017 03:44:04 +0200
parents 391da1416038
children a5cb2e4460de
files mercurial/configitems.py mercurial/progress.py
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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 ''