mercurial/progress.py
changeset 36202 707aba4d48b5
parent 36152 7f5108e58083
child 36423 2831d918e1b4
equal deleted inserted replaced
36201:46260fac5563 36202:707aba4d48b5
   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                     padamount = '%d' % len(str(total))
   122                     add = b'%*d/%d' % (len(str(total)), 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)
       
   128                 else:
   123                 else:
   129                     add = str(pos)
   124                     add = str(pos)
   130             elif indicator.startswith('item') and item:
   125             elif indicator.startswith('item') and item:
   131                 slice = 'end'
   126                 slice = 'end'
   132                 if '-' in indicator:
   127                 if '-' in indicator: