D828: progress: remove progress.estimate config
quark (Jun Wu)
phabricator at mercurial-scm.org
Wed Sep 27 20:03:57 UTC 2017
quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
It was introduced by https://phab.mercurial-scm.org/rHG98e4d3914c2e807bc68b04d2d28a8fd1edaa5e81 and was intended to hide ETA information for the
beginning (2 seconds) of the progress (when elapsed is small). Now we also have
`progress.changedelay` which hides the entire progress bar for the first 3
seconds. So `progress.estimate` is a no-op by default. Since it's experimental,
let's just remove it. This makes the next patch simpler.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D828
AFFECTED FILES
mercurial/configitems.py
mercurial/progress.py
CHANGE DETAILS
diff --git a/mercurial/progress.py b/mercurial/progress.py
--- a/mercurial/progress.py
+++ b/mercurial/progress.py
@@ -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 ''
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -359,9 +359,6 @@
coreconfigitem('progress', 'disable',
default=False,
)
-coreconfigitem('progress', 'estimate',
- default=2,
-)
coreconfigitem('progress', 'refresh',
default=0.1,
)
To: quark, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list