Patchwork [17,of,17] configitems: register the 'progress.estimate' config

login
register
mail settings
Submitter Pierre-Yves David
Date July 4, 2017, 11:10 p.m.
Message ID <21dfe01002239020070a.1499209845@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21991/
State Accepted
Headers show

Comments

Pierre-Yves David - July 4, 2017, 11:10 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1498787044 -7200
#      Fri Jun 30 03:44:04 2017 +0200
# Node ID 21dfe01002239020070a3b714c4fdea2d43ee9f3
# Parent  5c700932e00c7579c59dbf54e73ba4f304c5ca1b
# EXP-Topic config.register.progress
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 21dfe0100223
configitems: register the 'progress.estimate' config
Sean Farley - July 5, 2017, 3:21 a.m.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> writes:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@octobus.net>
> # Date 1498787044 -7200
> #      Fri Jun 30 03:44:04 2017 +0200
> # Node ID 21dfe01002239020070a3b714c4fdea2d43ee9f3
> # Parent  5c700932e00c7579c59dbf54e73ba4f304c5ca1b
> # EXP-Topic config.register.progress
> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 21dfe0100223
> configitems: register the 'progress.estimate' config

Seems pretty straight-forward to me. Queued!

Patch

diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -122,6 +122,9 @@  coreconfigitem('progress', 'assume-tty',
 coreconfigitem('progress', 'clear-complete',
     default=True,
 )
+coreconfigitem('progress', 'estimate',
+    default=2,
+)
 coreconfigitem('server', 'bundle1',
     default=True,
 )
diff --git a/mercurial/progress.py b/mercurial/progress.py
--- a/mercurial/progress.py
+++ b/mercurial/progress.py
@@ -217,7 +217,7 @@  class progbar(object):
             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 @@  class progbar(object):
         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 ''