Mercurial > hg
comparison tests/test-diff-color.t @ 12415:1ff3fc4b6a66
tests: unify test-diff-color
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 26 Sep 2010 13:41:32 -0500 |
parents | tests/test-diff-color@d29bd00bbc50 |
children | 05fffd665170 |
comparison
equal
deleted
inserted
replaced
12414:858fe1e74785 | 12415:1ff3fc4b6a66 |
---|---|
1 Setup | |
2 | |
3 $ echo "[extensions]" >> $HGRCPATH | |
4 $ echo "color=" >> $HGRCPATH | |
5 $ hg init repo | |
6 $ cd repo | |
7 $ cat > a <<EOF | |
8 > c | |
9 > c | |
10 > a | |
11 > a | |
12 > b | |
13 > a | |
14 > a | |
15 > c | |
16 > c | |
17 > EOF | |
18 $ hg ci -Am adda | |
19 adding a | |
20 $ cat > a <<EOF | |
21 > c | |
22 > c | |
23 > a | |
24 > a | |
25 > dd | |
26 > a | |
27 > a | |
28 > c | |
29 > c | |
30 > EOF | |
31 | |
32 default context | |
33 | |
34 $ hg diff --nodates --color=always | |
35 [0;1mdiff -r cf9f4ba66af2 a[0m | |
36 [0;31;1m--- a/a[0m | |
37 [0;32;1m+++ b/a[0m | |
38 [0;35m@@ -2,7 +2,7 @@[0m | |
39 c | |
40 a | |
41 a | |
42 [0;31m-b[0m | |
43 [0;32m+dd[0m | |
44 a | |
45 a | |
46 c | |
47 | |
48 --unified=2 | |
49 | |
50 $ hg diff --nodates -U 2 --color=always | |
51 [0;1mdiff -r cf9f4ba66af2 a[0m | |
52 [0;31;1m--- a/a[0m | |
53 [0;32;1m+++ b/a[0m | |
54 [0;35m@@ -3,5 +3,5 @@[0m | |
55 a | |
56 a | |
57 [0;31m-b[0m | |
58 [0;32m+dd[0m | |
59 a | |
60 a | |
61 | |
62 diffstat | |
63 | |
64 $ hg diff --stat --color=always | |
65 a | 2 [0;32m+[0m[0;31m-[0m | |
66 1 files changed, 1 insertions(+), 1 deletions(-) | |
67 $ echo "record=" >> $HGRCPATH | |
68 $ echo "[ui]" >> $HGRCPATH | |
69 $ echo "interactive=true" >> $HGRCPATH | |
70 $ echo "[diff]" >> $HGRCPATH | |
71 $ echo "git=True" >> $HGRCPATH | |
72 | |
73 record | |
74 | |
75 $ chmod 0755 a | |
76 $ hg record --color=always -m moda a <<EOF | |
77 > y | |
78 > y | |
79 > EOF | |
80 [0;1mdiff --git a/a b/a[0m | |
81 [0;36;1mold mode 100644[0m | |
82 [0;36;1mnew mode 100755[0m | |
83 1 hunks, 1 lines changed | |
84 examine changes to 'a'? [Ynsfdaq?] | |
85 [0;35m@@ -2,7 +2,7 @@[0m | |
86 c | |
87 a | |
88 a | |
89 [0;31m-b[0m | |
90 [0;32m+dd[0m | |
91 a | |
92 a | |
93 c | |
94 record this change to 'a'? [Ynsfdaq?] | |
95 $ echo | |
96 | |
97 $ echo "[extensions]" >> $HGRCPATH | |
98 $ echo "mq=" >> $HGRCPATH | |
99 $ hg rollback | |
100 rolling back to revision 0 (undo commit) | |
101 | |
102 qrecord | |
103 | |
104 $ hg qrecord --color=always -m moda patch <<EOF | |
105 > y | |
106 > y | |
107 > EOF | |
108 [0;1mdiff --git a/a b/a[0m | |
109 [0;36;1mold mode 100644[0m | |
110 [0;36;1mnew mode 100755[0m | |
111 1 hunks, 1 lines changed | |
112 examine changes to 'a'? [Ynsfdaq?] | |
113 [0;35m@@ -2,7 +2,7 @@[0m | |
114 c | |
115 a | |
116 a | |
117 [0;31m-b[0m | |
118 [0;32m+dd[0m | |
119 a | |
120 a | |
121 c | |
122 record this change to 'a'? [Ynsfdaq?] | |
123 $ echo | |
124 |