hgext/progress.py
changeset 21860 e382cf9ec30b
parent 21859 be4270d27a7e
child 21862 ba7f75e7f4e5
equal deleted inserted replaced
21859:be4270d27a7e 21860:e382cf9ec30b
   157             else:
   157             else:
   158                 tail = spacejoin(tail, add)
   158                 tail = spacejoin(tail, add)
   159         if needprogress:
   159         if needprogress:
   160             used = 0
   160             used = 0
   161             if head:
   161             if head:
   162                 used += len(head) + 1
   162                 used += encoding.colwidth(head) + 1
   163             if tail:
   163             if tail:
   164                 used += len(tail) + 1
   164                 used += encoding.colwidth(tail) + 1
   165             progwidth = termwidth - used - 3
   165             progwidth = termwidth - used - 3
   166             if total and pos <= total:
   166             if total and pos <= total:
   167                 amt = pos * progwidth // total
   167                 amt = pos * progwidth // total
   168                 bar = '=' * (amt - 1)
   168                 bar = '=' * (amt - 1)
   169                 if amt > 0:
   169                 if amt > 0: