Mercurial > hg
annotate tests/test-progress.t @ 16363:2cdd7e63211b
parsers: incrementally parse the revlog index in C
We only parse entries in a revlog index file when they are actually
needed, and cache them when first requested.
This makes a huge difference to performance on large revlogs when
accessing the tip revision or performing a handful of numeric lookups
(very common cases). For instance, "hg --time tip --template {node}"
on a tree with 300,000 revs takes 0.15 before, 0.02 after.
Even for revlog-intensive operations (e.g. running "hg log" to
completion), the lazy approach is about 1% faster than the eager
parse_index2.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Thu, 05 Apr 2012 13:00:35 -0700 |
parents | 4f795f5fbb0b |
children | f29f187ee73d |
rev | line source |
---|---|
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
2 $ cat > loop.py <<EOF |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
3 > from mercurial import commands |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
4 > |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
5 > def loop(ui, loops, **opts): |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
6 > loops = int(loops) |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
7 > total = None |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
8 > if loops >= 0: |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
9 > total = loops |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
10 > if opts.get('total', None): |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
11 > total = int(opts.get('total')) |
14838
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
12 > nested = False |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
13 > if opts.get('nested', None): |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
14 > nested = True |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
15 > loops = abs(loops) |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
16 > |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
17 > for i in range(loops): |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
18 > ui.progress('loop', i, 'loop.%d' % i, 'loopnum', total) |
14838
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
19 > if opts.get('parallel'): |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
20 > ui.progress('other', i, 'other.%d' % i, 'othernum', total) |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
21 > if nested: |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
22 > for j in range(2): |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
23 > ui.progress('nested', j, 'nested.%d' % j, 'nestnum', 2) |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
24 > ui.progress('nested', None, 'nested.done', 'nestnum', 2) |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
25 > ui.progress('loop', None, 'loop.done', 'loopnum', total) |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
26 > |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
27 > commands.norepo += " loop" |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
28 > |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
29 > cmdtable = { |
14838
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
30 > "loop": (loop, [('', 'total', '', 'override for total'), |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
31 > ('', 'nested', False, 'show nested results'), |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
32 > ('', 'parallel', False, 'show parallel sets of results'), |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
33 > ], |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
34 > 'hg loop LOOPS'), |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
35 > } |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
36 > EOF |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
37 |
15372
695ac6aca77f
check-code: fix issues with finding patterns in unified tests, fix tests
Matt Mackall <mpm@selenic.com>
parents:
14838
diff
changeset
|
38 $ cp $HGRCPATH $HGRCPATH.orig |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
39 $ echo "[extensions]" >> $HGRCPATH |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
40 $ echo "progress=" >> $HGRCPATH |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
41 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
42 $ echo "[progress]" >> $HGRCPATH |
13149
735dd8e8a208
progress using tests: disable time estimates to avoid flakiness
Augie Fackler <durin42@gmail.com>
parents:
13145
diff
changeset
|
43 $ echo "format = topic bar number" >> $HGRCPATH |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
44 $ echo "assume-tty=1" >> $HGRCPATH |
13142
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
45 $ echo "width=60" >> $HGRCPATH |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
46 |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
47 test default params, display nothing because of delay |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
48 |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
49 $ hg -y loop 3 2>&1 | "$TESTDIR/filtercr.py" |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
50 |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
51 $ echo "delay=0" >> $HGRCPATH |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
52 $ echo "refresh=0" >> $HGRCPATH |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
53 |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
54 test with delay=0, refresh=0 |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
55 |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
56 $ hg -y loop 3 2>&1 | "$TESTDIR/filtercr.py" |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
57 |
13142
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
58 loop [ ] 0/3 |
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
59 loop [===============> ] 1/3 |
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
60 loop [===============================> ] 2/3 |
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
61 \r (esc) |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
62 |
14838
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
63 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
64 test nested short-lived topics (which shouldn't display with nestdelay): |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
65 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
66 $ hg -y loop 3 --nested 2>&1 | \ |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
67 > python "$TESTDIR/filtercr.py" |
14838
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
68 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
69 loop [ ] 0/3 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
70 loop [===============> ] 1/3 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
71 loop [===============================> ] 2/3 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
72 \r (esc) |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
73 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
74 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
75 $ hg --config progress.changedelay=0 -y loop 3 --nested 2>&1 | \ |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
76 > python "$TESTDIR/filtercr.py" |
14838
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
77 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
78 loop [ ] 0/3 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
79 nested [ ] 0/2 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
80 nested [======================> ] 1/2 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
81 loop [===============> ] 1/3 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
82 nested [ ] 0/2 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
83 nested [======================> ] 1/2 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
84 loop [===============================> ] 2/3 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
85 nested [ ] 0/2 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
86 nested [======================> ] 1/2 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
87 \r (esc) |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
88 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
89 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
90 test two topics being printed in parallel (as when we're doing a local |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
91 --pull clone, where you get the unbundle and bundle progress at the |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
92 same time): |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
93 $ hg loop 3 --parallel 2>&1 | python "$TESTDIR/filtercr.py" |
14838
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
94 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
95 loop [ ] 0/3 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
96 loop [===============> ] 1/3 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
97 loop [===============================> ] 2/3 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
98 \r (esc) |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
99 test refresh is taken in account |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
100 |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
101 $ hg -y --config progress.refresh=100 loop 3 2>&1 | "$TESTDIR/filtercr.py" |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
102 |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
103 |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
104 test format options 1 |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
105 |
13141
6cfe17c19ba2
tests: add filtercr.py helper for progress tests
Martin Geisler <mg@aragost.com>
parents:
12942
diff
changeset
|
106 $ hg -y --config 'progress.format=number topic item+2' loop 2 2>&1 \ |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
107 > | "$TESTDIR/filtercr.py" |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
108 |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
109 0/2 loop lo |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
110 1/2 loop lo |
13142
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
111 \r (esc) |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
112 |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
113 test format options 2 |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
114 |
13141
6cfe17c19ba2
tests: add filtercr.py helper for progress tests
Martin Geisler <mg@aragost.com>
parents:
12942
diff
changeset
|
115 $ hg -y --config 'progress.format=number item-3 bar' loop 2 2>&1 \ |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
116 > | "$TESTDIR/filtercr.py" |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
117 |
13142
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
118 0/2 p.0 [ ] |
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
119 1/2 p.1 [=======================> ] |
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
120 \r (esc) |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
121 |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
122 test format options and indeterminate progress |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
123 |
13141
6cfe17c19ba2
tests: add filtercr.py helper for progress tests
Martin Geisler <mg@aragost.com>
parents:
12942
diff
changeset
|
124 $ hg -y --config 'progress.format=number item bar' loop -- -2 2>&1 \ |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
125 > | "$TESTDIR/filtercr.py" |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
126 |
13142
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
127 0 loop.0 [ <=> ] |
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
128 1 loop.1 [ <=> ] |
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
129 \r (esc) |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
130 |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
131 make sure things don't fall over if count > total |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
132 |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
133 $ hg -y loop --total 4 6 2>&1 | "$TESTDIR/filtercr.py" |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
134 |
13142
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
135 loop [ ] 0/4 |
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
136 loop [===========> ] 1/4 |
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
137 loop [=======================> ] 2/4 |
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
138 loop [===================================> ] 3/4 |
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
139 loop [===============================================>] 4/4 |
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
140 loop [ <=> ] 5/4 |
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
141 \r (esc) |
10891
83af68e38be3
progress: fall back to indeterminate progress if position is >= total
Augie Fackler <durin42@gmail.com>
parents:
10788
diff
changeset
|
142 |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
143 test immediate progress completion |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
144 |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
145 $ hg -y loop 0 2>&1 | "$TESTDIR/filtercr.py" |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
146 |
13145
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
147 |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
148 test delay time estimates |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
149 |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
150 $ cat > mocktime.py <<EOF |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
151 > import os |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
152 > import time |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
153 > |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
154 > class mocktime(object): |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
155 > def __init__(self, increment): |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
156 > self.time = 0 |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
157 > self.increment = increment |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
158 > def __call__(self): |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
159 > self.time += self.increment |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
160 > return self.time |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
161 > |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
162 > def uisetup(ui): |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
163 > time.time = mocktime(int(os.environ.get('MOCKTIME', '11'))) |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
164 > EOF |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
165 |
15372
695ac6aca77f
check-code: fix issues with finding patterns in unified tests, fix tests
Matt Mackall <mpm@selenic.com>
parents:
14838
diff
changeset
|
166 $ cp $HGRCPATH.orig $HGRCPATH |
695ac6aca77f
check-code: fix issues with finding patterns in unified tests, fix tests
Matt Mackall <mpm@selenic.com>
parents:
14838
diff
changeset
|
167 $ echo "[extensions]" >> $HGRCPATH |
13145
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
168 $ echo "mocktime=`pwd`/mocktime.py" >> $HGRCPATH |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
169 $ echo "progress=" >> $HGRCPATH |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
170 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
171 $ echo "[progress]" >> $HGRCPATH |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
172 $ echo "assume-tty=1" >> $HGRCPATH |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
173 $ echo "delay=25" >> $HGRCPATH |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
174 $ echo "width=60" >> $HGRCPATH |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
175 |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
176 $ hg -y loop 8 2>&1 | python "$TESTDIR/filtercr.py" |
13145
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
177 |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
178 loop [=========> ] 2/8 1m07s |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
179 loop [===============> ] 3/8 56s |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
180 loop [=====================> ] 4/8 45s |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
181 loop [==========================> ] 5/8 34s |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
182 loop [================================> ] 6/8 23s |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
183 loop [=====================================> ] 7/8 12s |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
184 \r (esc) |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
185 |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
186 $ MOCKTIME=10000 hg -y loop 4 2>&1 | python "$TESTDIR/filtercr.py" |
13145
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
187 |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
188 loop [ ] 0/4 |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
189 loop [=========> ] 1/4 8h21m |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
190 loop [====================> ] 2/4 5h34m |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
191 loop [==============================> ] 3/4 2h47m |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
192 \r (esc) |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
193 |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
194 $ MOCKTIME=1000000 hg -y loop 4 2>&1 | python "$TESTDIR/filtercr.py" |
13236
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
195 |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
196 loop [ ] 0/4 |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
197 loop [=========> ] 1/4 5w00d |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
198 loop [====================> ] 2/4 3w03d |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
199 loop [=============================> ] 3/4 11d14h |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
200 \r (esc) |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
201 |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
202 |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
203 $ MOCKTIME=14000000 hg -y loop 4 2>&1 | python "$TESTDIR/filtercr.py" |
13236
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
204 |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
205 loop [ ] 0/4 |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
206 loop [=========> ] 1/4 1y18w |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
207 loop [===================> ] 2/4 46w03d |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
208 loop [=============================> ] 3/4 23w02d |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
209 \r (esc) |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
210 |
13154
e11c14f14491
progress: don't compute estimate without a total
Augie Fackler <durin42@gmail.com>
parents:
13149
diff
changeset
|
211 Time estimates should not fail when there's no end point: |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15372
diff
changeset
|
212 $ hg -y loop -- -4 2>&1 | python "$TESTDIR/filtercr.py" |
13154
e11c14f14491
progress: don't compute estimate without a total
Augie Fackler <durin42@gmail.com>
parents:
13149
diff
changeset
|
213 |
e11c14f14491
progress: don't compute estimate without a total
Augie Fackler <durin42@gmail.com>
parents:
13149
diff
changeset
|
214 loop [ <=> ] 2 |
e11c14f14491
progress: don't compute estimate without a total
Augie Fackler <durin42@gmail.com>
parents:
13149
diff
changeset
|
215 loop [ <=> ] 3 |
e11c14f14491
progress: don't compute estimate without a total
Augie Fackler <durin42@gmail.com>
parents:
13149
diff
changeset
|
216 \r (esc) |