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