D2225: progress: determine padding width portably

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Tue Feb 13 12:14:49 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd541042f32f6: progress: determine padding width portably (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2225?vs=5631&id=5638

REVISION DETAIL
  https://phab.mercurial-scm.org/D2225

AFFECTED FILES
  mercurial/progress.py

CHANGE DETAILS

diff --git a/mercurial/progress.py b/mercurial/progress.py
--- a/mercurial/progress.py
+++ b/mercurial/progress.py
@@ -119,8 +119,8 @@
                 add = topic
             elif indicator == 'number':
                 if total:
-                    add = ('% ' + str(len(str(total))) +
-                           's/%s') % (pos, total)
+                    padamount = '%d' % len(str(total))
+                    add = ('% '+ padamount + 's/%s') % (pos, total)
                 else:
                     add = str(pos)
             elif indicator.startswith('item') and item:



To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel


More information about the Mercurial-devel mailing list