# HG changeset patch # User Augie Fackler # Date 2018-02-13 13:43:14 # Node ID d541042f32f6a18ee96c31f2333aca9f601162b2 # Parent fa4d333cac586fffe2ec0bd3faabe791b1a2ae08 progress: determine padding width portably Differential Revision: https://phab.mercurial-scm.org/D2225 diff --git a/mercurial/progress.py b/mercurial/progress.py --- a/mercurial/progress.py +++ b/mercurial/progress.py @@ -119,8 +119,8 @@ class progbar(object): 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: