Show More
@@ -0,0 +1,156 b'' | |||||
|
1 | Tests of 'hg status --rev <rev>' to make sure status between <rev> and '.' get | |||
|
2 | combined correctly with the dirstate status. | |||
|
3 | ||||
|
4 | Sets up a history for a number of files where the filename describes the file's | |||
|
5 | history. The first two letters of the filename describe the first two commits; | |||
|
6 | the third letter describes the dirstate for the file. For example, a file called | |||
|
7 | 'amr' was added in the first commit, modified in the second and then removed in | |||
|
8 | the dirstate. | |||
|
9 | ||||
|
10 | These codes are used for commits: | |||
|
11 | x: does not exist | |||
|
12 | a: added | |||
|
13 | c: clean | |||
|
14 | m: modified | |||
|
15 | r: removed | |||
|
16 | ||||
|
17 | These codes are used for dirstate: | |||
|
18 | d: in dirstate, but deleted from disk | |||
|
19 | f: removed from dirstate, but file exists (forgotten) | |||
|
20 | r: removed from dirstate and disk | |||
|
21 | q: added, but deleted from disk (q for q-rious?) | |||
|
22 | u: not in dirstate, but file exists (unknown) | |||
|
23 | ||||
|
24 | $ hg init | |||
|
25 | $ touch .hgignore | |||
|
26 | $ hg add .hgignore | |||
|
27 | $ hg commit -m initial | |||
|
28 | ||||
|
29 | First letter: first commit | |||
|
30 | ||||
|
31 | $ echo a >acc | |||
|
32 | $ echo a >acd | |||
|
33 | $ echo a >acf | |||
|
34 | $ echo a >acm | |||
|
35 | $ echo a >acr | |||
|
36 | $ echo a >amc | |||
|
37 | $ echo a >amd | |||
|
38 | $ echo a >amf | |||
|
39 | $ echo a >amm | |||
|
40 | $ echo a >amr | |||
|
41 | $ echo a >ara | |||
|
42 | $ echo a >arq | |||
|
43 | $ echo a >aru | |||
|
44 | $ hg commit -Aqm first | |||
|
45 | ||||
|
46 | Second letter: second commit | |||
|
47 | ||||
|
48 | $ echo b >xad | |||
|
49 | $ echo b >xaf | |||
|
50 | $ echo b >xam | |||
|
51 | $ echo b >xar | |||
|
52 | $ echo b >amc | |||
|
53 | $ echo b >amd | |||
|
54 | $ echo b >amf | |||
|
55 | $ echo b >amm | |||
|
56 | $ echo b >amr | |||
|
57 | $ hg rm ara | |||
|
58 | $ hg rm arq | |||
|
59 | $ hg rm aru | |||
|
60 | $ hg commit -Aqm second | |||
|
61 | ||||
|
62 | Third letter: dirstate | |||
|
63 | ||||
|
64 | $ echo c >acm | |||
|
65 | $ echo c >amm | |||
|
66 | $ echo c >xam | |||
|
67 | $ echo c >ara && hg add ara | |||
|
68 | $ echo c >arq && hg add arq && rm arq | |||
|
69 | $ echo c >aru | |||
|
70 | $ hg rm amr | |||
|
71 | $ hg rm acr | |||
|
72 | $ hg rm xar | |||
|
73 | $ rm acd | |||
|
74 | $ rm amd | |||
|
75 | $ rm xad | |||
|
76 | $ hg forget acf | |||
|
77 | $ hg forget amf | |||
|
78 | $ hg forget xaf | |||
|
79 | $ touch xxu | |||
|
80 | ||||
|
81 | Status compared to one revision back | |||
|
82 | ||||
|
83 | $ hg status -A --rev 1 acc | |||
|
84 | C acc | |||
|
85 | BROKEN: file appears twice; should be '!' | |||
|
86 | $ hg status -A --rev 1 acd | |||
|
87 | ! acd | |||
|
88 | C acd | |||
|
89 | $ hg status -A --rev 1 acf | |||
|
90 | R acf | |||
|
91 | $ hg status -A --rev 1 acm | |||
|
92 | M acm | |||
|
93 | $ hg status -A --rev 1 acr | |||
|
94 | R acr | |||
|
95 | $ hg status -A --rev 1 amc | |||
|
96 | M amc | |||
|
97 | BROKEN: file appears twice; should be '!' | |||
|
98 | $ hg status -A --rev 1 amd | |||
|
99 | ! amd | |||
|
100 | C amd | |||
|
101 | $ hg status -A --rev 1 amf | |||
|
102 | R amf | |||
|
103 | $ hg status -A --rev 1 amm | |||
|
104 | M amm | |||
|
105 | $ hg status -A --rev 1 amr | |||
|
106 | R amr | |||
|
107 | $ hg status -A --rev 1 ara | |||
|
108 | M ara | |||
|
109 | BROKEN: file appears twice; should be '!' | |||
|
110 | $ hg status -A --rev 1 arq | |||
|
111 | R arq | |||
|
112 | ! arq | |||
|
113 | $ hg status -A --rev 1 aru | |||
|
114 | R aru | |||
|
115 | $ hg status -A --rev 1 xad | |||
|
116 | ! xad | |||
|
117 | $ hg status -A --rev 1 xaf | |||
|
118 | $ hg status -A --rev 1 xam | |||
|
119 | A xam | |||
|
120 | $ hg status -A --rev 1 xar | |||
|
121 | $ hg status -A --rev 1 xxu | |||
|
122 | ? xxu | |||
|
123 | ||||
|
124 | Status compared to two revisions back | |||
|
125 | ||||
|
126 | $ hg status -A --rev 0 acc | |||
|
127 | A acc | |||
|
128 | $ hg status -A --rev 0 acd | |||
|
129 | ! acd | |||
|
130 | BROKEN: file exists, so should be listed (as '?') | |||
|
131 | $ hg status -A --rev 0 acf | |||
|
132 | $ hg status -A --rev 0 acm | |||
|
133 | A acm | |||
|
134 | $ hg status -A --rev 0 acr | |||
|
135 | $ hg status -A --rev 0 amc | |||
|
136 | A amc | |||
|
137 | $ hg status -A --rev 0 amd | |||
|
138 | ! amd | |||
|
139 | BROKEN: file exists, so should be listed (as '?') | |||
|
140 | $ hg status -A --rev 0 amf | |||
|
141 | $ hg status -A --rev 0 amm | |||
|
142 | A amm | |||
|
143 | $ hg status -A --rev 0 amr | |||
|
144 | $ hg status -A --rev 0 ara | |||
|
145 | A ara | |||
|
146 | $ hg status -A --rev 0 arq | |||
|
147 | ! arq | |||
|
148 | $ hg status -A --rev 0 aru | |||
|
149 | ? aru | |||
|
150 | $ hg status -A --rev 0 xad | |||
|
151 | ! xad | |||
|
152 | BROKEN: file exists, so should be listed (as '?') | |||
|
153 | $ hg status -A --rev 0 xaf | |||
|
154 | $ hg status -A --rev 0 xam | |||
|
155 | A xam | |||
|
156 | $ hg status -A --rev 0 xar |
@@ -1,405 +1,392 b'' | |||||
1 | $ hg init repo1 |
|
1 | $ hg init repo1 | |
2 | $ cd repo1 |
|
2 | $ cd repo1 | |
3 | $ mkdir a b a/1 b/1 b/2 |
|
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 |
|
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 |
|
5 | |||
6 | hg status in repo root: |
|
6 | hg status in repo root: | |
7 |
|
7 | |||
8 | $ hg status |
|
8 | $ hg status | |
9 | ? a/1/in_a_1 |
|
9 | ? a/1/in_a_1 | |
10 | ? a/in_a |
|
10 | ? a/in_a | |
11 | ? b/1/in_b_1 |
|
11 | ? b/1/in_b_1 | |
12 | ? b/2/in_b_2 |
|
12 | ? b/2/in_b_2 | |
13 | ? b/in_b |
|
13 | ? b/in_b | |
14 | ? in_root |
|
14 | ? in_root | |
15 |
|
15 | |||
16 | hg status . in repo root: |
|
16 | hg status . in repo root: | |
17 |
|
17 | |||
18 | $ hg status . |
|
18 | $ hg status . | |
19 | ? a/1/in_a_1 |
|
19 | ? a/1/in_a_1 | |
20 | ? a/in_a |
|
20 | ? a/in_a | |
21 | ? b/1/in_b_1 |
|
21 | ? b/1/in_b_1 | |
22 | ? b/2/in_b_2 |
|
22 | ? b/2/in_b_2 | |
23 | ? b/in_b |
|
23 | ? b/in_b | |
24 | ? in_root |
|
24 | ? in_root | |
25 |
|
25 | |||
26 | $ hg status --cwd a |
|
26 | $ hg status --cwd a | |
27 | ? a/1/in_a_1 |
|
27 | ? a/1/in_a_1 | |
28 | ? a/in_a |
|
28 | ? a/in_a | |
29 | ? b/1/in_b_1 |
|
29 | ? b/1/in_b_1 | |
30 | ? b/2/in_b_2 |
|
30 | ? b/2/in_b_2 | |
31 | ? b/in_b |
|
31 | ? b/in_b | |
32 | ? in_root |
|
32 | ? in_root | |
33 | $ hg status --cwd a . |
|
33 | $ hg status --cwd a . | |
34 | ? 1/in_a_1 |
|
34 | ? 1/in_a_1 | |
35 | ? in_a |
|
35 | ? in_a | |
36 | $ hg status --cwd a .. |
|
36 | $ hg status --cwd a .. | |
37 | ? 1/in_a_1 |
|
37 | ? 1/in_a_1 | |
38 | ? in_a |
|
38 | ? in_a | |
39 | ? ../b/1/in_b_1 |
|
39 | ? ../b/1/in_b_1 | |
40 | ? ../b/2/in_b_2 |
|
40 | ? ../b/2/in_b_2 | |
41 | ? ../b/in_b |
|
41 | ? ../b/in_b | |
42 | ? ../in_root |
|
42 | ? ../in_root | |
43 |
|
43 | |||
44 | $ hg status --cwd b |
|
44 | $ hg status --cwd b | |
45 | ? a/1/in_a_1 |
|
45 | ? a/1/in_a_1 | |
46 | ? a/in_a |
|
46 | ? a/in_a | |
47 | ? b/1/in_b_1 |
|
47 | ? b/1/in_b_1 | |
48 | ? b/2/in_b_2 |
|
48 | ? b/2/in_b_2 | |
49 | ? b/in_b |
|
49 | ? b/in_b | |
50 | ? in_root |
|
50 | ? in_root | |
51 | $ hg status --cwd b . |
|
51 | $ hg status --cwd b . | |
52 | ? 1/in_b_1 |
|
52 | ? 1/in_b_1 | |
53 | ? 2/in_b_2 |
|
53 | ? 2/in_b_2 | |
54 | ? in_b |
|
54 | ? in_b | |
55 | $ hg status --cwd b .. |
|
55 | $ hg status --cwd b .. | |
56 | ? ../a/1/in_a_1 |
|
56 | ? ../a/1/in_a_1 | |
57 | ? ../a/in_a |
|
57 | ? ../a/in_a | |
58 | ? 1/in_b_1 |
|
58 | ? 1/in_b_1 | |
59 | ? 2/in_b_2 |
|
59 | ? 2/in_b_2 | |
60 | ? in_b |
|
60 | ? in_b | |
61 | ? ../in_root |
|
61 | ? ../in_root | |
62 |
|
62 | |||
63 | $ hg status --cwd a/1 |
|
63 | $ hg status --cwd a/1 | |
64 | ? a/1/in_a_1 |
|
64 | ? a/1/in_a_1 | |
65 | ? a/in_a |
|
65 | ? a/in_a | |
66 | ? b/1/in_b_1 |
|
66 | ? b/1/in_b_1 | |
67 | ? b/2/in_b_2 |
|
67 | ? b/2/in_b_2 | |
68 | ? b/in_b |
|
68 | ? b/in_b | |
69 | ? in_root |
|
69 | ? in_root | |
70 | $ hg status --cwd a/1 . |
|
70 | $ hg status --cwd a/1 . | |
71 | ? in_a_1 |
|
71 | ? in_a_1 | |
72 | $ hg status --cwd a/1 .. |
|
72 | $ hg status --cwd a/1 .. | |
73 | ? in_a_1 |
|
73 | ? in_a_1 | |
74 | ? ../in_a |
|
74 | ? ../in_a | |
75 |
|
75 | |||
76 | $ hg status --cwd b/1 |
|
76 | $ hg status --cwd b/1 | |
77 | ? a/1/in_a_1 |
|
77 | ? a/1/in_a_1 | |
78 | ? a/in_a |
|
78 | ? a/in_a | |
79 | ? b/1/in_b_1 |
|
79 | ? b/1/in_b_1 | |
80 | ? b/2/in_b_2 |
|
80 | ? b/2/in_b_2 | |
81 | ? b/in_b |
|
81 | ? b/in_b | |
82 | ? in_root |
|
82 | ? in_root | |
83 | $ hg status --cwd b/1 . |
|
83 | $ hg status --cwd b/1 . | |
84 | ? in_b_1 |
|
84 | ? in_b_1 | |
85 | $ hg status --cwd b/1 .. |
|
85 | $ hg status --cwd b/1 .. | |
86 | ? in_b_1 |
|
86 | ? in_b_1 | |
87 | ? ../2/in_b_2 |
|
87 | ? ../2/in_b_2 | |
88 | ? ../in_b |
|
88 | ? ../in_b | |
89 |
|
89 | |||
90 | $ hg status --cwd b/2 |
|
90 | $ hg status --cwd b/2 | |
91 | ? a/1/in_a_1 |
|
91 | ? a/1/in_a_1 | |
92 | ? a/in_a |
|
92 | ? a/in_a | |
93 | ? b/1/in_b_1 |
|
93 | ? b/1/in_b_1 | |
94 | ? b/2/in_b_2 |
|
94 | ? b/2/in_b_2 | |
95 | ? b/in_b |
|
95 | ? b/in_b | |
96 | ? in_root |
|
96 | ? in_root | |
97 | $ hg status --cwd b/2 . |
|
97 | $ hg status --cwd b/2 . | |
98 | ? in_b_2 |
|
98 | ? in_b_2 | |
99 | $ hg status --cwd b/2 .. |
|
99 | $ hg status --cwd b/2 .. | |
100 | ? ../1/in_b_1 |
|
100 | ? ../1/in_b_1 | |
101 | ? in_b_2 |
|
101 | ? in_b_2 | |
102 | ? ../in_b |
|
102 | ? ../in_b | |
103 |
|
103 | |||
104 | combining patterns with root and patterns without a root works |
|
104 | combining patterns with root and patterns without a root works | |
105 |
|
105 | |||
106 | $ hg st a/in_a re:.*b$ |
|
106 | $ hg st a/in_a re:.*b$ | |
107 | ? a/in_a |
|
107 | ? a/in_a | |
108 | ? b/in_b |
|
108 | ? b/in_b | |
109 |
|
109 | |||
110 | $ cd .. |
|
110 | $ cd .. | |
111 |
|
111 | |||
112 | $ hg init repo2 |
|
112 | $ hg init repo2 | |
113 | $ cd repo2 |
|
113 | $ cd repo2 | |
114 | $ touch modified removed deleted ignored |
|
114 | $ touch modified removed deleted ignored | |
115 | $ echo "^ignored$" > .hgignore |
|
115 | $ echo "^ignored$" > .hgignore | |
116 | $ hg ci -A -m 'initial checkin' |
|
116 | $ hg ci -A -m 'initial checkin' | |
117 | adding .hgignore |
|
117 | adding .hgignore | |
118 | adding deleted |
|
118 | adding deleted | |
119 | adding modified |
|
119 | adding modified | |
120 | adding removed |
|
120 | adding removed | |
121 | $ touch modified added unknown ignored |
|
121 | $ touch modified added unknown ignored | |
122 | $ hg add added |
|
122 | $ hg add added | |
123 | $ hg remove removed |
|
123 | $ hg remove removed | |
124 | $ rm deleted |
|
124 | $ rm deleted | |
125 |
|
125 | |||
126 | hg status: |
|
126 | hg status: | |
127 |
|
127 | |||
128 | $ hg status |
|
128 | $ hg status | |
129 | A added |
|
129 | A added | |
130 | R removed |
|
130 | R removed | |
131 | ! deleted |
|
131 | ! deleted | |
132 | ? unknown |
|
132 | ? unknown | |
133 |
|
133 | |||
134 | hg status modified added removed deleted unknown never-existed ignored: |
|
134 | hg status modified added removed deleted unknown never-existed ignored: | |
135 |
|
135 | |||
136 | $ hg status modified added removed deleted unknown never-existed ignored |
|
136 | $ hg status modified added removed deleted unknown never-existed ignored | |
137 | never-existed: * (glob) |
|
137 | never-existed: * (glob) | |
138 | A added |
|
138 | A added | |
139 | R removed |
|
139 | R removed | |
140 | ! deleted |
|
140 | ! deleted | |
141 | ? unknown |
|
141 | ? unknown | |
142 |
|
142 | |||
143 | $ hg copy modified copied |
|
143 | $ hg copy modified copied | |
144 |
|
144 | |||
145 | hg status -C: |
|
145 | hg status -C: | |
146 |
|
146 | |||
147 | $ hg status -C |
|
147 | $ hg status -C | |
148 | A added |
|
148 | A added | |
149 | A copied |
|
149 | A copied | |
150 | modified |
|
150 | modified | |
151 | R removed |
|
151 | R removed | |
152 | ! deleted |
|
152 | ! deleted | |
153 | ? unknown |
|
153 | ? unknown | |
154 |
|
154 | |||
155 | hg status -A: |
|
155 | hg status -A: | |
156 |
|
156 | |||
157 | $ hg status -A |
|
157 | $ hg status -A | |
158 | A added |
|
158 | A added | |
159 | A copied |
|
159 | A copied | |
160 | modified |
|
160 | modified | |
161 | R removed |
|
161 | R removed | |
162 | ! deleted |
|
162 | ! deleted | |
163 | ? unknown |
|
163 | ? unknown | |
164 | I ignored |
|
164 | I ignored | |
165 | C .hgignore |
|
165 | C .hgignore | |
166 | C modified |
|
166 | C modified | |
167 |
|
167 | |||
168 | $ hg status -A -Tjson |
|
168 | $ hg status -A -Tjson | |
169 | [ |
|
169 | [ | |
170 | { |
|
170 | { | |
171 | "path": "added", |
|
171 | "path": "added", | |
172 | "status": "A" |
|
172 | "status": "A" | |
173 | }, |
|
173 | }, | |
174 | { |
|
174 | { | |
175 | "copy": "modified", |
|
175 | "copy": "modified", | |
176 | "path": "copied", |
|
176 | "path": "copied", | |
177 | "status": "A" |
|
177 | "status": "A" | |
178 | }, |
|
178 | }, | |
179 | { |
|
179 | { | |
180 | "path": "removed", |
|
180 | "path": "removed", | |
181 | "status": "R" |
|
181 | "status": "R" | |
182 | }, |
|
182 | }, | |
183 | { |
|
183 | { | |
184 | "path": "deleted", |
|
184 | "path": "deleted", | |
185 | "status": "!" |
|
185 | "status": "!" | |
186 | }, |
|
186 | }, | |
187 | { |
|
187 | { | |
188 | "path": "unknown", |
|
188 | "path": "unknown", | |
189 | "status": "?" |
|
189 | "status": "?" | |
190 | }, |
|
190 | }, | |
191 | { |
|
191 | { | |
192 | "path": "ignored", |
|
192 | "path": "ignored", | |
193 | "status": "I" |
|
193 | "status": "I" | |
194 | }, |
|
194 | }, | |
195 | { |
|
195 | { | |
196 | "path": ".hgignore", |
|
196 | "path": ".hgignore", | |
197 | "status": "C" |
|
197 | "status": "C" | |
198 | }, |
|
198 | }, | |
199 | { |
|
199 | { | |
200 | "path": "modified", |
|
200 | "path": "modified", | |
201 | "status": "C" |
|
201 | "status": "C" | |
202 | } |
|
202 | } | |
203 | ] |
|
203 | ] | |
204 |
|
204 | |||
205 | $ hg status -A -Tpickle > pickle |
|
205 | $ hg status -A -Tpickle > pickle | |
206 | >>> import pickle |
|
206 | >>> import pickle | |
207 | >>> print sorted((x['status'], x['path']) for x in pickle.load(open("pickle"))) |
|
207 | >>> print sorted((x['status'], x['path']) for x in pickle.load(open("pickle"))) | |
208 | [('!', 'deleted'), ('?', 'pickle'), ('?', 'unknown'), ('A', 'added'), ('A', 'copied'), ('C', '.hgignore'), ('C', 'modified'), ('I', 'ignored'), ('R', 'removed')] |
|
208 | [('!', 'deleted'), ('?', 'pickle'), ('?', 'unknown'), ('A', 'added'), ('A', 'copied'), ('C', '.hgignore'), ('C', 'modified'), ('I', 'ignored'), ('R', 'removed')] | |
209 | $ rm pickle |
|
209 | $ rm pickle | |
210 |
|
210 | |||
211 | $ echo "^ignoreddir$" > .hgignore |
|
211 | $ echo "^ignoreddir$" > .hgignore | |
212 | $ mkdir ignoreddir |
|
212 | $ mkdir ignoreddir | |
213 | $ touch ignoreddir/file |
|
213 | $ touch ignoreddir/file | |
214 |
|
214 | |||
215 | hg status ignoreddir/file: |
|
215 | hg status ignoreddir/file: | |
216 |
|
216 | |||
217 | $ hg status ignoreddir/file |
|
217 | $ hg status ignoreddir/file | |
218 |
|
218 | |||
219 | hg status -i ignoreddir/file: |
|
219 | hg status -i ignoreddir/file: | |
220 |
|
220 | |||
221 | $ hg status -i ignoreddir/file |
|
221 | $ hg status -i ignoreddir/file | |
222 | I ignoreddir/file |
|
222 | I ignoreddir/file | |
223 | $ cd .. |
|
223 | $ cd .. | |
224 |
|
224 | |||
225 | Check 'status -q' and some combinations |
|
225 | Check 'status -q' and some combinations | |
226 |
|
226 | |||
227 | $ hg init repo3 |
|
227 | $ hg init repo3 | |
228 | $ cd repo3 |
|
228 | $ cd repo3 | |
229 | $ touch modified removed deleted ignored |
|
229 | $ touch modified removed deleted ignored | |
230 | $ echo "^ignored$" > .hgignore |
|
230 | $ echo "^ignored$" > .hgignore | |
231 | $ hg commit -A -m 'initial checkin' |
|
231 | $ hg commit -A -m 'initial checkin' | |
232 | adding .hgignore |
|
232 | adding .hgignore | |
233 | adding deleted |
|
233 | adding deleted | |
234 | adding modified |
|
234 | adding modified | |
235 | adding removed |
|
235 | adding removed | |
236 | $ touch added unknown ignored |
|
236 | $ touch added unknown ignored | |
237 | $ hg add added |
|
237 | $ hg add added | |
238 | $ echo "test" >> modified |
|
238 | $ echo "test" >> modified | |
239 | $ hg remove removed |
|
239 | $ hg remove removed | |
240 | $ rm deleted |
|
240 | $ rm deleted | |
241 | $ hg copy modified copied |
|
241 | $ hg copy modified copied | |
242 |
|
242 | |||
243 | Run status with 2 different flags. |
|
243 | Run status with 2 different flags. | |
244 | Check if result is the same or different. |
|
244 | Check if result is the same or different. | |
245 | If result is not as expected, raise error |
|
245 | If result is not as expected, raise error | |
246 |
|
246 | |||
247 | $ assert() { |
|
247 | $ assert() { | |
248 | > hg status $1 > ../a |
|
248 | > hg status $1 > ../a | |
249 | > hg status $2 > ../b |
|
249 | > hg status $2 > ../b | |
250 | > if diff ../a ../b > /dev/null; then |
|
250 | > if diff ../a ../b > /dev/null; then | |
251 | > out=0 |
|
251 | > out=0 | |
252 | > else |
|
252 | > else | |
253 | > out=1 |
|
253 | > out=1 | |
254 | > fi |
|
254 | > fi | |
255 | > if [ $3 -eq 0 ]; then |
|
255 | > if [ $3 -eq 0 ]; then | |
256 | > df="same" |
|
256 | > df="same" | |
257 | > else |
|
257 | > else | |
258 | > df="different" |
|
258 | > df="different" | |
259 | > fi |
|
259 | > fi | |
260 | > if [ $out -ne $3 ]; then |
|
260 | > if [ $out -ne $3 ]; then | |
261 | > echo "Error on $1 and $2, should be $df." |
|
261 | > echo "Error on $1 and $2, should be $df." | |
262 | > fi |
|
262 | > fi | |
263 | > } |
|
263 | > } | |
264 |
|
264 | |||
265 | Assert flag1 flag2 [0-same | 1-different] |
|
265 | Assert flag1 flag2 [0-same | 1-different] | |
266 |
|
266 | |||
267 | $ assert "-q" "-mard" 0 |
|
267 | $ assert "-q" "-mard" 0 | |
268 | $ assert "-A" "-marduicC" 0 |
|
268 | $ assert "-A" "-marduicC" 0 | |
269 | $ assert "-qA" "-mardcC" 0 |
|
269 | $ assert "-qA" "-mardcC" 0 | |
270 | $ assert "-qAui" "-A" 0 |
|
270 | $ assert "-qAui" "-A" 0 | |
271 | $ assert "-qAu" "-marducC" 0 |
|
271 | $ assert "-qAu" "-marducC" 0 | |
272 | $ assert "-qAi" "-mardicC" 0 |
|
272 | $ assert "-qAi" "-mardicC" 0 | |
273 | $ assert "-qu" "-u" 0 |
|
273 | $ assert "-qu" "-u" 0 | |
274 | $ assert "-q" "-u" 1 |
|
274 | $ assert "-q" "-u" 1 | |
275 | $ assert "-m" "-a" 1 |
|
275 | $ assert "-m" "-a" 1 | |
276 | $ assert "-r" "-d" 1 |
|
276 | $ assert "-r" "-d" 1 | |
277 | $ cd .. |
|
277 | $ cd .. | |
278 |
|
278 | |||
279 | $ hg init repo4 |
|
279 | $ hg init repo4 | |
280 | $ cd repo4 |
|
280 | $ cd repo4 | |
281 | $ touch modified removed deleted |
|
281 | $ touch modified removed deleted | |
282 | $ hg ci -q -A -m 'initial checkin' |
|
282 | $ hg ci -q -A -m 'initial checkin' | |
283 | $ touch added unknown |
|
283 | $ touch added unknown | |
284 | $ hg add added |
|
284 | $ hg add added | |
285 | $ hg remove removed |
|
285 | $ hg remove removed | |
286 | $ rm deleted |
|
286 | $ rm deleted | |
287 | $ echo x > modified |
|
287 | $ echo x > modified | |
288 | $ hg copy modified copied |
|
288 | $ hg copy modified copied | |
289 | $ hg ci -m 'test checkin' -d "1000001 0" |
|
289 | $ hg ci -m 'test checkin' -d "1000001 0" | |
290 | $ rm * |
|
290 | $ rm * | |
291 | $ touch unrelated |
|
291 | $ touch unrelated | |
292 | $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0" |
|
292 | $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0" | |
293 |
|
293 | |||
294 | hg status --change 1: |
|
294 | hg status --change 1: | |
295 |
|
295 | |||
296 | $ hg status --change 1 |
|
296 | $ hg status --change 1 | |
297 | M modified |
|
297 | M modified | |
298 | A added |
|
298 | A added | |
299 | A copied |
|
299 | A copied | |
300 | R removed |
|
300 | R removed | |
301 |
|
301 | |||
302 | hg status --change 1 unrelated: |
|
302 | hg status --change 1 unrelated: | |
303 |
|
303 | |||
304 | $ hg status --change 1 unrelated |
|
304 | $ hg status --change 1 unrelated | |
305 |
|
305 | |||
306 | hg status -C --change 1 added modified copied removed deleted: |
|
306 | hg status -C --change 1 added modified copied removed deleted: | |
307 |
|
307 | |||
308 | $ hg status -C --change 1 added modified copied removed deleted |
|
308 | $ hg status -C --change 1 added modified copied removed deleted | |
309 | M modified |
|
309 | M modified | |
310 | A added |
|
310 | A added | |
311 | A copied |
|
311 | A copied | |
312 | modified |
|
312 | modified | |
313 | R removed |
|
313 | R removed | |
314 |
|
314 | |||
315 | hg status -A --change 1 and revset: |
|
315 | hg status -A --change 1 and revset: | |
316 |
|
316 | |||
317 | $ hg status -A --change '1|1' |
|
317 | $ hg status -A --change '1|1' | |
318 | M modified |
|
318 | M modified | |
319 | A added |
|
319 | A added | |
320 | A copied |
|
320 | A copied | |
321 | modified |
|
321 | modified | |
322 | R removed |
|
322 | R removed | |
323 | C deleted |
|
323 | C deleted | |
324 |
|
324 | |||
325 | status against non-parent with unknown file (issue4321) |
|
|||
326 |
|
||||
327 | $ touch unknown |
|
|||
328 | $ hg status --rev 0 unknown |
|
|||
329 | ? unknown |
|
|||
330 |
|
||||
331 | status of removed but existing in working directory. "? removed" should |
|
|||
332 | not be included: |
|
|||
333 |
|
||||
334 | $ touch removed |
|
|||
335 | $ hg status --rev 0 removed |
|
|||
336 | R removed |
|
|||
337 |
|
||||
338 | $ cd .. |
|
325 | $ cd .. | |
339 |
|
326 | |||
340 | hg status of binary file starting with '\1\n', a separator for metadata: |
|
327 | hg status of binary file starting with '\1\n', a separator for metadata: | |
341 |
|
328 | |||
342 | $ hg init repo5 |
|
329 | $ hg init repo5 | |
343 | $ cd repo5 |
|
330 | $ cd repo5 | |
344 | >>> open("010a", "wb").write("\1\nfoo") |
|
331 | >>> open("010a", "wb").write("\1\nfoo") | |
345 | $ hg ci -q -A -m 'initial checkin' |
|
332 | $ hg ci -q -A -m 'initial checkin' | |
346 | $ hg status -A |
|
333 | $ hg status -A | |
347 | C 010a |
|
334 | C 010a | |
348 |
|
335 | |||
349 | >>> open("010a", "wb").write("\1\nbar") |
|
336 | >>> open("010a", "wb").write("\1\nbar") | |
350 | $ hg status -A |
|
337 | $ hg status -A | |
351 | M 010a |
|
338 | M 010a | |
352 | $ hg ci -q -m 'modify 010a' |
|
339 | $ hg ci -q -m 'modify 010a' | |
353 | $ hg status -A --rev 0:1 |
|
340 | $ hg status -A --rev 0:1 | |
354 | M 010a |
|
341 | M 010a | |
355 |
|
342 | |||
356 | $ touch empty |
|
343 | $ touch empty | |
357 | $ hg ci -q -A -m 'add another file' |
|
344 | $ hg ci -q -A -m 'add another file' | |
358 | $ hg status -A --rev 1:2 010a |
|
345 | $ hg status -A --rev 1:2 010a | |
359 | C 010a |
|
346 | C 010a | |
360 |
|
347 | |||
361 | $ cd .. |
|
348 | $ cd .. | |
362 |
|
349 | |||
363 | test "hg status" with "directory pattern" which matches against files |
|
350 | test "hg status" with "directory pattern" which matches against files | |
364 | only known on target revision. |
|
351 | only known on target revision. | |
365 |
|
352 | |||
366 | $ hg init repo6 |
|
353 | $ hg init repo6 | |
367 | $ cd repo6 |
|
354 | $ cd repo6 | |
368 |
|
355 | |||
369 | $ echo a > a.txt |
|
356 | $ echo a > a.txt | |
370 | $ hg add a.txt |
|
357 | $ hg add a.txt | |
371 | $ hg commit -m '#0' |
|
358 | $ hg commit -m '#0' | |
372 | $ mkdir -p 1/2/3/4/5 |
|
359 | $ mkdir -p 1/2/3/4/5 | |
373 | $ echo b > 1/2/3/4/5/b.txt |
|
360 | $ echo b > 1/2/3/4/5/b.txt | |
374 | $ hg add 1/2/3/4/5/b.txt |
|
361 | $ hg add 1/2/3/4/5/b.txt | |
375 | $ hg commit -m '#1' |
|
362 | $ hg commit -m '#1' | |
376 |
|
363 | |||
377 | $ hg update -C 0 > /dev/null |
|
364 | $ hg update -C 0 > /dev/null | |
378 | $ hg status -A |
|
365 | $ hg status -A | |
379 | C a.txt |
|
366 | C a.txt | |
380 |
|
367 | |||
381 | the directory matching against specified pattern should be removed, |
|
368 | the directory matching against specified pattern should be removed, | |
382 | because directory existence prevents 'dirstate.walk()' from showing |
|
369 | because directory existence prevents 'dirstate.walk()' from showing | |
383 | warning message about such pattern. |
|
370 | warning message about such pattern. | |
384 |
|
371 | |||
385 | $ test ! -d 1 |
|
372 | $ test ! -d 1 | |
386 | $ hg status -A --rev 1 1/2/3/4/5/b.txt |
|
373 | $ hg status -A --rev 1 1/2/3/4/5/b.txt | |
387 | R 1/2/3/4/5/b.txt |
|
374 | R 1/2/3/4/5/b.txt | |
388 | $ hg status -A --rev 1 1/2/3/4/5 |
|
375 | $ hg status -A --rev 1 1/2/3/4/5 | |
389 | R 1/2/3/4/5/b.txt |
|
376 | R 1/2/3/4/5/b.txt | |
390 | $ hg status -A --rev 1 1/2/3 |
|
377 | $ hg status -A --rev 1 1/2/3 | |
391 | R 1/2/3/4/5/b.txt |
|
378 | R 1/2/3/4/5/b.txt | |
392 | $ hg status -A --rev 1 1 |
|
379 | $ hg status -A --rev 1 1 | |
393 | R 1/2/3/4/5/b.txt |
|
380 | R 1/2/3/4/5/b.txt | |
394 |
|
381 | |||
395 | $ hg status --config ui.formatdebug=True --rev 1 1 |
|
382 | $ hg status --config ui.formatdebug=True --rev 1 1 | |
396 | status = [ |
|
383 | status = [ | |
397 | {*'path': '1/2/3/4/5/b.txt'*}, (glob) |
|
384 | {*'path': '1/2/3/4/5/b.txt'*}, (glob) | |
398 | ] |
|
385 | ] | |
399 |
|
386 | |||
400 | #if windows |
|
387 | #if windows | |
401 | $ hg --config ui.slash=false status -A --rev 1 1 |
|
388 | $ hg --config ui.slash=false status -A --rev 1 1 | |
402 | R 1\2\3\4\5\b.txt |
|
389 | R 1\2\3\4\5\b.txt | |
403 | #endif |
|
390 | #endif | |
404 |
|
391 | |||
405 | $ cd .. |
|
392 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now