changeset 10464:149ad0a3ec91 stable

progress: make progress.refresh=0 always display the progress line This has no effect in real world where progress.refresh in unlikely to be set to zero, but is very useful in tests where all progress output is to be traced. It failed on platforms with coarse time.time() granularity, like Windows+py25.
author Patrick Mezard <pmezard@gmail.com>
date Sun, 14 Feb 2010 15:42:47 +0100
parents 5ddde896a19d
children 5d7e84e7ac6d
files hgext/progress.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/progress.py	Sun Feb 14 01:52:31 2010 -0500
+++ b/hgext/progress.py	Sun Feb 14 15:42:47 2010 +0100
@@ -156,7 +156,8 @@
             if topic not in self.topics:
                 self.topics.append(topic)
             now = time.time()
-            if now - self.lastprint > self.refresh and topic == self.topics[-1]:
+            if (now - self.lastprint >= self.refresh
+                and topic == self.topics[-1]):
                 self.lastprint = now
                 self.show(topic, pos, item, unit, total)
         return orig(topic, pos, item=item, unit=unit, total=total)