26 $ echo "[extensions]" >> $HGRCPATH |
26 $ echo "[extensions]" >> $HGRCPATH |
27 $ echo "progress=" >> $HGRCPATH |
27 $ echo "progress=" >> $HGRCPATH |
28 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH |
28 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH |
29 $ echo "[progress]" >> $HGRCPATH |
29 $ echo "[progress]" >> $HGRCPATH |
30 $ echo "assume-tty=1" >> $HGRCPATH |
30 $ echo "assume-tty=1" >> $HGRCPATH |
|
31 $ echo "width=60" >> $HGRCPATH |
31 |
32 |
32 test default params, display nothing because of delay |
33 test default params, display nothing because of delay |
33 |
34 |
34 $ hg -y loop 3 2>&1 | $TESTDIR/filtercr.py |
35 $ hg -y loop 3 2>&1 | $TESTDIR/filtercr.py |
35 |
36 |
38 |
39 |
39 test with delay=0, refresh=0 |
40 test with delay=0, refresh=0 |
40 |
41 |
41 $ hg -y loop 3 2>&1 | $TESTDIR/filtercr.py |
42 $ hg -y loop 3 2>&1 | $TESTDIR/filtercr.py |
42 |
43 |
43 loop [ ] 0/3 |
44 loop [ ] 0/3 |
44 loop [=====================> ] 1/3 |
45 loop [===============> ] 1/3 |
45 loop [============================================> ] 2/3 |
46 loop [===============================> ] 2/3 |
46 \r (esc) |
47 \r (esc) |
47 |
48 |
48 test refresh is taken in account |
49 test refresh is taken in account |
49 |
50 |
50 $ hg -y --config progress.refresh=100 loop 3 2>&1 | $TESTDIR/filtercr.py |
51 $ hg -y --config progress.refresh=100 loop 3 2>&1 | $TESTDIR/filtercr.py |
51 |
52 |
55 $ hg -y --config 'progress.format=number topic item+2' loop 2 2>&1 \ |
56 $ hg -y --config 'progress.format=number topic item+2' loop 2 2>&1 \ |
56 > | $TESTDIR/filtercr.py |
57 > | $TESTDIR/filtercr.py |
57 |
58 |
58 0/2 loop lo |
59 0/2 loop lo |
59 1/2 loop lo |
60 1/2 loop lo |
60 \r (esc) |
61 \r (esc) |
61 |
62 |
62 test format options 2 |
63 test format options 2 |
63 |
64 |
64 $ hg -y --config 'progress.format=number item-3 bar' loop 2 2>&1 \ |
65 $ hg -y --config 'progress.format=number item-3 bar' loop 2 2>&1 \ |
65 > | $TESTDIR/filtercr.py |
66 > | $TESTDIR/filtercr.py |
66 |
67 |
67 0/2 p.0 [ ] |
68 0/2 p.0 [ ] |
68 1/2 p.1 [=================================> ] |
69 1/2 p.1 [=======================> ] |
69 \r (esc) |
70 \r (esc) |
70 |
71 |
71 test format options and indeterminate progress |
72 test format options and indeterminate progress |
72 |
73 |
73 $ hg -y --config 'progress.format=number item bar' loop -- -2 2>&1 \ |
74 $ hg -y --config 'progress.format=number item bar' loop -- -2 2>&1 \ |
74 > | $TESTDIR/filtercr.py |
75 > | $TESTDIR/filtercr.py |
75 |
76 |
76 0 loop.0 [ <=> ] |
77 0 loop.0 [ <=> ] |
77 1 loop.1 [ <=> ] |
78 1 loop.1 [ <=> ] |
78 \r (esc) |
79 \r (esc) |
79 |
80 |
80 make sure things don't fall over if count > total |
81 make sure things don't fall over if count > total |
81 |
82 |
82 $ hg -y loop --total 4 6 2>&1 | $TESTDIR/filtercr.py |
83 $ hg -y loop --total 4 6 2>&1 | $TESTDIR/filtercr.py |
83 |
84 |
84 loop [ ] 0/4 |
85 loop [ ] 0/4 |
85 loop [================> ] 1/4 |
86 loop [===========> ] 1/4 |
86 loop [=================================> ] 2/4 |
87 loop [=======================> ] 2/4 |
87 loop [==================================================> ] 3/4 |
88 loop [===================================> ] 3/4 |
88 loop [===================================================================>] 4/4 |
89 loop [===============================================>] 4/4 |
89 loop [ <=> ] 5/4 |
90 loop [ <=> ] 5/4 |
90 \r (esc) |
91 \r (esc) |
91 |
92 |
92 test immediate progress completion |
93 test immediate progress completion |
93 |
94 |
94 $ hg -y loop 0 2>&1 | $TESTDIR/filtercr.py |
95 $ hg -y loop 0 2>&1 | $TESTDIR/filtercr.py |
95 |
96 |