Mercurial > hg
annotate tests/test-status-color.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 | 1e184241de51 |
children | f34a8cff51d9 |
rev | line source |
---|---|
23172
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22763
diff
changeset
|
1 $ cat <<EOF >> $HGRCPATH |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22763
diff
changeset
|
2 > [extensions] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22763
diff
changeset
|
3 > color = |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22763
diff
changeset
|
4 > [color] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22763
diff
changeset
|
5 > mode = ansi |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
22763
diff
changeset
|
6 > EOF |
13997
b083d00578bf
test-status-color: fix terminfo code compatibility problem
Patrick Mezard <pmezard@gmail.com>
parents:
13987
diff
changeset
|
7 Terminfo codes compatibility fix |
b083d00578bf
test-status-color: fix terminfo code compatibility problem
Patrick Mezard <pmezard@gmail.com>
parents:
13987
diff
changeset
|
8 $ echo "color.none=0" >> $HGRCPATH |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
9 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
10 $ hg init repo1 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
11 $ cd repo1 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
12 $ mkdir a b a/1 b/1 b/2 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
13 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
14 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
15 hg status in repo root: |
7458
03dd55115985
color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
16 |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
17 $ hg status --color=always |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
18 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
19 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
20 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
21 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
22 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
23 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
24 |
22463
1c4ae0f6a30f
color: enable debug option to show labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
21227
diff
changeset
|
25 $ hg status --color=debug |
22464
964dd1c491ca
color: change the debug output format
Matt Mackall <mpm@selenic.com>
parents:
22463
diff
changeset
|
26 [status.unknown|? ][status.unknown|a/1/in_a_1] |
964dd1c491ca
color: change the debug output format
Matt Mackall <mpm@selenic.com>
parents:
22463
diff
changeset
|
27 [status.unknown|? ][status.unknown|a/in_a] |
964dd1c491ca
color: change the debug output format
Matt Mackall <mpm@selenic.com>
parents:
22463
diff
changeset
|
28 [status.unknown|? ][status.unknown|b/1/in_b_1] |
964dd1c491ca
color: change the debug output format
Matt Mackall <mpm@selenic.com>
parents:
22463
diff
changeset
|
29 [status.unknown|? ][status.unknown|b/2/in_b_2] |
964dd1c491ca
color: change the debug output format
Matt Mackall <mpm@selenic.com>
parents:
22463
diff
changeset
|
30 [status.unknown|? ][status.unknown|b/in_b] |
964dd1c491ca
color: change the debug output format
Matt Mackall <mpm@selenic.com>
parents:
22463
diff
changeset
|
31 [status.unknown|? ][status.unknown|in_root] |
22463
1c4ae0f6a30f
color: enable debug option to show labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
21227
diff
changeset
|
32 |
28384
3356bf61fa25
formatter: make labels work with templated output
Kostia Balytskyi <ikostia@fb.com>
parents:
26618
diff
changeset
|
33 hg status with template |
3356bf61fa25
formatter: make labels work with templated output
Kostia Balytskyi <ikostia@fb.com>
parents:
26618
diff
changeset
|
34 $ hg status -T "{label('red', path)}\n" --color=debug |
3356bf61fa25
formatter: make labels work with templated output
Kostia Balytskyi <ikostia@fb.com>
parents:
26618
diff
changeset
|
35 [red|a/1/in_a_1] |
3356bf61fa25
formatter: make labels work with templated output
Kostia Balytskyi <ikostia@fb.com>
parents:
26618
diff
changeset
|
36 [red|a/in_a] |
3356bf61fa25
formatter: make labels work with templated output
Kostia Balytskyi <ikostia@fb.com>
parents:
26618
diff
changeset
|
37 [red|b/1/in_b_1] |
3356bf61fa25
formatter: make labels work with templated output
Kostia Balytskyi <ikostia@fb.com>
parents:
26618
diff
changeset
|
38 [red|b/2/in_b_2] |
3356bf61fa25
formatter: make labels work with templated output
Kostia Balytskyi <ikostia@fb.com>
parents:
26618
diff
changeset
|
39 [red|b/in_b] |
3356bf61fa25
formatter: make labels work with templated output
Kostia Balytskyi <ikostia@fb.com>
parents:
26618
diff
changeset
|
40 [red|in_root] |
3356bf61fa25
formatter: make labels work with templated output
Kostia Balytskyi <ikostia@fb.com>
parents:
26618
diff
changeset
|
41 |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
42 hg status . in repo root: |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
43 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
44 $ hg status --color=always . |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
45 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
46 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
47 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
48 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
49 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
50 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) |
7458
03dd55115985
color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
51 |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
52 $ hg status --color=always --cwd a |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
53 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
54 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
55 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
56 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
57 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
58 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
59 $ hg status --color=always --cwd a . |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
60 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
61 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
62 $ hg status --color=always --cwd a .. |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
63 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
64 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
65 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/1/in_b_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
66 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/2/in_b_2\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
67 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/in_b\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
68 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
69 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
70 $ hg status --color=always --cwd b |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
71 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
72 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
73 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
74 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
75 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
76 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
77 $ hg status --color=always --cwd b . |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
78 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
79 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
80 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
81 $ hg status --color=always --cwd b .. |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
82 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/1/in_a_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
83 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/in_a\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
84 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
85 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
86 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
87 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
88 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
89 $ hg status --color=always --cwd a/1 |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
90 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
91 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
92 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
93 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
94 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
95 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
96 $ hg status --color=always --cwd a/1 . |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
97 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
98 $ hg status --color=always --cwd a/1 .. |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
99 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
100 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_a\x1b[0m (esc) |
7458
03dd55115985
color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
101 |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
102 $ hg status --color=always --cwd b/1 |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
103 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
104 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
105 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
106 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
107 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
108 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
109 $ hg status --color=always --cwd b/1 . |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
110 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
111 $ hg status --color=always --cwd b/1 .. |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
112 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
113 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../2/in_b_2\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
114 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
115 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
116 $ hg status --color=always --cwd b/2 |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
117 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
118 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
119 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
120 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
121 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
122 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
123 $ hg status --color=always --cwd b/2 . |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
124 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
125 $ hg status --color=always --cwd b/2 .. |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
126 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../1/in_b_1\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
127 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
128 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc) |
19073
d78d0256198e
color: set _colormode to None when mode is unset (issue3895)
Siddharth Agarwal <sid0@fb.com>
parents:
17910
diff
changeset
|
129 |
d78d0256198e
color: set _colormode to None when mode is unset (issue3895)
Siddharth Agarwal <sid0@fb.com>
parents:
17910
diff
changeset
|
130 Make sure --color=never works |
d78d0256198e
color: set _colormode to None when mode is unset (issue3895)
Siddharth Agarwal <sid0@fb.com>
parents:
17910
diff
changeset
|
131 $ hg status --color=never |
d78d0256198e
color: set _colormode to None when mode is unset (issue3895)
Siddharth Agarwal <sid0@fb.com>
parents:
17910
diff
changeset
|
132 ? a/1/in_a_1 |
d78d0256198e
color: set _colormode to None when mode is unset (issue3895)
Siddharth Agarwal <sid0@fb.com>
parents:
17910
diff
changeset
|
133 ? a/in_a |
d78d0256198e
color: set _colormode to None when mode is unset (issue3895)
Siddharth Agarwal <sid0@fb.com>
parents:
17910
diff
changeset
|
134 ? b/1/in_b_1 |
d78d0256198e
color: set _colormode to None when mode is unset (issue3895)
Siddharth Agarwal <sid0@fb.com>
parents:
17910
diff
changeset
|
135 ? b/2/in_b_2 |
d78d0256198e
color: set _colormode to None when mode is unset (issue3895)
Siddharth Agarwal <sid0@fb.com>
parents:
17910
diff
changeset
|
136 ? b/in_b |
d78d0256198e
color: set _colormode to None when mode is unset (issue3895)
Siddharth Agarwal <sid0@fb.com>
parents:
17910
diff
changeset
|
137 ? in_root |
d78d0256198e
color: set _colormode to None when mode is unset (issue3895)
Siddharth Agarwal <sid0@fb.com>
parents:
17910
diff
changeset
|
138 |
19074
a1922b9a2cad
color: add a test with extension loaded and ui.formatted=False
Siddharth Agarwal <sid0@fb.com>
parents:
19073
diff
changeset
|
139 Make sure ui.formatted=False works |
a1922b9a2cad
color: add a test with extension loaded and ui.formatted=False
Siddharth Agarwal <sid0@fb.com>
parents:
19073
diff
changeset
|
140 $ hg status --config ui.formatted=False |
a1922b9a2cad
color: add a test with extension loaded and ui.formatted=False
Siddharth Agarwal <sid0@fb.com>
parents:
19073
diff
changeset
|
141 ? a/1/in_a_1 |
a1922b9a2cad
color: add a test with extension loaded and ui.formatted=False
Siddharth Agarwal <sid0@fb.com>
parents:
19073
diff
changeset
|
142 ? a/in_a |
a1922b9a2cad
color: add a test with extension loaded and ui.formatted=False
Siddharth Agarwal <sid0@fb.com>
parents:
19073
diff
changeset
|
143 ? b/1/in_b_1 |
a1922b9a2cad
color: add a test with extension loaded and ui.formatted=False
Siddharth Agarwal <sid0@fb.com>
parents:
19073
diff
changeset
|
144 ? b/2/in_b_2 |
a1922b9a2cad
color: add a test with extension loaded and ui.formatted=False
Siddharth Agarwal <sid0@fb.com>
parents:
19073
diff
changeset
|
145 ? b/in_b |
a1922b9a2cad
color: add a test with extension loaded and ui.formatted=False
Siddharth Agarwal <sid0@fb.com>
parents:
19073
diff
changeset
|
146 ? in_root |
a1922b9a2cad
color: add a test with extension loaded and ui.formatted=False
Siddharth Agarwal <sid0@fb.com>
parents:
19073
diff
changeset
|
147 |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
148 $ cd .. |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
149 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
150 $ hg init repo2 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
151 $ cd repo2 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
152 $ touch modified removed deleted ignored |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
153 $ echo "^ignored$" > .hgignore |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11783
diff
changeset
|
154 $ hg ci -A -m 'initial checkin' |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
155 adding .hgignore |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
156 adding deleted |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
157 adding modified |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
158 adding removed |
22463
1c4ae0f6a30f
color: enable debug option to show labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
21227
diff
changeset
|
159 $ hg log --color=debug |
22464
964dd1c491ca
color: change the debug output format
Matt Mackall <mpm@selenic.com>
parents:
22463
diff
changeset
|
160 [log.changeset changeset.draft|changeset: 0:389aef86a55e] |
964dd1c491ca
color: change the debug output format
Matt Mackall <mpm@selenic.com>
parents:
22463
diff
changeset
|
161 [log.tag|tag: tip] |
964dd1c491ca
color: change the debug output format
Matt Mackall <mpm@selenic.com>
parents:
22463
diff
changeset
|
162 [log.user|user: test] |
964dd1c491ca
color: change the debug output format
Matt Mackall <mpm@selenic.com>
parents:
22463
diff
changeset
|
163 [log.date|date: Thu Jan 01 00:00:00 1970 +0000] |
964dd1c491ca
color: change the debug output format
Matt Mackall <mpm@selenic.com>
parents:
22463
diff
changeset
|
164 [log.summary|summary: initial checkin] |
22463
1c4ae0f6a30f
color: enable debug option to show labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
21227
diff
changeset
|
165 |
28827
1e184241de51
compact: add color labels to -Tcompact
timeless <timeless@mozdev.org>
parents:
28384
diff
changeset
|
166 $ hg log -Tcompact --color=debug |
1e184241de51
compact: add color labels to -Tcompact
timeless <timeless@mozdev.org>
parents:
28384
diff
changeset
|
167 [log.changeset changeset.draft|0][tip] [log.node|389aef86a55e] [log.date|1970-01-01 00:00 +0000] [log.user|test] |
1e184241de51
compact: add color labels to -Tcompact
timeless <timeless@mozdev.org>
parents:
28384
diff
changeset
|
168 [ui.note log.description|initial checkin] |
1e184241de51
compact: add color labels to -Tcompact
timeless <timeless@mozdev.org>
parents:
28384
diff
changeset
|
169 |
22763
7ebf91426f6a
color: omit debug label output on empty strings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
22464
diff
changeset
|
170 Labels on empty strings should not be displayed, labels on custom |
7ebf91426f6a
color: omit debug label output on empty strings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
22464
diff
changeset
|
171 templates should be. |
7ebf91426f6a
color: omit debug label output on empty strings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
22464
diff
changeset
|
172 |
7ebf91426f6a
color: omit debug label output on empty strings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
22464
diff
changeset
|
173 $ hg log --color=debug -T '{label("my.label",author)}\n{label("skipped.label","")}' |
7ebf91426f6a
color: omit debug label output on empty strings
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
22464
diff
changeset
|
174 [my.label|test] |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
175 $ touch modified added unknown ignored |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
176 $ hg add added |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
177 $ hg remove removed |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
178 $ rm deleted |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
179 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
180 hg status: |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
181 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
182 $ hg status --color=always |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
183 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
184 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
185 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
186 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
187 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
188 hg status modified added removed deleted unknown never-existed ignored: |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
189 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
190 $ hg status --color=always modified added removed deleted unknown never-existed ignored |
15521
117f9190c1ba
tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents:
14757
diff
changeset
|
191 never-existed: * (glob) |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
192 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
193 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
194 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
195 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
196 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
197 $ hg copy modified copied |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
198 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
199 hg status -C: |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
200 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
201 $ hg status --color=always -C |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
202 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
203 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc) |
12942
05fffd665170
tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents:
12365
diff
changeset
|
204 \x1b[0;0m modified\x1b[0m (esc) |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
205 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
206 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
207 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
208 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
209 hg status -A: |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
210 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
211 $ hg status --color=always -A |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
212 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
213 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc) |
12942
05fffd665170
tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents:
12365
diff
changeset
|
214 \x1b[0;0m modified\x1b[0m (esc) |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
215 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
216 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
217 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
218 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
219 \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
220 \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
221 |
20387
16c643f3a1a5
tests: use small conditional section for tic requirement in test-status-color.t
Mads Kiilerich <madski@unity3d.com>
parents:
19074
diff
changeset
|
222 |
13987
e0f07847f8de
color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents:
12942
diff
changeset
|
223 hg status -A (with terminfo color): |
e0f07847f8de
color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents:
12942
diff
changeset
|
224 |
20387
16c643f3a1a5
tests: use small conditional section for tic requirement in test-status-color.t
Mads Kiilerich <madski@unity3d.com>
parents:
19074
diff
changeset
|
225 #if tic |
16c643f3a1a5
tests: use small conditional section for tic requirement in test-status-color.t
Mads Kiilerich <madski@unity3d.com>
parents:
19074
diff
changeset
|
226 |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15539
diff
changeset
|
227 $ mkdir "$TESTTMP/terminfo" |
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15539
diff
changeset
|
228 $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti" |
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15539
diff
changeset
|
229 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --color=always -A |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
230 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
231 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m (esc) |
13997
b083d00578bf
test-status-color: fix terminfo code compatibility problem
Patrick Mezard <pmezard@gmail.com>
parents:
13987
diff
changeset
|
232 \x1b[30m\x1b[30m modified\x1b[30m (esc) |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
233 \x1b[30m\x1b[31m\x1b[1mR \x1b[30m\x1b[30m\x1b[31m\x1b[1mremoved\x1b[30m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
234 \x1b[30m\x1b[36m\x1b[1m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[1m\x1b[4mdeleted\x1b[30m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
235 \x1b[30m\x1b[35m\x1b[1m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[1m\x1b[4munknown\x1b[30m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
236 \x1b[30m\x1b[30m\x1b[1mI \x1b[30m\x1b[30m\x1b[30m\x1b[1mignored\x1b[30m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
237 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30m.hgignore\x1b[30m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
238 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30mmodified\x1b[30m (esc) |
13987
e0f07847f8de
color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents:
12942
diff
changeset
|
239 |
20387
16c643f3a1a5
tests: use small conditional section for tic requirement in test-status-color.t
Mads Kiilerich <madski@unity3d.com>
parents:
19074
diff
changeset
|
240 #endif |
16c643f3a1a5
tests: use small conditional section for tic requirement in test-status-color.t
Mads Kiilerich <madski@unity3d.com>
parents:
19074
diff
changeset
|
241 |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
242 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
243 $ echo "^ignoreddir$" > .hgignore |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
244 $ mkdir ignoreddir |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
245 $ touch ignoreddir/file |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
246 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
247 hg status ignoreddir/file: |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
248 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
249 $ hg status --color=always ignoreddir/file |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
250 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
251 hg status -i ignoreddir/file: |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
252 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
253 $ hg status --color=always -i ignoreddir/file |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
254 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignoreddir/file\x1b[0m (esc) |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
255 $ cd .. |
7458
03dd55115985
color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
256 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
257 check 'status -q' and some combinations |
7458
03dd55115985
color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
258 |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
259 $ hg init repo3 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
260 $ cd repo3 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
261 $ touch modified removed deleted ignored |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
262 $ echo "^ignored$" > .hgignore |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
263 $ hg commit -A -m 'initial checkin' |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
264 adding .hgignore |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
265 adding deleted |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
266 adding modified |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
267 adding removed |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
268 $ touch added unknown ignored |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
269 $ hg add added |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
270 $ echo "test" >> modified |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
271 $ hg remove removed |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
272 $ rm deleted |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
273 $ hg copy modified copied |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
274 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
275 test unknown color |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
276 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
277 $ hg --config color.status.modified=periwinkle status --color=always |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
278 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified) |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
279 M modified |
17910
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
280 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
281 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
282 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
283 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) |
c8709ff57ff2
status: use condwrite to avoid zero-width format string hack
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
284 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) |
8945
7b3d837ca60e
color: don't blow up if configured with unknown color (just warn).
Greg Ward <greg-hg@gerg.ca>
parents:
7458
diff
changeset
|
285 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
286 Run status with 2 different flags. |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
287 Check if result is the same or different. |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
288 If result is not as expected, raise error |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
289 |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
290 $ assert() { |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
291 > hg status --color=always $1 > ../a |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
292 > hg status --color=always $2 > ../b |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
293 > if diff ../a ../b > /dev/null; then |
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
294 > out=0 |
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
295 > else |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
296 > out=1 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
297 > fi |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
298 > if [ $3 -eq 0 ]; then |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
299 > df="same" |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
300 > else |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
301 > df="different" |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
302 > fi |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
303 > if [ $out -ne $3 ]; then |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
304 > echo "Error on $1 and $2, should be $df." |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
305 > fi |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
306 > } |
7458
03dd55115985
color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
307 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
308 assert flag1 flag2 [0-same | 1-different] |
7458
03dd55115985
color: Add tests for colorized diff and status output.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
309 |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
310 $ assert "-q" "-mard" 0 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
311 $ assert "-A" "-marduicC" 0 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
312 $ assert "-qA" "-mardcC" 0 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
313 $ assert "-qAui" "-A" 0 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
314 $ assert "-qAu" "-marducC" 0 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
315 $ assert "-qAi" "-mardicC" 0 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
316 $ assert "-qu" "-u" 0 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
317 $ assert "-q" "-u" 1 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
318 $ assert "-m" "-a" 1 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
319 $ assert "-r" "-d" 1 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
320 $ cd .. |
10223
51421ab573de
color: colorize output of hg resolve -l
Georg Brandl <georg@python.org>
parents:
8945
diff
changeset
|
321 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
322 test 'resolve -l' |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
323 |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
324 $ hg init repo4 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
325 $ cd repo4 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
326 $ echo "file a" > a |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
327 $ echo "file b" > b |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
328 $ hg add a b |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
329 $ hg commit -m "initial" |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
330 $ echo "file a change 1" > a |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
331 $ echo "file b change 1" > b |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
332 $ hg commit -m "head 1" |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
333 $ hg update 0 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
334 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
335 $ echo "file a change 2" > a |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
336 $ echo "file b change 2" > b |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
337 $ hg commit -m "head 2" |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
338 created new head |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
339 $ hg merge |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
340 merging a |
26618
8e6d5b7317e6
merge.mergestate: perform all premerges before any merges (BC)
Siddharth Agarwal <sid0@fb.com>
parents:
26614
diff
changeset
|
341 merging b |
26614
ef1eb6df7071
simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents:
24127
diff
changeset
|
342 warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
ef1eb6df7071
simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents:
24127
diff
changeset
|
343 warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
344 0 files updated, 0 files merged, 0 files removed, 2 files unresolved |
12314
f2daa6ab514a
merge: suggest 'hg up -C .' for discarding changes, not 'hg up -C'
Brodie Rao <brodie@bitheap.org>
parents:
12156
diff
changeset
|
345 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12314
diff
changeset
|
346 [1] |
11783
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
347 $ hg resolve -m b |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
348 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
349 hg resolve with one unresolved, one resolved: |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
350 |
599a78030fa8
tests: unify test-status-color
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11141
diff
changeset
|
351 $ hg resolve --color=always -l |
24127
4cb8002658d6
resolve: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
352 \x1b[0;31;1mU \x1b[0m\x1b[0;31;1ma\x1b[0m (esc) |
4cb8002658d6
resolve: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
353 \x1b[0;32;1mR \x1b[0m\x1b[0;32;1mb\x1b[0m (esc) |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
354 |
21227
75aaae8ad660
color: don't fail on error messages when no curses (issue4237)
Mads Kiilerich <madski@unity3d.com>
parents:
20387
diff
changeset
|
355 color coding of error message with current availability of curses |
75aaae8ad660
color: don't fail on error messages when no curses (issue4237)
Mads Kiilerich <madski@unity3d.com>
parents:
20387
diff
changeset
|
356 |
75aaae8ad660
color: don't fail on error messages when no curses (issue4237)
Mads Kiilerich <madski@unity3d.com>
parents:
20387
diff
changeset
|
357 $ hg unknowncommand > /dev/null |
75aaae8ad660
color: don't fail on error messages when no curses (issue4237)
Mads Kiilerich <madski@unity3d.com>
parents:
20387
diff
changeset
|
358 hg: unknown command 'unknowncommand' |
75aaae8ad660
color: don't fail on error messages when no curses (issue4237)
Mads Kiilerich <madski@unity3d.com>
parents:
20387
diff
changeset
|
359 [255] |
75aaae8ad660
color: don't fail on error messages when no curses (issue4237)
Mads Kiilerich <madski@unity3d.com>
parents:
20387
diff
changeset
|
360 |
75aaae8ad660
color: don't fail on error messages when no curses (issue4237)
Mads Kiilerich <madski@unity3d.com>
parents:
20387
diff
changeset
|
361 color coding of error message without curses |
75aaae8ad660
color: don't fail on error messages when no curses (issue4237)
Mads Kiilerich <madski@unity3d.com>
parents:
20387
diff
changeset
|
362 |
75aaae8ad660
color: don't fail on error messages when no curses (issue4237)
Mads Kiilerich <madski@unity3d.com>
parents:
20387
diff
changeset
|
363 $ echo 'raise ImportError' > curses.py |
75aaae8ad660
color: don't fail on error messages when no curses (issue4237)
Mads Kiilerich <madski@unity3d.com>
parents:
20387
diff
changeset
|
364 $ PYTHONPATH=`pwd`:$PYTHONPATH hg unknowncommand > /dev/null |
75aaae8ad660
color: don't fail on error messages when no curses (issue4237)
Mads Kiilerich <madski@unity3d.com>
parents:
20387
diff
changeset
|
365 hg: unknown command 'unknowncommand' |
75aaae8ad660
color: don't fail on error messages when no curses (issue4237)
Mads Kiilerich <madski@unity3d.com>
parents:
20387
diff
changeset
|
366 [255] |
75aaae8ad660
color: don't fail on error messages when no curses (issue4237)
Mads Kiilerich <madski@unity3d.com>
parents:
20387
diff
changeset
|
367 |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
368 $ cd .. |