Mercurial > hg > mercurial-source
changeset 13154:e11c14f14491
progress: don't compute estimate without a total
Without this, computing an estimate crashes. Test included.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Thu, 16 Dec 2010 07:45:22 -0600 |
parents | dca5488f0e4f |
children | f02d7a562a21 |
files | hgext/progress.py tests/test-progress.t |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/progress.py +++ b/hgext/progress.py @@ -183,6 +183,8 @@ return min(int(self.ui.config('progress', 'width', default=tw)), tw) def estimate(self, topic, pos, total, now): + if total is None: + return '' initialpos = self.startvals[topic] target = total - initialpos delta = pos - initialpos