##// END OF EJS Templates
test-status-color: fix terminfo code compatibility problem...
Patrick Mezard -
r13997:b083d005 default
parent child Browse files
Show More
@@ -1,292 +1,294 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "color=" >> $HGRCPATH
2 $ echo "color=" >> $HGRCPATH
3 $ echo "[color]" >> $HGRCPATH
3 $ echo "[color]" >> $HGRCPATH
4 $ echo "mode=ansi" >> $HGRCPATH
4 $ echo "mode=ansi" >> $HGRCPATH
5 Terminfo codes compatibility fix
6 $ echo "color.none=0" >> $HGRCPATH
5
7
6 $ hg init repo1
8 $ hg init repo1
7 $ cd repo1
9 $ cd repo1
8 $ mkdir a b a/1 b/1 b/2
10 $ mkdir a b a/1 b/1 b/2
9 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
11 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
10
12
11 hg status in repo root:
13 hg status in repo root:
12
14
13 $ hg status --color=always
15 $ hg status --color=always
14 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
16 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
15 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
17 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
16 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
18 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
17 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
19 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
18 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
20 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
19 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
21 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
20
22
21 hg status . in repo root:
23 hg status . in repo root:
22
24
23 $ hg status --color=always .
25 $ hg status --color=always .
24 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
26 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
25 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
27 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
26 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
28 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
27 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
29 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
28 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
30 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
29 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
31 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
30
32
31 $ hg status --color=always --cwd a
33 $ hg status --color=always --cwd a
32 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
34 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
33 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
35 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
34 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
36 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
35 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
37 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
36 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
38 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
37 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
39 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
38 $ hg status --color=always --cwd a .
40 $ hg status --color=always --cwd a .
39 \x1b[0;35;1;4m? 1/in_a_1\x1b[0m (esc)
41 \x1b[0;35;1;4m? 1/in_a_1\x1b[0m (esc)
40 \x1b[0;35;1;4m? in_a\x1b[0m (esc)
42 \x1b[0;35;1;4m? in_a\x1b[0m (esc)
41 $ hg status --color=always --cwd a ..
43 $ hg status --color=always --cwd a ..
42 \x1b[0;35;1;4m? 1/in_a_1\x1b[0m (esc)
44 \x1b[0;35;1;4m? 1/in_a_1\x1b[0m (esc)
43 \x1b[0;35;1;4m? in_a\x1b[0m (esc)
45 \x1b[0;35;1;4m? in_a\x1b[0m (esc)
44 \x1b[0;35;1;4m? ../b/1/in_b_1\x1b[0m (esc)
46 \x1b[0;35;1;4m? ../b/1/in_b_1\x1b[0m (esc)
45 \x1b[0;35;1;4m? ../b/2/in_b_2\x1b[0m (esc)
47 \x1b[0;35;1;4m? ../b/2/in_b_2\x1b[0m (esc)
46 \x1b[0;35;1;4m? ../b/in_b\x1b[0m (esc)
48 \x1b[0;35;1;4m? ../b/in_b\x1b[0m (esc)
47 \x1b[0;35;1;4m? ../in_root\x1b[0m (esc)
49 \x1b[0;35;1;4m? ../in_root\x1b[0m (esc)
48
50
49 $ hg status --color=always --cwd b
51 $ hg status --color=always --cwd b
50 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
52 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
51 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
53 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
52 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
54 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
53 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
55 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
54 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
56 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
55 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
57 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
56 $ hg status --color=always --cwd b .
58 $ hg status --color=always --cwd b .
57 \x1b[0;35;1;4m? 1/in_b_1\x1b[0m (esc)
59 \x1b[0;35;1;4m? 1/in_b_1\x1b[0m (esc)
58 \x1b[0;35;1;4m? 2/in_b_2\x1b[0m (esc)
60 \x1b[0;35;1;4m? 2/in_b_2\x1b[0m (esc)
59 \x1b[0;35;1;4m? in_b\x1b[0m (esc)
61 \x1b[0;35;1;4m? in_b\x1b[0m (esc)
60 $ hg status --color=always --cwd b ..
62 $ hg status --color=always --cwd b ..
61 \x1b[0;35;1;4m? ../a/1/in_a_1\x1b[0m (esc)
63 \x1b[0;35;1;4m? ../a/1/in_a_1\x1b[0m (esc)
62 \x1b[0;35;1;4m? ../a/in_a\x1b[0m (esc)
64 \x1b[0;35;1;4m? ../a/in_a\x1b[0m (esc)
63 \x1b[0;35;1;4m? 1/in_b_1\x1b[0m (esc)
65 \x1b[0;35;1;4m? 1/in_b_1\x1b[0m (esc)
64 \x1b[0;35;1;4m? 2/in_b_2\x1b[0m (esc)
66 \x1b[0;35;1;4m? 2/in_b_2\x1b[0m (esc)
65 \x1b[0;35;1;4m? in_b\x1b[0m (esc)
67 \x1b[0;35;1;4m? in_b\x1b[0m (esc)
66 \x1b[0;35;1;4m? ../in_root\x1b[0m (esc)
68 \x1b[0;35;1;4m? ../in_root\x1b[0m (esc)
67
69
68 $ hg status --color=always --cwd a/1
70 $ hg status --color=always --cwd a/1
69 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
71 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
70 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
72 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
71 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
73 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
72 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
74 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
73 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
75 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
74 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
76 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
75 $ hg status --color=always --cwd a/1 .
77 $ hg status --color=always --cwd a/1 .
76 \x1b[0;35;1;4m? in_a_1\x1b[0m (esc)
78 \x1b[0;35;1;4m? in_a_1\x1b[0m (esc)
77 $ hg status --color=always --cwd a/1 ..
79 $ hg status --color=always --cwd a/1 ..
78 \x1b[0;35;1;4m? in_a_1\x1b[0m (esc)
80 \x1b[0;35;1;4m? in_a_1\x1b[0m (esc)
79 \x1b[0;35;1;4m? ../in_a\x1b[0m (esc)
81 \x1b[0;35;1;4m? ../in_a\x1b[0m (esc)
80
82
81 $ hg status --color=always --cwd b/1
83 $ hg status --color=always --cwd b/1
82 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
84 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
83 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
85 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
84 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
86 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
85 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
87 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
86 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
88 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
87 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
89 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
88 $ hg status --color=always --cwd b/1 .
90 $ hg status --color=always --cwd b/1 .
89 \x1b[0;35;1;4m? in_b_1\x1b[0m (esc)
91 \x1b[0;35;1;4m? in_b_1\x1b[0m (esc)
90 $ hg status --color=always --cwd b/1 ..
92 $ hg status --color=always --cwd b/1 ..
91 \x1b[0;35;1;4m? in_b_1\x1b[0m (esc)
93 \x1b[0;35;1;4m? in_b_1\x1b[0m (esc)
92 \x1b[0;35;1;4m? ../2/in_b_2\x1b[0m (esc)
94 \x1b[0;35;1;4m? ../2/in_b_2\x1b[0m (esc)
93 \x1b[0;35;1;4m? ../in_b\x1b[0m (esc)
95 \x1b[0;35;1;4m? ../in_b\x1b[0m (esc)
94
96
95 $ hg status --color=always --cwd b/2
97 $ hg status --color=always --cwd b/2
96 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
98 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
97 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
99 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
98 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
100 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
99 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
101 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
100 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
102 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
101 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
103 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
102 $ hg status --color=always --cwd b/2 .
104 $ hg status --color=always --cwd b/2 .
103 \x1b[0;35;1;4m? in_b_2\x1b[0m (esc)
105 \x1b[0;35;1;4m? in_b_2\x1b[0m (esc)
104 $ hg status --color=always --cwd b/2 ..
106 $ hg status --color=always --cwd b/2 ..
105 \x1b[0;35;1;4m? ../1/in_b_1\x1b[0m (esc)
107 \x1b[0;35;1;4m? ../1/in_b_1\x1b[0m (esc)
106 \x1b[0;35;1;4m? in_b_2\x1b[0m (esc)
108 \x1b[0;35;1;4m? in_b_2\x1b[0m (esc)
107 \x1b[0;35;1;4m? ../in_b\x1b[0m (esc)
109 \x1b[0;35;1;4m? ../in_b\x1b[0m (esc)
108 $ cd ..
110 $ cd ..
109
111
110 $ hg init repo2
112 $ hg init repo2
111 $ cd repo2
113 $ cd repo2
112 $ touch modified removed deleted ignored
114 $ touch modified removed deleted ignored
113 $ echo "^ignored$" > .hgignore
115 $ echo "^ignored$" > .hgignore
114 $ hg ci -A -m 'initial checkin'
116 $ hg ci -A -m 'initial checkin'
115 adding .hgignore
117 adding .hgignore
116 adding deleted
118 adding deleted
117 adding modified
119 adding modified
118 adding removed
120 adding removed
119 $ touch modified added unknown ignored
121 $ touch modified added unknown ignored
120 $ hg add added
122 $ hg add added
121 $ hg remove removed
123 $ hg remove removed
122 $ rm deleted
124 $ rm deleted
123
125
124 hg status:
126 hg status:
125
127
126 $ hg status --color=always
128 $ hg status --color=always
127 \x1b[0;32;1mA added\x1b[0m (esc)
129 \x1b[0;32;1mA added\x1b[0m (esc)
128 \x1b[0;31;1mR removed\x1b[0m (esc)
130 \x1b[0;31;1mR removed\x1b[0m (esc)
129 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
131 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
130 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
132 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
131
133
132 hg status modified added removed deleted unknown never-existed ignored:
134 hg status modified added removed deleted unknown never-existed ignored:
133
135
134 $ hg status --color=always modified added removed deleted unknown never-existed ignored
136 $ hg status --color=always modified added removed deleted unknown never-existed ignored
135 never-existed: No such file or directory
137 never-existed: No such file or directory
136 \x1b[0;32;1mA added\x1b[0m (esc)
138 \x1b[0;32;1mA added\x1b[0m (esc)
137 \x1b[0;31;1mR removed\x1b[0m (esc)
139 \x1b[0;31;1mR removed\x1b[0m (esc)
138 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
140 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
139 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
141 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
140
142
141 $ hg copy modified copied
143 $ hg copy modified copied
142
144
143 hg status -C:
145 hg status -C:
144
146
145 $ hg status --color=always -C
147 $ hg status --color=always -C
146 \x1b[0;32;1mA added\x1b[0m (esc)
148 \x1b[0;32;1mA added\x1b[0m (esc)
147 \x1b[0;32;1mA copied\x1b[0m (esc)
149 \x1b[0;32;1mA copied\x1b[0m (esc)
148 \x1b[0;0m modified\x1b[0m (esc)
150 \x1b[0;0m modified\x1b[0m (esc)
149 \x1b[0;31;1mR removed\x1b[0m (esc)
151 \x1b[0;31;1mR removed\x1b[0m (esc)
150 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
152 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
151 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
153 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
152
154
153 hg status -A:
155 hg status -A:
154
156
155 $ hg status --color=always -A
157 $ hg status --color=always -A
156 \x1b[0;32;1mA added\x1b[0m (esc)
158 \x1b[0;32;1mA added\x1b[0m (esc)
157 \x1b[0;32;1mA copied\x1b[0m (esc)
159 \x1b[0;32;1mA copied\x1b[0m (esc)
158 \x1b[0;0m modified\x1b[0m (esc)
160 \x1b[0;0m modified\x1b[0m (esc)
159 \x1b[0;31;1mR removed\x1b[0m (esc)
161 \x1b[0;31;1mR removed\x1b[0m (esc)
160 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
162 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
161 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
163 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
162 \x1b[0;30;1mI ignored\x1b[0m (esc)
164 \x1b[0;30;1mI ignored\x1b[0m (esc)
163 \x1b[0;0mC .hgignore\x1b[0m (esc)
165 \x1b[0;0mC .hgignore\x1b[0m (esc)
164 \x1b[0;0mC modified\x1b[0m (esc)
166 \x1b[0;0mC modified\x1b[0m (esc)
165
167
166 hg status -A (with terminfo color):
168 hg status -A (with terminfo color):
167
169
168 $ TERM=xterm hg status --config color.mode=terminfo --color=always -A
170 $ TERM=xterm hg status --config color.mode=terminfo --color=always -A
169 \x1b(B\x1b[m\x1b[32m\x1b[1mA added\x1b(B\x1b[m (esc)
171 \x1b[30m\x1b[32m\x1b[1mA added\x1b[30m (esc)
170 \x1b(B\x1b[m\x1b[32m\x1b[1mA copied\x1b(B\x1b[m (esc)
172 \x1b[30m\x1b[32m\x1b[1mA copied\x1b[30m (esc)
171 \x1b(B\x1b[m\x1b(B\x1b[m modified\x1b(B\x1b[m (esc)
173 \x1b[30m\x1b[30m modified\x1b[30m (esc)
172 \x1b(B\x1b[m\x1b[31m\x1b[1mR removed\x1b(B\x1b[m (esc)
174 \x1b[30m\x1b[31m\x1b[1mR removed\x1b[30m (esc)
173 \x1b(B\x1b[m\x1b[36m\x1b[1m\x1b[4m! deleted\x1b(B\x1b[m (esc)
175 \x1b[30m\x1b[36m\x1b[1m\x1b[4m! deleted\x1b[30m (esc)
174 \x1b(B\x1b[m\x1b[35m\x1b[1m\x1b[4m? unknown\x1b(B\x1b[m (esc)
176 \x1b[30m\x1b[35m\x1b[1m\x1b[4m? unknown\x1b[30m (esc)
175 \x1b(B\x1b[m\x1b[30m\x1b[1mI ignored\x1b(B\x1b[m (esc)
177 \x1b[30m\x1b[30m\x1b[1mI ignored\x1b[30m (esc)
176 \x1b(B\x1b[m\x1b(B\x1b[mC .hgignore\x1b(B\x1b[m (esc)
178 \x1b[30m\x1b[30mC .hgignore\x1b[30m (esc)
177 \x1b(B\x1b[m\x1b(B\x1b[mC modified\x1b(B\x1b[m (esc)
179 \x1b[30m\x1b[30mC modified\x1b[30m (esc)
178
180
179
181
180 $ echo "^ignoreddir$" > .hgignore
182 $ echo "^ignoreddir$" > .hgignore
181 $ mkdir ignoreddir
183 $ mkdir ignoreddir
182 $ touch ignoreddir/file
184 $ touch ignoreddir/file
183
185
184 hg status ignoreddir/file:
186 hg status ignoreddir/file:
185
187
186 $ hg status --color=always ignoreddir/file
188 $ hg status --color=always ignoreddir/file
187
189
188 hg status -i ignoreddir/file:
190 hg status -i ignoreddir/file:
189
191
190 $ hg status --color=always -i ignoreddir/file
192 $ hg status --color=always -i ignoreddir/file
191 \x1b[0;30;1mI ignoreddir/file\x1b[0m (esc)
193 \x1b[0;30;1mI ignoreddir/file\x1b[0m (esc)
192 $ cd ..
194 $ cd ..
193
195
194 check 'status -q' and some combinations
196 check 'status -q' and some combinations
195
197
196 $ hg init repo3
198 $ hg init repo3
197 $ cd repo3
199 $ cd repo3
198 $ touch modified removed deleted ignored
200 $ touch modified removed deleted ignored
199 $ echo "^ignored$" > .hgignore
201 $ echo "^ignored$" > .hgignore
200 $ hg commit -A -m 'initial checkin'
202 $ hg commit -A -m 'initial checkin'
201 adding .hgignore
203 adding .hgignore
202 adding deleted
204 adding deleted
203 adding modified
205 adding modified
204 adding removed
206 adding removed
205 $ touch added unknown ignored
207 $ touch added unknown ignored
206 $ hg add added
208 $ hg add added
207 $ echo "test" >> modified
209 $ echo "test" >> modified
208 $ hg remove removed
210 $ hg remove removed
209 $ rm deleted
211 $ rm deleted
210 $ hg copy modified copied
212 $ hg copy modified copied
211
213
212 test unknown color
214 test unknown color
213
215
214 $ hg --config color.status.modified=periwinkle status --color=always
216 $ hg --config color.status.modified=periwinkle status --color=always
215 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
217 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
216 M modified
218 M modified
217 \x1b[0;32;1mA added\x1b[0m (esc)
219 \x1b[0;32;1mA added\x1b[0m (esc)
218 \x1b[0;32;1mA copied\x1b[0m (esc)
220 \x1b[0;32;1mA copied\x1b[0m (esc)
219 \x1b[0;31;1mR removed\x1b[0m (esc)
221 \x1b[0;31;1mR removed\x1b[0m (esc)
220 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
222 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
221 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
223 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
222
224
223 Run status with 2 different flags.
225 Run status with 2 different flags.
224 Check if result is the same or different.
226 Check if result is the same or different.
225 If result is not as expected, raise error
227 If result is not as expected, raise error
226
228
227 $ assert() {
229 $ assert() {
228 > hg status --color=always $1 > ../a
230 > hg status --color=always $1 > ../a
229 > hg status --color=always $2 > ../b
231 > hg status --color=always $2 > ../b
230 > if diff ../a ../b > /dev/null; then
232 > if diff ../a ../b > /dev/null; then
231 > out=0
233 > out=0
232 > else
234 > else
233 > out=1
235 > out=1
234 > fi
236 > fi
235 > if [ $3 -eq 0 ]; then
237 > if [ $3 -eq 0 ]; then
236 > df="same"
238 > df="same"
237 > else
239 > else
238 > df="different"
240 > df="different"
239 > fi
241 > fi
240 > if [ $out -ne $3 ]; then
242 > if [ $out -ne $3 ]; then
241 > echo "Error on $1 and $2, should be $df."
243 > echo "Error on $1 and $2, should be $df."
242 > fi
244 > fi
243 > }
245 > }
244
246
245 assert flag1 flag2 [0-same | 1-different]
247 assert flag1 flag2 [0-same | 1-different]
246
248
247 $ assert "-q" "-mard" 0
249 $ assert "-q" "-mard" 0
248 $ assert "-A" "-marduicC" 0
250 $ assert "-A" "-marduicC" 0
249 $ assert "-qA" "-mardcC" 0
251 $ assert "-qA" "-mardcC" 0
250 $ assert "-qAui" "-A" 0
252 $ assert "-qAui" "-A" 0
251 $ assert "-qAu" "-marducC" 0
253 $ assert "-qAu" "-marducC" 0
252 $ assert "-qAi" "-mardicC" 0
254 $ assert "-qAi" "-mardicC" 0
253 $ assert "-qu" "-u" 0
255 $ assert "-qu" "-u" 0
254 $ assert "-q" "-u" 1
256 $ assert "-q" "-u" 1
255 $ assert "-m" "-a" 1
257 $ assert "-m" "-a" 1
256 $ assert "-r" "-d" 1
258 $ assert "-r" "-d" 1
257 $ cd ..
259 $ cd ..
258
260
259 test 'resolve -l'
261 test 'resolve -l'
260
262
261 $ hg init repo4
263 $ hg init repo4
262 $ cd repo4
264 $ cd repo4
263 $ echo "file a" > a
265 $ echo "file a" > a
264 $ echo "file b" > b
266 $ echo "file b" > b
265 $ hg add a b
267 $ hg add a b
266 $ hg commit -m "initial"
268 $ hg commit -m "initial"
267 $ echo "file a change 1" > a
269 $ echo "file a change 1" > a
268 $ echo "file b change 1" > b
270 $ echo "file b change 1" > b
269 $ hg commit -m "head 1"
271 $ hg commit -m "head 1"
270 $ hg update 0
272 $ hg update 0
271 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
273 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 $ echo "file a change 2" > a
274 $ echo "file a change 2" > a
273 $ echo "file b change 2" > b
275 $ echo "file b change 2" > b
274 $ hg commit -m "head 2"
276 $ hg commit -m "head 2"
275 created new head
277 created new head
276 $ hg merge
278 $ hg merge
277 merging a
279 merging a
278 warning: conflicts during merge.
280 warning: conflicts during merge.
279 merging a failed!
281 merging a failed!
280 merging b
282 merging b
281 warning: conflicts during merge.
283 warning: conflicts during merge.
282 merging b failed!
284 merging b failed!
283 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
285 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
284 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
286 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
285 [1]
287 [1]
286 $ hg resolve -m b
288 $ hg resolve -m b
287
289
288 hg resolve with one unresolved, one resolved:
290 hg resolve with one unresolved, one resolved:
289
291
290 $ hg resolve --color=always -l
292 $ hg resolve --color=always -l
291 \x1b[0;31;1mU a\x1b[0m (esc)
293 \x1b[0;31;1mU a\x1b[0m (esc)
292 \x1b[0;32;1mR b\x1b[0m (esc)
294 \x1b[0;32;1mR b\x1b[0m (esc)
General Comments 0
You need to be logged in to leave comments. Login now