Show More
@@ -1,260 +1,261 | |||
|
1 | 1 | Setup |
|
2 | 2 | |
|
3 | 3 | $ cat <<EOF >> $HGRCPATH |
|
4 | 4 | > [ui] |
|
5 | 5 | > color = yes |
|
6 | 6 | > formatted = always |
|
7 | > paginate = never | |
|
7 | 8 | > [color] |
|
8 | 9 | > mode = ansi |
|
9 | 10 | > EOF |
|
10 | 11 | $ hg init repo |
|
11 | 12 | $ cd repo |
|
12 | 13 | $ cat > a <<EOF |
|
13 | 14 | > c |
|
14 | 15 | > c |
|
15 | 16 | > a |
|
16 | 17 | > a |
|
17 | 18 | > b |
|
18 | 19 | > a |
|
19 | 20 | > a |
|
20 | 21 | > c |
|
21 | 22 | > c |
|
22 | 23 | > EOF |
|
23 | 24 | $ hg ci -Am adda |
|
24 | 25 | adding a |
|
25 | 26 | $ cat > a <<EOF |
|
26 | 27 | > c |
|
27 | 28 | > c |
|
28 | 29 | > a |
|
29 | 30 | > a |
|
30 | 31 | > dd |
|
31 | 32 | > a |
|
32 | 33 | > a |
|
33 | 34 | > c |
|
34 | 35 | > c |
|
35 | 36 | > EOF |
|
36 | 37 | |
|
37 | 38 | default context |
|
38 | 39 | |
|
39 | 40 | $ hg diff --nodates |
|
40 | 41 | \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc) |
|
41 | 42 | \x1b[0;31;1m--- a/a\x1b[0m (esc) |
|
42 | 43 | \x1b[0;32;1m+++ b/a\x1b[0m (esc) |
|
43 | 44 | \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc) |
|
44 | 45 | c |
|
45 | 46 | a |
|
46 | 47 | a |
|
47 | 48 | \x1b[0;31m-b\x1b[0m (esc) |
|
48 | 49 | \x1b[0;32m+dd\x1b[0m (esc) |
|
49 | 50 | a |
|
50 | 51 | a |
|
51 | 52 | c |
|
52 | 53 | |
|
53 | 54 | (check that 'ui.color=yes' match '--color=auto') |
|
54 | 55 | |
|
55 | 56 | $ hg diff --nodates --config ui.formatted=no |
|
56 | 57 | diff -r cf9f4ba66af2 a |
|
57 | 58 | --- a/a |
|
58 | 59 | +++ b/a |
|
59 | 60 | @@ -2,7 +2,7 @@ |
|
60 | 61 | c |
|
61 | 62 | a |
|
62 | 63 | a |
|
63 | 64 | -b |
|
64 | 65 | +dd |
|
65 | 66 | a |
|
66 | 67 | a |
|
67 | 68 | c |
|
68 | 69 | |
|
69 | 70 | (check that 'ui.color=no' disable color) |
|
70 | 71 | |
|
71 | 72 | $ hg diff --nodates --config ui.formatted=yes --config ui.color=no |
|
72 | 73 | diff -r cf9f4ba66af2 a |
|
73 | 74 | --- a/a |
|
74 | 75 | +++ b/a |
|
75 | 76 | @@ -2,7 +2,7 @@ |
|
76 | 77 | c |
|
77 | 78 | a |
|
78 | 79 | a |
|
79 | 80 | -b |
|
80 | 81 | +dd |
|
81 | 82 | a |
|
82 | 83 | a |
|
83 | 84 | c |
|
84 | 85 | |
|
85 | 86 | (check that 'ui.color=always' force color) |
|
86 | 87 | |
|
87 | 88 | $ hg diff --nodates --config ui.formatted=no --config ui.color=always |
|
88 | 89 | \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc) |
|
89 | 90 | \x1b[0;31;1m--- a/a\x1b[0m (esc) |
|
90 | 91 | \x1b[0;32;1m+++ b/a\x1b[0m (esc) |
|
91 | 92 | \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc) |
|
92 | 93 | c |
|
93 | 94 | a |
|
94 | 95 | a |
|
95 | 96 | \x1b[0;31m-b\x1b[0m (esc) |
|
96 | 97 | \x1b[0;32m+dd\x1b[0m (esc) |
|
97 | 98 | a |
|
98 | 99 | a |
|
99 | 100 | c |
|
100 | 101 | |
|
101 | 102 | --unified=2 |
|
102 | 103 | |
|
103 | 104 | $ hg diff --nodates -U 2 |
|
104 | 105 | \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc) |
|
105 | 106 | \x1b[0;31;1m--- a/a\x1b[0m (esc) |
|
106 | 107 | \x1b[0;32;1m+++ b/a\x1b[0m (esc) |
|
107 | 108 | \x1b[0;35m@@ -3,5 +3,5 @@\x1b[0m (esc) |
|
108 | 109 | a |
|
109 | 110 | a |
|
110 | 111 | \x1b[0;31m-b\x1b[0m (esc) |
|
111 | 112 | \x1b[0;32m+dd\x1b[0m (esc) |
|
112 | 113 | a |
|
113 | 114 | a |
|
114 | 115 | |
|
115 | 116 | diffstat |
|
116 | 117 | |
|
117 | 118 | $ hg diff --stat |
|
118 | 119 | a | 2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc) |
|
119 | 120 | 1 files changed, 1 insertions(+), 1 deletions(-) |
|
120 | 121 | $ cat <<EOF >> $HGRCPATH |
|
121 | 122 | > [extensions] |
|
122 | 123 | > record = |
|
123 | 124 | > [ui] |
|
124 | 125 | > interactive = true |
|
125 | 126 | > [diff] |
|
126 | 127 | > git = True |
|
127 | 128 | > EOF |
|
128 | 129 | |
|
129 | 130 | #if execbit |
|
130 | 131 | |
|
131 | 132 | record |
|
132 | 133 | |
|
133 | 134 | $ chmod +x a |
|
134 | 135 | $ hg record -m moda a <<EOF |
|
135 | 136 | > y |
|
136 | 137 | > y |
|
137 | 138 | > EOF |
|
138 | 139 | \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc) |
|
139 | 140 | \x1b[0;36;1mold mode 100644\x1b[0m (esc) |
|
140 | 141 | \x1b[0;36;1mnew mode 100755\x1b[0m (esc) |
|
141 | 142 | 1 hunks, 1 lines changed |
|
142 | 143 | \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc) |
|
143 | 144 | |
|
144 | 145 | \x1b[0;35m@@ -2,7 +2,7 @@ c\x1b[0m (esc) |
|
145 | 146 | c |
|
146 | 147 | a |
|
147 | 148 | a |
|
148 | 149 | \x1b[0;31m-b\x1b[0m (esc) |
|
149 | 150 | \x1b[0;32m+dd\x1b[0m (esc) |
|
150 | 151 | a |
|
151 | 152 | a |
|
152 | 153 | c |
|
153 | 154 | \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc) |
|
154 | 155 | |
|
155 | 156 | |
|
156 | 157 | $ echo "[extensions]" >> $HGRCPATH |
|
157 | 158 | $ echo "mq=" >> $HGRCPATH |
|
158 | 159 | $ hg rollback |
|
159 | 160 | repository tip rolled back to revision 0 (undo commit) |
|
160 | 161 | working directory now based on revision 0 |
|
161 | 162 | |
|
162 | 163 | qrecord |
|
163 | 164 | |
|
164 | 165 | $ hg qrecord -m moda patch <<EOF |
|
165 | 166 | > y |
|
166 | 167 | > y |
|
167 | 168 | > EOF |
|
168 | 169 | \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc) |
|
169 | 170 | \x1b[0;36;1mold mode 100644\x1b[0m (esc) |
|
170 | 171 | \x1b[0;36;1mnew mode 100755\x1b[0m (esc) |
|
171 | 172 | 1 hunks, 1 lines changed |
|
172 | 173 | \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc) |
|
173 | 174 | |
|
174 | 175 | \x1b[0;35m@@ -2,7 +2,7 @@ c\x1b[0m (esc) |
|
175 | 176 | c |
|
176 | 177 | a |
|
177 | 178 | a |
|
178 | 179 | \x1b[0;31m-b\x1b[0m (esc) |
|
179 | 180 | \x1b[0;32m+dd\x1b[0m (esc) |
|
180 | 181 | a |
|
181 | 182 | a |
|
182 | 183 | c |
|
183 | 184 | \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc) |
|
184 | 185 | |
|
185 | 186 | |
|
186 | 187 | $ hg qpop -a |
|
187 | 188 | popping patch |
|
188 | 189 | patch queue now empty |
|
189 | 190 | |
|
190 | 191 | #endif |
|
191 | 192 | |
|
192 | 193 | issue3712: test colorization of subrepo diff |
|
193 | 194 | |
|
194 | 195 | $ hg init sub |
|
195 | 196 | $ echo b > sub/b |
|
196 | 197 | $ hg -R sub commit -Am 'create sub' |
|
197 | 198 | adding b |
|
198 | 199 | $ echo 'sub = sub' > .hgsub |
|
199 | 200 | $ hg add .hgsub |
|
200 | 201 | $ hg commit -m 'add subrepo sub' |
|
201 | 202 | $ echo aa >> a |
|
202 | 203 | $ echo bb >> sub/b |
|
203 | 204 | |
|
204 | 205 | $ hg diff -S |
|
205 | 206 | \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc) |
|
206 | 207 | \x1b[0;31;1m--- a/a\x1b[0m (esc) |
|
207 | 208 | \x1b[0;32;1m+++ b/a\x1b[0m (esc) |
|
208 | 209 | \x1b[0;35m@@ -7,3 +7,4 @@\x1b[0m (esc) |
|
209 | 210 | a |
|
210 | 211 | c |
|
211 | 212 | c |
|
212 | 213 | \x1b[0;32m+aa\x1b[0m (esc) |
|
213 | 214 | \x1b[0;1mdiff --git a/sub/b b/sub/b\x1b[0m (esc) |
|
214 | 215 | \x1b[0;31;1m--- a/sub/b\x1b[0m (esc) |
|
215 | 216 | \x1b[0;32;1m+++ b/sub/b\x1b[0m (esc) |
|
216 | 217 | \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc) |
|
217 | 218 | b |
|
218 | 219 | \x1b[0;32m+bb\x1b[0m (esc) |
|
219 | 220 | |
|
220 | 221 | test tabs |
|
221 | 222 | |
|
222 | 223 | $ cat >> a <<EOF |
|
223 | 224 | > one tab |
|
224 | 225 | > two tabs |
|
225 | 226 | > end tab |
|
226 | 227 | > mid tab |
|
227 | 228 | > all tabs |
|
228 | 229 | > EOF |
|
229 | 230 | $ hg diff --nodates |
|
230 | 231 | \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc) |
|
231 | 232 | \x1b[0;31;1m--- a/a\x1b[0m (esc) |
|
232 | 233 | \x1b[0;32;1m+++ b/a\x1b[0m (esc) |
|
233 | 234 | \x1b[0;35m@@ -7,3 +7,9 @@\x1b[0m (esc) |
|
234 | 235 | a |
|
235 | 236 | c |
|
236 | 237 | c |
|
237 | 238 | \x1b[0;32m+aa\x1b[0m (esc) |
|
238 | 239 | \x1b[0;32m+\x1b[0m \x1b[0;32mone tab\x1b[0m (esc) |
|
239 | 240 | \x1b[0;32m+\x1b[0m \x1b[0;32mtwo tabs\x1b[0m (esc) |
|
240 | 241 | \x1b[0;32m+end tab\x1b[0m\x1b[0;1;41m \x1b[0m (esc) |
|
241 | 242 | \x1b[0;32m+mid\x1b[0m \x1b[0;32mtab\x1b[0m (esc) |
|
242 | 243 | \x1b[0;32m+\x1b[0m \x1b[0;32mall\x1b[0m \x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc) |
|
243 | 244 | $ echo "[color]" >> $HGRCPATH |
|
244 | 245 | $ echo "diff.tab = bold magenta" >> $HGRCPATH |
|
245 | 246 | $ hg diff --nodates |
|
246 | 247 | \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc) |
|
247 | 248 | \x1b[0;31;1m--- a/a\x1b[0m (esc) |
|
248 | 249 | \x1b[0;32;1m+++ b/a\x1b[0m (esc) |
|
249 | 250 | \x1b[0;35m@@ -7,3 +7,9 @@\x1b[0m (esc) |
|
250 | 251 | a |
|
251 | 252 | c |
|
252 | 253 | c |
|
253 | 254 | \x1b[0;32m+aa\x1b[0m (esc) |
|
254 | 255 | \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mone tab\x1b[0m (esc) |
|
255 | 256 | \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtwo tabs\x1b[0m (esc) |
|
256 | 257 | \x1b[0;32m+end tab\x1b[0m\x1b[0;1;41m \x1b[0m (esc) |
|
257 | 258 | \x1b[0;32m+mid\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtab\x1b[0m (esc) |
|
258 | 259 | \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mall\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc) |
|
259 | 260 | |
|
260 | 261 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now