comparison hgext/progress.py @ 19619:4694ccd5d994

progress: stop getting stuck in a nested topic during a long inner step Convert, for example, has loops like this: for revision in source_repo: progress(revisions) for file in revision: progresss(file) Prior to this change, we would start showing the file-level progress when we encountered a big revision, and then we'd get stuck in showing file-progress instead of revision progress, often producing many many instantly-completing progress bars rather than the actually-helpful top-level revisions bar.
author Augie Fackler <raf@durin42.com>
date Fri, 23 Aug 2013 13:28:18 -0400
parents b4744c3b991e
children be4270d27a7e
comparison
equal deleted inserted replaced
19618:6ac206fb6f27 19619:4694ccd5d994
237 self.resetstate() 237 self.resetstate()
238 # truncate the list of topics assuming all topics within 238 # truncate the list of topics assuming all topics within
239 # this one are also closed 239 # this one are also closed
240 if topic in self.topics: 240 if topic in self.topics:
241 self.topics = self.topics[:self.topics.index(topic)] 241 self.topics = self.topics[:self.topics.index(topic)]
242 # reset the last topic to the one we just unwound to,
243 # so that higher-level topics will be stickier than
244 # lower-level topics
245 if self.topics:
246 self.lasttopic = self.topics[-1]
247 else:
248 self.lasttopic = None
242 else: 249 else:
243 if topic not in self.topics: 250 if topic not in self.topics:
244 self.starttimes[topic] = now 251 self.starttimes[topic] = now
245 self.startvals[topic] = pos 252 self.startvals[topic] = pos
246 self.topics.append(topic) 253 self.topics.append(topic)