Patchwork D2225: progress: determine padding width portably

login
register
mail settings
Submitter phabricator
Date Feb. 13, 2018, 5:14 p.m.
Message ID <752ca2af5d25c8fa5fcba827b87efa43@localhost.localdomain>
Download mbox | patch
Permalink /patch/27828/
State Not Applicable
Headers show

Comments

phabricator - Feb. 13, 2018, 5:14 p.m.
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




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

Patch

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: