# HG changeset patch # User Brodie Rao # Date 2010-02-14 04:34:15 # Node ID 7edc649f9f7e73f516decfa4cf6adf7b2d0a4521 # Parent 59f8fff4f8870e64a7ab5aa4d248cd09662262fd 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. diff --git a/hgext/progress.py b/hgext/progress.py --- a/hgext/progress.py +++ b/hgext/progress.py @@ -114,7 +114,10 @@ class progbar(object): 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