Mercurial > hg
annotate tests/test-progress.t @ 30155:b7a966ce89ed
changelog: disable delta chains
This patch disables delta chains on changelogs. After this patch, new
entries on changelogs - including existing changelogs - will be stored
as the fulltext of that data (likely compressed). No delta computation
will be performed.
An overview of delta chains and data justifying this change follows.
Revlogs try to store entries as a delta against a previous entry (either
a parent revision in the case of generaldelta or the previous physical
revision when not using generaldelta). Most of the time this is the
correct thing to do: it frequently results in less CPU usage and smaller
storage.
Delta chains are most effective when the base revision being deltad
against is similar to the current data. This tends to occur naturally
for manifests and file data, since only small parts of each tend to
change with each revision. Changelogs, however, are a different story.
Changelog entries represent changesets/commits. And unless commits in a
repository are homogonous (same author, changing same files, similar
commit messages, etc), a delta from one entry to the next tends to be
relatively large compared to the size of the entry. This means that
delta chains tend to be short. How short? Here is the full vs delta
revision breakdown on some real world repos:
Repo % Full % Delta Max Length
hg 45.8 54.2 6
mozilla-central 42.4 57.6 8
mozilla-unified 42.5 57.5 17
pypy 46.1 53.9 6
python-zstandard 46.1 53.9 3
(I threw in python-zstandard as an example of a repo that is homogonous.
It contains a small Python project with changes all from the same
author.)
Contrast this with the manifest revlog for these repos, where 99+% of
revisions are deltas and delta chains run into the thousands.
So delta chains aren't as useful on changelogs. But even a short delta
chain may provide benefits. Let's measure that.
Delta chains may require less CPU to read revisions if the CPU time
spent reading smaller deltas is less than the CPU time used to
decompress larger individual entries. We can measure this via
`hg perfrevlog -c -d 1` to iterate a revlog to resolve each revision's
fulltext. Here are the results of that command on a repo using delta
chains in its changelog and on a repo without delta chains:
hg (forward)
! wall 0.407008 comb 0.410000 user 0.410000 sys 0.000000 (best of 25)
! wall 0.390061 comb 0.390000 user 0.390000 sys 0.000000 (best of 26)
hg (reverse)
! wall 0.515221 comb 0.520000 user 0.520000 sys 0.000000 (best of 19)
! wall 0.400018 comb 0.400000 user 0.390000 sys 0.010000 (best of 25)
mozilla-central (forward)
! wall 4.508296 comb 4.490000 user 4.490000 sys 0.000000 (best of 3)
! wall 4.370222 comb 4.370000 user 4.350000 sys 0.020000 (best of 3)
mozilla-central (reverse)
! wall 5.758995 comb 5.760000 user 5.720000 sys 0.040000 (best of 3)
! wall 4.346503 comb 4.340000 user 4.320000 sys 0.020000 (best of 3)
mozilla-unified (forward)
! wall 4.957088 comb 4.950000 user 4.940000 sys 0.010000 (best of 3)
! wall 4.660528 comb 4.650000 user 4.630000 sys 0.020000 (best of 3)
mozilla-unified (reverse)
! wall 6.119827 comb 6.110000 user 6.090000 sys 0.020000 (best of 3)
! wall 4.675136 comb 4.670000 user 4.670000 sys 0.000000 (best of 3)
pypy (forward)
! wall 1.231122 comb 1.240000 user 1.230000 sys 0.010000 (best of 8)
! wall 1.164896 comb 1.160000 user 1.160000 sys 0.000000 (best of 9)
pypy (reverse)
! wall 1.467049 comb 1.460000 user 1.460000 sys 0.000000 (best of 7)
! wall 1.160200 comb 1.170000 user 1.160000 sys 0.010000 (best of 9)
The data clearly shows that it takes less wall and CPU time to resolve
revisions when there are no delta chains in the changelogs, regardless
of the direction of traversal. Furthermore, not using a delta chain
means that fulltext resolution in reverse is as fast as iterating
forward. So not using delta chains on the changelog is a clear CPU win
for reading operations.
An example of a user-visible operation showing this speed-up is revset
evaluation. Here are results for
`hg perfrevset 'author(gps) or author(mpm)'`:
hg
! wall 1.655506 comb 1.660000 user 1.650000 sys 0.010000 (best of 6)
! wall 1.612723 comb 1.610000 user 1.600000 sys 0.010000 (best of 7)
mozilla-central
! wall 17.629826 comb 17.640000 user 17.600000 sys 0.040000 (best of 3)
! wall 17.311033 comb 17.300000 user 17.260000 sys 0.040000 (best of 3)
What about 00changelog.i size?
Repo Delta Chains No Delta Chains
hg 7,033,250 6,976,771
mozilla-central 82,978,748 81,574,623
mozilla-unified 88,112,349 86,702,162
pypy 20,740,699 20,659,741
The data shows that removing delta chains from the changelog makes the
changelog smaller.
Delta chains are also used during changegroup generation. This
operation essentially converts a series of revisions to one large
delta chain. And changegroup generation is smart: if the delta in
the revlog matches what the changegroup is emitting, it will reuse
the delta instead of recalculating it. We can measure the impact
removing changelog delta chains has on changegroup generation via
`hg perfchangegroupchangelog`:
hg
! wall 1.589245 comb 1.590000 user 1.590000 sys 0.000000 (best of 7)
! wall 1.788060 comb 1.790000 user 1.790000 sys 0.000000 (best of 6)
mozilla-central
! wall 17.382585 comb 17.380000 user 17.340000 sys 0.040000 (best of 3)
! wall 20.161357 comb 20.160000 user 20.120000 sys 0.040000 (best of 3)
mozilla-unified
! wall 18.722839 comb 18.720000 user 18.680000 sys 0.040000 (best of 3)
! wall 21.168075 comb 21.170000 user 21.130000 sys 0.040000 (best of 3)
pypy
! wall 4.828317 comb 4.830000 user 4.820000 sys 0.010000 (best of 3)
! wall 5.415455 comb 5.420000 user 5.410000 sys 0.010000 (best of 3)
The data shows eliminating delta chains makes the changelog part of
changegroup generation slower. This is expected since we now have to
compute deltas for revisions where we could recycle the delta before.
It is worth putting this regression into context of overall changegroup
times. Here is the rough total CPU time spent in changegroup generation
for various repos while using delta chains on the changelog:
Repo CPU Time (s) CPU Time w/ compression
hg 4.50 7.05
mozilla-central 111.1 222.0
pypy 28.68 75.5
Before compression, removing delta chains from the changegroup adds
~4.4% overhead to hg changegroup generation, 1.3% to mozilla-central,
and 2.0% to pypy. When you factor in zlib compression, these percentages
are roughly divided by 2.
While the increased CPU usage for changegroup generation is unfortunate,
I think it is acceptable because the percentage is small, server
operators (those likely impacted most by this) have other mechanisms
to mitigate CPU consumption (namely reducing zlib compression level and
pre-generated clone bundles), and because there is room to optimize this
in the future. For example, we could use the nullid as the base revision,
effectively encoding the full revision for each entry in the changegroup.
When doing this, `hg perfchangegroupchangelog` nearly halves:
mozilla-unified
! wall 21.168075 comb 21.170000 user 21.130000 sys 0.040000 (best of 3)
! wall 11.196461 comb 11.200000 user 11.190000 sys 0.010000 (best of 3)
This looks very promising as a future optimization opportunity.
It's worth that the changes in test-acl.t to the changegroup part size.
This is because revision 6 in the changegroup had a delta chain of
length 2 before and after this patch the base revision is nullrev.
When the base revision is nullrev, cg2packer.deltaparent() hardcodes
the *previous* revision from the changegroup as the delta parent.
This caused the delta in the changegroup to switch base revisions,
the delta to change, and the size to change accordingly. While the
size increased in this case, I think sizes will remain the same
on average, as the delta base for changelog revisions doesn't matter
too much (as this patch shows). So, I don't consider this a regression.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 13 Oct 2016 12:50:27 +0200 |
parents | d9f7f590f1e3 |
children | 46ba2cdda476 |
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 |
21254
51e5c793a9f4
tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
19619
diff
changeset
|
3 > from mercurial import cmdutil, commands |
19619
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
4 > import time |
21254
51e5c793a9f4
tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
19619
diff
changeset
|
5 > |
51e5c793a9f4
tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
19619
diff
changeset
|
6 > cmdtable = {} |
51e5c793a9f4
tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
19619
diff
changeset
|
7 > command = cmdutil.command(cmdtable) |
51e5c793a9f4
tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
19619
diff
changeset
|
8 > |
19619
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
9 > class incrementingtime(object): |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
10 > def __init__(self): |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
11 > self._time = 0.0 |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
12 > def __call__(self): |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
13 > self._time += 0.25 |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
14 > return self._time |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
15 > time.time = incrementingtime() |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
16 > |
21254
51e5c793a9f4
tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
19619
diff
changeset
|
17 > @command('loop', |
51e5c793a9f4
tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
19619
diff
changeset
|
18 > [('', 'total', '', 'override for total'), |
51e5c793a9f4
tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
19619
diff
changeset
|
19 > ('', 'nested', False, 'show nested results'), |
51e5c793a9f4
tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
19619
diff
changeset
|
20 > ('', 'parallel', False, 'show parallel sets of results')], |
21773
26d2fb899637
tests: define norepo in command decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
21254
diff
changeset
|
21 > 'hg loop LOOPS', |
26d2fb899637
tests: define norepo in command decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
21254
diff
changeset
|
22 > norepo=True) |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
23 > def loop(ui, loops, **opts): |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
24 > loops = int(loops) |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
25 > total = None |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
26 > if loops >= 0: |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
27 > total = loops |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
28 > if opts.get('total', None): |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
29 > 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
|
30 > nested = False |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
31 > 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
|
32 > nested = True |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
33 > loops = abs(loops) |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
34 > |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
35 > for i in range(loops): |
21862
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
36 > ui.progress(topiclabel, i, getloopitem(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
|
37 > 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
|
38 > 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
|
39 > if nested: |
19619
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
40 > nested_steps = 2 |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
41 > if i and i % 4 == 0: |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
42 > nested_steps = 5 |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
43 > for j in range(nested_steps): |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
44 > ui.progress( |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
45 > 'nested', j, 'nested.%d' % j, 'nestnum', nested_steps) |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
46 > ui.progress( |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
47 > 'nested', None, 'nested.done', 'nestnum', nested_steps) |
21859
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
48 > ui.progress(topiclabel, None, 'loop.done', 'loopnum', total) |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
49 > |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
50 > topiclabel = 'loop' |
21862
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
51 > def getloopitem(i): |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
52 > return 'loop.%d' % i |
12479
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 > EOF |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
55 |
15372
695ac6aca77f
check-code: fix issues with finding patterns in unified tests, fix tests
Matt Mackall <mpm@selenic.com>
parents:
14838
diff
changeset
|
56 $ cp $HGRCPATH $HGRCPATH.orig |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
57 $ echo "[extensions]" >> $HGRCPATH |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
58 $ echo "progress=" >> $HGRCPATH |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
59 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
60 $ echo "[progress]" >> $HGRCPATH |
16675
f29f187ee73d
test-progress: fix whitespace typo
Martin Geisler <mg@lazybytes.net>
parents:
16350
diff
changeset
|
61 $ echo "format = topic bar number" >> $HGRCPATH |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
62 $ echo "assume-tty=1" >> $HGRCPATH |
13142
e9827c85c50b
progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents:
13141
diff
changeset
|
63 $ echo "width=60" >> $HGRCPATH |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
64 |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
65 test default params, display nothing because of delay |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
66 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
67 $ hg -y loop 3 |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
68 $ echo "delay=0" >> $HGRCPATH |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
69 $ echo "refresh=0" >> $HGRCPATH |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
70 |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
71 test with delay=0, refresh=0 |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
72 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
73 $ hg -y loop 3 |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
74 \r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
75 loop [ ] 0/3\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
76 loop [===============> ] 1/3\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
77 loop [===============================> ] 2/3\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
78 \r (no-eol) (esc) |
25581
79c75459321e
progress: respect ui.quiet (issue4726)
Augie Fackler <augie@google.com>
parents:
23139
diff
changeset
|
79 no progress with --quiet |
79c75459321e
progress: respect ui.quiet (issue4726)
Augie Fackler <augie@google.com>
parents:
23139
diff
changeset
|
80 $ hg -y loop 3 --quiet |
14838
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
81 |
28171
2d20d1d2ea76
progress: display progress bar when HGPLAINEXCEPT contains "progress"
Matt Anderson <andersonmat@fb.com>
parents:
25581
diff
changeset
|
82 test plain mode exception |
2d20d1d2ea76
progress: display progress bar when HGPLAINEXCEPT contains "progress"
Matt Anderson <andersonmat@fb.com>
parents:
25581
diff
changeset
|
83 $ HGPLAINEXCEPT=progress hg -y loop 1 |
2d20d1d2ea76
progress: display progress bar when HGPLAINEXCEPT contains "progress"
Matt Anderson <andersonmat@fb.com>
parents:
25581
diff
changeset
|
84 \r (no-eol) (esc) |
2d20d1d2ea76
progress: display progress bar when HGPLAINEXCEPT contains "progress"
Matt Anderson <andersonmat@fb.com>
parents:
25581
diff
changeset
|
85 loop [ ] 0/1\r (no-eol) (esc) |
2d20d1d2ea76
progress: display progress bar when HGPLAINEXCEPT contains "progress"
Matt Anderson <andersonmat@fb.com>
parents:
25581
diff
changeset
|
86 \r (no-eol) (esc) |
2d20d1d2ea76
progress: display progress bar when HGPLAINEXCEPT contains "progress"
Matt Anderson <andersonmat@fb.com>
parents:
25581
diff
changeset
|
87 |
14838
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
88 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
|
89 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
90 $ hg -y loop 3 --nested |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
91 \r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
92 loop [ ] 0/3\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
93 loop [===============> ] 1/3\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
94 loop [===============================> ] 2/3\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
95 \r (no-eol) (esc) |
14838
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
96 |
19619
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
97 Test nested long-lived topic which has the same name as a short-lived |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
98 peer. We shouldn't get stuck showing the short-lived inner steps, and |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
99 should go back to skipping the inner steps when the slow nested step |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
100 finishes. |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
101 |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
102 $ hg -y loop 7 --nested |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
103 \r (no-eol) (esc) |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
104 loop [ ] 0/7\r (no-eol) (esc) |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
105 loop [=====> ] 1/7\r (no-eol) (esc) |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
106 loop [============> ] 2/7\r (no-eol) (esc) |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
107 loop [===================> ] 3/7\r (no-eol) (esc) |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
108 loop [==========================> ] 4/7\r (no-eol) (esc) |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
109 nested [==========================> ] 3/5\r (no-eol) (esc) |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
110 nested [===================================> ] 4/5\r (no-eol) (esc) |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
111 loop [=================================> ] 5/7\r (no-eol) (esc) |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
112 loop [========================================> ] 6/7\r (no-eol) (esc) |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
113 \r (no-eol) (esc) |
4694ccd5d994
progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents:
19229
diff
changeset
|
114 |
14838
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
115 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
116 $ hg --config progress.changedelay=0 -y loop 3 --nested |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
117 \r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
118 loop [ ] 0/3\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
119 nested [ ] 0/2\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
120 nested [======================> ] 1/2\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
121 loop [===============> ] 1/3\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
122 nested [ ] 0/2\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
123 nested [======================> ] 1/2\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
124 loop [===============================> ] 2/3\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
125 nested [ ] 0/2\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
126 nested [======================> ] 1/2\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
127 \r (no-eol) (esc) |
14838
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
128 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
129 |
5d261fd00446
progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents:
13236
diff
changeset
|
130 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
|
131 --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
|
132 same time): |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
133 $ hg loop 3 --parallel |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
134 \r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
135 loop [ ] 0/3\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
136 loop [===============> ] 1/3\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
137 loop [===============================> ] 2/3\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
138 \r (no-eol) (esc) |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
139 test refresh is taken in account |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
140 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
141 $ hg -y --config progress.refresh=100 loop 3 |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
142 |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
143 test format options 1 |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
144 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
145 $ hg -y --config 'progress.format=number topic item+2' loop 2 |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
146 \r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
147 0/2 loop lo\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
148 1/2 loop lo\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
149 \r (no-eol) (esc) |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
150 |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
151 test format options 2 |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
152 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
153 $ hg -y --config 'progress.format=number item-3 bar' loop 2 |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
154 \r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
155 0/2 p.0 [ ]\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
156 1/2 p.1 [=======================> ]\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
157 \r (no-eol) (esc) |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
158 |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
159 test format options and indeterminate progress |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
160 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
161 $ hg -y --config 'progress.format=number item bar' loop -- -2 |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
162 \r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
163 0 loop.0 [ <=> ]\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
164 1 loop.1 [ <=> ]\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
165 \r (no-eol) (esc) |
10465
5d7e84e7ac6d
Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
166 |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
167 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
|
168 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
169 $ hg -y loop --total 4 6 |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
170 \r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
171 loop [ ] 0/4\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
172 loop [===========> ] 1/4\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
173 loop [=======================> ] 2/4\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
174 loop [===================================> ] 3/4\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
175 loop [===============================================>] 4/4\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
176 loop [ <=> ] 5/4\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
177 \r (no-eol) (esc) |
10891
83af68e38be3
progress: fall back to indeterminate progress if position is >= total
Augie Fackler <durin42@gmail.com>
parents:
10788
diff
changeset
|
178 |
12479
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
179 test immediate progress completion |
2f9ef3657730
tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents:
10891
diff
changeset
|
180 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
181 $ hg -y loop 0 |
13145
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
182 |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
183 test delay time estimates |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
184 |
28881
d9f7f590f1e3
test-progress: disable mocking-time tests on chg
Yuya Nishihara <yuya@tcha.org>
parents:
28171
diff
changeset
|
185 #if no-chg |
d9f7f590f1e3
test-progress: disable mocking-time tests on chg
Yuya Nishihara <yuya@tcha.org>
parents:
28171
diff
changeset
|
186 |
13145
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
187 $ cat > mocktime.py <<EOF |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
188 > import os |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
189 > import time |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
190 > |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
191 > class mocktime(object): |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
192 > def __init__(self, increment): |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
193 > self.time = 0 |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
194 > self.increment = increment |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
195 > def __call__(self): |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
196 > self.time += self.increment |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
197 > return self.time |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
198 > |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
199 > def uisetup(ui): |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
200 > 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
|
201 > EOF |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
202 |
15372
695ac6aca77f
check-code: fix issues with finding patterns in unified tests, fix tests
Matt Mackall <mpm@selenic.com>
parents:
14838
diff
changeset
|
203 $ 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
|
204 $ echo "[extensions]" >> $HGRCPATH |
13145
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
205 $ 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
|
206 $ echo "progress=" >> $HGRCPATH |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
207 $ 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
|
208 $ echo "[progress]" >> $HGRCPATH |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
209 $ echo "assume-tty=1" >> $HGRCPATH |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
210 $ echo "delay=25" >> $HGRCPATH |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
211 $ echo "width=60" >> $HGRCPATH |
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
212 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
213 $ hg -y loop 8 |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
214 \r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
215 loop [=========> ] 2/8 1m07s\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
216 loop [===============> ] 3/8 56s\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
217 loop [=====================> ] 4/8 45s\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
218 loop [==========================> ] 5/8 34s\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
219 loop [================================> ] 6/8 23s\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
220 loop [=====================================> ] 7/8 12s\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
221 \r (no-eol) (esc) |
13145
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
222 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
223 $ MOCKTIME=10000 hg -y loop 4 |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
224 \r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
225 loop [ ] 0/4\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
226 loop [=========> ] 1/4 8h21m\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
227 loop [====================> ] 2/4 5h34m\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
228 loop [==============================> ] 3/4 2h47m\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
229 \r (no-eol) (esc) |
13145
ce4cd176634e
test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents:
13142
diff
changeset
|
230 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
231 $ MOCKTIME=1000000 hg -y loop 4 |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
232 \r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
233 loop [ ] 0/4\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
234 loop [=========> ] 1/4 5w00d\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
235 loop [====================> ] 2/4 3w03d\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
236 loop [=============================> ] 3/4 11d14h\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
237 \r (no-eol) (esc) |
13236
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
238 |
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
239 |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
240 $ MOCKTIME=14000000 hg -y loop 4 |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
241 \r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
242 loop [ ] 0/4\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
243 loop [=========> ] 1/4 1y18w\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
244 loop [===================> ] 2/4 46w03d\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
245 loop [=============================> ] 3/4 23w02d\r (no-eol) (esc) |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
246 \r (no-eol) (esc) |
13236
3f299f5d9a29
progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents:
13154
diff
changeset
|
247 |
13154
e11c14f14491
progress: don't compute estimate without a total
Augie Fackler <durin42@gmail.com>
parents:
13149
diff
changeset
|
248 Time estimates should not fail when there's no end point: |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
249 $ hg -y loop -- -4 |
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
250 \r (no-eol) (esc) |
19229
41e39a0299cb
blackbox: fix recording exit codes (issue3938)
Durham Goode <durham@fb.com>
parents:
18670
diff
changeset
|
251 loop [ <=> ] 2\r (no-eol) (esc) |
41e39a0299cb
blackbox: fix recording exit codes (issue3938)
Durham Goode <durham@fb.com>
parents:
18670
diff
changeset
|
252 loop [ <=> ] 3\r (no-eol) (esc) |
17743
6047947afb6b
tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents:
16675
diff
changeset
|
253 \r (no-eol) (esc) |
21859
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
254 |
28881
d9f7f590f1e3
test-progress: disable mocking-time tests on chg
Yuya Nishihara <yuya@tcha.org>
parents:
28171
diff
changeset
|
255 #endif |
d9f7f590f1e3
test-progress: disable mocking-time tests on chg
Yuya Nishihara <yuya@tcha.org>
parents:
28171
diff
changeset
|
256 |
21859
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
257 test line trimming by '[progress] width', when progress topic contains |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
258 multi-byte characters, of which length of byte sequence and columns in |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
259 display are different from each other. |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
260 |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
261 $ cp $HGRCPATH.orig $HGRCPATH |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
262 $ cat >> $HGRCPATH <<EOF |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
263 > [extensions] |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
264 > progress= |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
265 > loop=`pwd`/loop.py |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
266 > [progress] |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
267 > assume-tty = 1 |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
268 > delay = 0 |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
269 > refresh = 0 |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
270 > EOF |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
271 |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
272 $ rm -f loop.pyc |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
273 $ cat >> loop.py <<EOF |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
274 > # use non-ascii characters as topic label of progress |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
275 > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
276 > topiclabel = u'\u3042\u3044\u3046\u3048'.encode('utf-8') |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
277 > EOF |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
278 |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
279 $ cat >> $HGRCPATH <<EOF |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
280 > [progress] |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
281 > format = topic number |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
282 > width= 12 |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
283 > EOF |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
284 |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
285 $ hg --encoding utf-8 -y loop --total 3 3 |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
286 \r (no-eol) (esc) |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
287 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88 0/3\r (no-eol) (esc) |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
288 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88 1/3\r (no-eol) (esc) |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
289 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88 2/3\r (no-eol) (esc) |
be4270d27a7e
progress: use 'encoding.trim' to trim output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21773
diff
changeset
|
290 \r (no-eol) (esc) |
21860
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
291 |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
292 test calculation of bar width, when progress topic contains multi-byte |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
293 characters, of which length of byte sequence and columns in display |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
294 are different from each other. |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
295 |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
296 $ cat >> $HGRCPATH <<EOF |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
297 > [progress] |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
298 > format = topic bar |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
299 > width= 21 |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
300 > # progwidth should be 9 (= 21 - (8+1) - 3) |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
301 > EOF |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
302 |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
303 $ hg --encoding utf-8 -y loop --total 3 3 |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
304 \r (no-eol) (esc) |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
305 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88 [ ]\r (no-eol) (esc) |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
306 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88 [==> ]\r (no-eol) (esc) |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
307 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88 [=====> ]\r (no-eol) (esc) |
e382cf9ec30b
progress: use 'encoding.colwidth' to get column width of output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21859
diff
changeset
|
308 \r (no-eol) (esc) |
21862
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
309 |
23139
e53f6b72a0e4
spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents:
21863
diff
changeset
|
310 test trimming progress items, when they contain multi-byte characters, |
21862
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
311 of which length of byte sequence and columns in display are different |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
312 from each other. |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
313 |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
314 $ rm -f loop.pyc |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
315 $ cat >> loop.py <<EOF |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
316 > # use non-ascii characters as loop items of progress |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
317 > loopitems = [ |
21863
f9c91c638378
progress: use 'encoding.colwidth' to get column width of items correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21862
diff
changeset
|
318 > u'\u3042\u3044'.encode('utf-8'), # 2 x 2 = 4 columns |
21862
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
319 > u'\u3042\u3044\u3046'.encode('utf-8'), # 2 x 3 = 6 columns |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
320 > u'\u3042\u3044\u3046\u3048'.encode('utf-8'), # 2 x 4 = 8 columns |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
321 > ] |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
322 > def getloopitem(i): |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
323 > return loopitems[i % len(loopitems)] |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
324 > EOF |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
325 |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
326 $ cat >> $HGRCPATH <<EOF |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
327 > [progress] |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
328 > # trim at tail side |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
329 > format = item+6 |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
330 > EOF |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
331 |
21863
f9c91c638378
progress: use 'encoding.colwidth' to get column width of items correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21862
diff
changeset
|
332 $ hg --encoding utf-8 -y loop --total 3 3 |
21862
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
333 \r (no-eol) (esc) |
21863
f9c91c638378
progress: use 'encoding.colwidth' to get column width of items correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21862
diff
changeset
|
334 \xe3\x81\x82\xe3\x81\x84 \r (no-eol) (esc) |
21862
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
335 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc) |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
336 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc) |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
337 \r (no-eol) (esc) |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
338 |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
339 $ cat >> $HGRCPATH <<EOF |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
340 > [progress] |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
341 > # trim at left side |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
342 > format = item-6 |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
343 > EOF |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
344 |
21863
f9c91c638378
progress: use 'encoding.colwidth' to get column width of items correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21862
diff
changeset
|
345 $ hg --encoding utf-8 -y loop --total 3 3 |
21862
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
346 \r (no-eol) (esc) |
21863
f9c91c638378
progress: use 'encoding.colwidth' to get column width of items correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21862
diff
changeset
|
347 \xe3\x81\x82\xe3\x81\x84 \r (no-eol) (esc) |
21862
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
348 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc) |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
349 \xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\r (no-eol) (esc) |
ba7f75e7f4e5
progress: use 'encoding.trim' to trim items in output line correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21860
diff
changeset
|
350 \r (no-eol) (esc) |