Show More
@@ -239,6 +239,13 class progbar(object): | |||
|
239 | 239 | # this one are also closed |
|
240 | 240 | if topic in self.topics: |
|
241 | 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 | 249 | else: |
|
243 | 250 | if topic not in self.topics: |
|
244 | 251 | self.starttimes[topic] = now |
@@ -1,6 +1,14 | |||
|
1 | 1 | |
|
2 | 2 | $ cat > loop.py <<EOF |
|
3 | 3 | > from mercurial import commands |
|
4 | > import time | |
|
5 | > class incrementingtime(object): | |
|
6 | > def __init__(self): | |
|
7 | > self._time = 0.0 | |
|
8 | > def __call__(self): | |
|
9 | > self._time += 0.25 | |
|
10 | > return self._time | |
|
11 | > time.time = incrementingtime() | |
|
4 | 12 | > |
|
5 | 13 | > def loop(ui, loops, **opts): |
|
6 | 14 | > loops = int(loops) |
@@ -19,9 +27,14 | |||
|
19 | 27 | > if opts.get('parallel'): |
|
20 | 28 | > ui.progress('other', i, 'other.%d' % i, 'othernum', total) |
|
21 | 29 | > if nested: |
|
22 | > for j in range(2): | |
|
23 | > ui.progress('nested', j, 'nested.%d' % j, 'nestnum', 2) | |
|
24 | > ui.progress('nested', None, 'nested.done', 'nestnum', 2) | |
|
30 | > nested_steps = 2 | |
|
31 | > if i and i % 4 == 0: | |
|
32 | > nested_steps = 5 | |
|
33 | > for j in range(nested_steps): | |
|
34 | > ui.progress( | |
|
35 | > 'nested', j, 'nested.%d' % j, 'nestnum', nested_steps) | |
|
36 | > ui.progress( | |
|
37 | > 'nested', None, 'nested.done', 'nestnum', nested_steps) | |
|
25 | 38 | > ui.progress('loop', None, 'loop.done', 'loopnum', total) |
|
26 | 39 | > |
|
27 | 40 | > commands.norepo += " loop" |
@@ -69,6 +82,24 test nested short-lived topics (which sh | |||
|
69 | 82 | loop [===============================> ] 2/3\r (no-eol) (esc) |
|
70 | 83 | \r (no-eol) (esc) |
|
71 | 84 | |
|
85 | Test nested long-lived topic which has the same name as a short-lived | |
|
86 | peer. We shouldn't get stuck showing the short-lived inner steps, and | |
|
87 | should go back to skipping the inner steps when the slow nested step | |
|
88 | finishes. | |
|
89 | ||
|
90 | $ hg -y loop 7 --nested | |
|
91 | \r (no-eol) (esc) | |
|
92 | loop [ ] 0/7\r (no-eol) (esc) | |
|
93 | loop [=====> ] 1/7\r (no-eol) (esc) | |
|
94 | loop [============> ] 2/7\r (no-eol) (esc) | |
|
95 | loop [===================> ] 3/7\r (no-eol) (esc) | |
|
96 | loop [==========================> ] 4/7\r (no-eol) (esc) | |
|
97 | nested [==========================> ] 3/5\r (no-eol) (esc) | |
|
98 | nested [===================================> ] 4/5\r (no-eol) (esc) | |
|
99 | loop [=================================> ] 5/7\r (no-eol) (esc) | |
|
100 | loop [========================================> ] 6/7\r (no-eol) (esc) | |
|
101 | \r (no-eol) (esc) | |
|
102 | ||
|
72 | 103 | |
|
73 | 104 | $ hg --config progress.changedelay=0 -y loop 3 --nested |
|
74 | 105 | \r (no-eol) (esc) |
General Comments 0
You need to be logged in to leave comments.
Login now