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