Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/progress.py @ 36189:d541042f32f6
progress: determine padding width portably
Differential Revision: https://phab.mercurial-scm.org/D2225
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 13 Feb 2018 08:43:14 -0500 |
parents | 54fa3db5becf |
children | 7f5108e58083 |
comparison
equal
deleted
inserted
replaced
36188:fa4d333cac58 | 36189:d541042f32f6 |
---|---|
117 add = '' | 117 add = '' |
118 if indicator == 'topic': | 118 if indicator == 'topic': |
119 add = topic | 119 add = topic |
120 elif indicator == 'number': | 120 elif indicator == 'number': |
121 if total: | 121 if total: |
122 add = ('% ' + str(len(str(total))) + | 122 padamount = '%d' % len(str(total)) |
123 's/%s') % (pos, total) | 123 add = ('% '+ padamount + 's/%s') % (pos, total) |
124 else: | 124 else: |
125 add = str(pos) | 125 add = str(pos) |
126 elif indicator.startswith('item') and item: | 126 elif indicator.startswith('item') and item: |
127 slice = 'end' | 127 slice = 'end' |
128 if '-' in indicator: | 128 if '-' in indicator: |