mercurial/progress.py
changeset 36152 7f5108e58083
parent 36151 d541042f32f6
child 36202 707aba4d48b5
equal deleted inserted replaced
36151:d541042f32f6 36152:7f5108e58083
   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                     padamount = '%d' % len(str(total))
   122                     padamount = '%d' % len(str(total))
   123                     add = ('% '+ padamount + 's/%s') % (pos, total)
   123                     # '% 1d' % 1 adds an extra space compared to '% 1s' % 1.
       
   124                     # To avoid this change in output, we convert to a string
       
   125                     # first, then do the padding.
       
   126                     spos = '%d' % pos
       
   127                     add = ('% '+ padamount + 's/%d') % (spos, total)
   124                 else:
   128                 else:
   125                     add = str(pos)
   129                     add = str(pos)
   126             elif indicator.startswith('item') and item:
   130             elif indicator.startswith('item') and item:
   127                 slice = 'end'
   131                 slice = 'end'
   128                 if '-' in indicator:
   132                 if '-' in indicator: