changeset 34320:f428c347d32b

progress: remove progress.estimate config It was introduced by 98e4d39 ("progress: add speed format" 2011-5-9) and was intended to hide ETA information for the first few seconds. Later 5d261fd ("progress: add a changedelay to prevent parallel topics from flapping (issue2698)" 2011-6-23) introduced `changedelay` config which hides the entire progress bar for the first few seconds. So `progress.estimate` seems somehow duplicated feature-wise. Since it's experimental and duplicated, let's just remove it. This makes the next patch simpler - it no longer needs to make sure `starttimes` is the real start time. Differential Revision: https://phab.mercurial-scm.org/D828
author Jun Wu <quark@fb.com>
date Wed, 27 Sep 2017 14:30:58 -0700
parents d64c2c050b54
children a667f0ca1d5f
files mercurial/configitems.py mercurial/progress.py
diffstat 2 files changed, 3 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/configitems.py	Tue Sep 26 12:48:15 2017 -0700
+++ b/mercurial/configitems.py	Wed Sep 27 14:30:58 2017 -0700
@@ -359,9 +359,6 @@
 coreconfigitem('progress', 'disable',
     default=False,
 )
-coreconfigitem('progress', 'estimate',
-    default=2,
-)
 coreconfigitem('progress', 'refresh',
     default=0.1,
 )
--- a/mercurial/progress.py	Tue Sep 26 12:48:15 2017 -0700
+++ b/mercurial/progress.py	Wed Sep 27 14:30:58 2017 -0700
@@ -215,19 +215,15 @@
         delta = pos - initialpos
         if delta > 0:
             elapsed = now - self.starttimes[topic]
-            # experimental config: progress.estimate
-            if elapsed > float(
-                self.ui.config('progress', 'estimate')):
-                seconds = (elapsed * (target - delta)) // delta + 1
-                return fmtremaining(seconds)
+            seconds = (elapsed * (target - delta)) // delta + 1
+            return fmtremaining(seconds)
         return ''
 
     def speed(self, topic, pos, unit, now):
         initialpos = self.startvals[topic]
         delta = pos - initialpos
         elapsed = now - self.starttimes[topic]
-        if elapsed > float(
-            self.ui.config('progress', 'estimate')):
+        if elapsed > 0:
             return _('%d %s/sec') % (delta / elapsed, unit)
         return ''