progress: remove progress.estimate config
authorJun Wu <quark@fb.com>
Wed, 27 Sep 2017 14:30:58 -0700
changeset 34320 f428c347d32b
parent 34319 d64c2c050b54
child 34321 a667f0ca1d5f
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
mercurial/configitems.py
mercurial/progress.py
--- 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 ''