changeset 10453:7edc649f9f7e

progress: make determinate bar more like wget progress bar foo [ ] 0/58 foo [> ] 1/58 foo [=> ] 2/58 ... foo [=======================================================> ] 56/58 foo [========================================================> ] 57/58 foo [=========================================================>] 58/58 The bar now has a '>' character at the end. This indicates the direction, is consistent with the indeterminate '<=>' bar, and looks much nicer.
author Brodie Rao <me+hg@dackz.net>
date Sat, 13 Feb 2010 23:34:15 -0500
parents 59f8fff4f887
children 37b735d27347
files hgext/progress.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/progress.py	Sat Feb 13 23:34:20 2010 -0500
+++ b/hgext/progress.py	Sat Feb 13 23:34:15 2010 -0500
@@ -114,7 +114,10 @@
             progwidth = termwidth - used - 3
             if total:
                 amt = pos * progwidth // total
-                bar = '=' * (amt) + ' ' * (progwidth - amt)
+                bar = '=' * (amt - 1)
+                if amt > 0:
+                    bar += '>'
+                bar += ' ' * (progwidth - amt)
             else:
                 progwidth -= 3
                 self.indetcount += 1