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