mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
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.
This commit is contained in:
parent
892ba5a830
commit
cdb100ac42
@ -156,7 +156,8 @@ class progbar(object):
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user