Show More
This diff has been collapsed as it changes many lines, (778 lines changed) Show them Hide them | |||||
@@ -1,244 +1,584 b'' | |||||
1 | #!/bin/sh |
|
1 | $ rm -rf sub | |
|
2 | $ mkdir sub | |||
|
3 | $ cd sub | |||
|
4 | $ hg init t | |||
|
5 | $ cd t | |||
|
6 | ||||
|
7 | first revision, no sub | |||
|
8 | ||||
|
9 | $ echo a > a | |||
|
10 | $ hg ci -Am0 | |||
|
11 | adding a | |||
2 |
|
12 | |||
3 | rm -rf sub |
|
13 | add first sub | |
4 | mkdir sub |
|
|||
5 | cd sub |
|
|||
6 | hg init t |
|
|||
7 | cd t |
|
|||
8 |
|
14 | |||
9 | echo % first revision, no sub |
|
15 | $ echo s = s > .hgsub | |
10 | echo a > a |
|
16 | $ hg add .hgsub | |
11 | hg ci -Am0 |
|
17 | $ hg init s | |
|
18 | $ echo a > s/a | |||
|
19 | ||||
|
20 | issue2232 - committing a subrepo without .hgsub | |||
|
21 | ||||
|
22 | $ hg ci -mbad s | |||
|
23 | abort: can't commit subrepos without .hgsub | |||
12 |
|
24 | |||
13 | echo % add first sub |
|
25 | $ hg -R s ci -Ams0 | |
14 | echo s = s > .hgsub |
|
26 | adding a | |
15 | hg add .hgsub |
|
27 | $ hg sum | |
16 | hg init s |
|
28 | parent: 0:f7b1eb17ad24 tip | |
17 | echo a > s/a |
|
29 | 0 | |
|
30 | branch: default | |||
|
31 | commit: 1 added, 1 subrepos | |||
|
32 | update: (current) | |||
|
33 | $ hg ci -m1 | |||
|
34 | committing subrepository s | |||
|
35 | ||||
|
36 | issue 2022 - update -C | |||
18 |
|
37 | |||
19 | # issue2232 - committing a subrepo without .hgsub |
|
38 | $ echo b > s/a | |
20 | hg ci -mbad s |
|
39 | $ hg sum | |
|
40 | parent: 1:7cf8cfea66e4 tip | |||
|
41 | 1 | |||
|
42 | branch: default | |||
|
43 | commit: 1 subrepos | |||
|
44 | update: (current) | |||
|
45 | $ hg co -C 1 | |||
|
46 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
47 | $ hg sum | |||
|
48 | parent: 1:7cf8cfea66e4 tip | |||
|
49 | 1 | |||
|
50 | branch: default | |||
|
51 | commit: (clean) | |||
|
52 | update: (current) | |||
21 |
|
53 | |||
22 | hg -R s ci -Ams0 |
|
54 | add sub sub | |
23 | hg sum |
|
|||
24 | hg ci -m1 |
|
|||
25 |
|
55 | |||
26 | # issue 2022 - update -C |
|
56 | $ echo ss = ss > s/.hgsub | |
27 | echo b > s/a |
|
57 | $ hg init s/ss | |
28 | hg sum |
|
58 | $ echo a > s/ss/a | |
29 | hg co -C 1 |
|
59 | $ hg -R s add s/.hgsub | |
30 | hg sum |
|
60 | $ hg -R s/ss add s/ss/a | |
|
61 | $ hg sum | |||
|
62 | parent: 1:7cf8cfea66e4 tip | |||
|
63 | 1 | |||
|
64 | branch: default | |||
|
65 | commit: 1 subrepos | |||
|
66 | update: (current) | |||
|
67 | $ hg ci -m2 | |||
|
68 | committing subrepository s | |||
|
69 | committing subrepository s/ss | |||
|
70 | $ hg sum | |||
|
71 | parent: 2:df30734270ae tip | |||
|
72 | 2 | |||
|
73 | branch: default | |||
|
74 | commit: (clean) | |||
|
75 | update: (current) | |||
31 |
|
76 | |||
32 | echo % add sub sub |
|
77 | bump sub rev | |
33 | echo ss = ss > s/.hgsub |
|
78 | ||
34 | hg init s/ss |
|
79 | $ echo b > s/a | |
35 | echo a > s/ss/a |
|
80 | $ hg -R s ci -ms1 | |
36 | hg -R s add s/.hgsub |
|
81 | $ hg ci -m3 | |
37 | hg -R s/ss add s/ss/a |
|
82 | committing subrepository s | |
38 | hg sum |
|
83 | ||
39 | hg ci -m2 |
|
84 | leave sub dirty | |
40 | hg sum |
|
85 | ||
|
86 | $ echo c > s/a | |||
|
87 | $ hg ci -m4 | |||
|
88 | committing subrepository s | |||
|
89 | $ hg tip -R s | |||
|
90 | changeset: 3:1c833a7a9e3a | |||
|
91 | tag: tip | |||
|
92 | user: test | |||
|
93 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
94 | summary: 4 | |||
|
95 | ||||
|
96 | ||||
|
97 | check caching | |||
41 |
|
98 | |||
42 | echo % bump sub rev |
|
99 | $ hg co 0 | |
43 | echo b > s/a |
|
100 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
44 | hg -R s ci -ms1 |
|
101 | $ hg debugsub | |
45 | hg ci -m3 |
|
102 | ||
|
103 | restore | |||
|
104 | ||||
|
105 | $ hg co | |||
|
106 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
107 | $ hg debugsub | |||
|
108 | path s | |||
|
109 | source s | |||
|
110 | revision 1c833a7a9e3a4445c711aaf0f012379cd0d4034e | |||
|
111 | ||||
|
112 | new branch for merge tests | |||
|
113 | ||||
|
114 | $ hg co 1 | |||
|
115 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
116 | $ echo t = t >> .hgsub | |||
|
117 | $ hg init t | |||
|
118 | $ echo t > t/t | |||
|
119 | $ hg -R t add t | |||
|
120 | adding t/t | |||
46 |
|
121 | |||
47 | echo % leave sub dirty |
|
122 | 5 | |
48 | echo c > s/a |
|
123 | ||
49 | hg ci -m4 |
|
124 | $ hg ci -m5 # add sub | |
50 | hg tip -R s |
|
125 | committing subrepository t | |
|
126 | created new head | |||
|
127 | $ echo t2 > t/t | |||
|
128 | ||||
|
129 | 6 | |||
51 |
|
130 | |||
52 | echo % check caching |
|
131 | $ hg st -R s | |
53 | hg co 0 |
|
132 | $ hg ci -m6 # change sub | |
54 | hg debugsub |
|
133 | committing subrepository t | |
55 | echo % restore |
|
134 | $ hg debugsub | |
56 | hg co |
|
135 | path s | |
57 | hg debugsub |
|
136 | source s | |
|
137 | revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 | |||
|
138 | path t | |||
|
139 | source t | |||
|
140 | revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad | |||
|
141 | $ echo t3 > t/t | |||
|
142 | ||||
|
143 | 7 | |||
58 |
|
144 | |||
59 | echo % new branch for merge tests |
|
145 | $ hg ci -m7 # change sub again for conflict test | |
60 | hg co 1 |
|
146 | committing subrepository t | |
61 | echo t = t >> .hgsub |
|
147 | $ hg rm .hgsub | |
62 | hg init t |
|
148 | ||
63 | echo t > t/t |
|
149 | 8 | |
64 | hg -R t add t |
|
150 | ||
65 | echo % 5 |
|
151 | $ hg ci -m8 # remove sub | |
66 | hg ci -m5 # add sub |
|
152 | ||
67 | echo t2 > t/t |
|
153 | merge tests | |
68 | echo % 6 |
|
|||
69 | hg st -R s |
|
|||
70 | hg ci -m6 # change sub |
|
|||
71 | hg debugsub |
|
|||
72 | echo t3 > t/t |
|
|||
73 | echo % 7 |
|
|||
74 | hg ci -m7 # change sub again for conflict test |
|
|||
75 | hg rm .hgsub |
|
|||
76 | echo % 8 |
|
|||
77 | hg ci -m8 # remove sub |
|
|||
78 |
|
154 | |||
79 | echo % merge tests |
|
155 | $ hg co -C 3 | |
80 | hg co -C 3 |
|
156 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
81 | hg merge 5 # test adding |
|
157 | $ hg merge 5 # test adding | |
82 | hg debugsub |
|
158 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
83 | hg ci -m9 |
|
159 | (branch merge, don't forget to commit) | |
84 | hg merge 6 --debug # test change |
|
160 | $ hg debugsub | |
85 | hg debugsub |
|
161 | path s | |
86 | echo conflict > t/t |
|
162 | source s | |
87 | hg ci -m10 |
|
163 | revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 | |
88 | HGMERGE=internal:merge hg merge --debug 7 # test conflict |
|
164 | path t | |
89 | echo % should conflict |
|
165 | source t | |
90 | cat t/t |
|
166 | revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382 | |
91 |
|
167 | $ hg ci -m9 | ||
92 | echo % clone |
|
168 | created new head | |
93 | cd .. |
|
169 | $ hg merge 6 --debug # test change | |
94 | hg clone t tc | sed 's|from .*/sub|from .../sub|g' |
|
170 | searching for copies back to rev 2 | |
95 | cd tc |
|
171 | resolving manifests | |
96 | hg debugsub |
|
172 | overwrite None partial False | |
|
173 | ancestor 1f14a2e2d3ec local f0d2028bf86d+ remote 1831e14459c4 | |||
|
174 | .hgsubstate: versions differ -> m | |||
|
175 | updating: .hgsubstate 1/1 files (100.00%) | |||
|
176 | subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec | |||
|
177 | subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg | |||
|
178 | getting subrepo t | |||
|
179 | resolving manifests | |||
|
180 | overwrite True partial False | |||
|
181 | ancestor 60ca1237c194+ local 60ca1237c194+ remote 6747d179aa9a | |||
|
182 | t: remote is newer -> g | |||
|
183 | updating: t 1/1 files (100.00%) | |||
|
184 | getting t | |||
|
185 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
186 | (branch merge, don't forget to commit) | |||
|
187 | $ hg debugsub | |||
|
188 | path s | |||
|
189 | source s | |||
|
190 | revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 | |||
|
191 | path t | |||
|
192 | source t | |||
|
193 | revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad | |||
|
194 | $ echo conflict > t/t | |||
|
195 | $ hg ci -m10 | |||
|
196 | committing subrepository t | |||
|
197 | $ HGMERGE=internal:merge hg merge --debug 7 # test conflict | |||
|
198 | searching for copies back to rev 2 | |||
|
199 | resolving manifests | |||
|
200 | overwrite None partial False | |||
|
201 | ancestor 1831e14459c4 local e45c8b14af55+ remote f94576341bcf | |||
|
202 | .hgsubstate: versions differ -> m | |||
|
203 | updating: .hgsubstate 1/1 files (100.00%) | |||
|
204 | subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4 | |||
|
205 | subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg | |||
|
206 | merging subrepo t | |||
|
207 | searching for copies back to rev 2 | |||
|
208 | resolving manifests | |||
|
209 | overwrite None partial False | |||
|
210 | ancestor 6747d179aa9a local 20a0db6fbf6c+ remote 7af322bc1198 | |||
|
211 | t: versions differ -> m | |||
|
212 | preserving t for resolve of t | |||
|
213 | updating: t 1/1 files (100.00%) | |||
|
214 | picked tool 'internal:merge' for t (binary False symlink False) | |||
|
215 | merging t | |||
|
216 | my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a | |||
|
217 | warning: conflicts during merge. | |||
|
218 | merging t failed! | |||
|
219 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |||
|
220 | use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon | |||
|
221 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
222 | (branch merge, don't forget to commit) | |||
97 |
|
223 | |||
98 | echo % push |
|
224 | should conflict | |
99 | echo bah > t/t |
|
|||
100 | hg ci -m11 |
|
|||
101 | hg push | sed 's/ .*sub/ ...sub/g' |
|
|||
102 |
|
225 | |||
103 | echo % push -f |
|
226 | $ cat t/t | |
104 | echo bah > s/a |
|
227 | <<<<<<< local | |
105 | hg ci -m12 |
|
228 | conflict | |
106 | hg push | sed 's/ .*sub/ ...sub/g' |
|
229 | ======= | |
107 | hg push -f | sed 's/ .*sub/ ...sub/g' |
|
230 | t3 | |
|
231 | >>>>>>> other | |||
|
232 | ||||
|
233 | clone | |||
108 |
|
234 | |||
109 | echo % update |
|
235 | $ cd .. | |
110 | cd ../t |
|
236 | $ hg clone t tc | |
111 | hg up -C # discard our earlier merge |
|
237 | updating to branch default | |
112 | echo blah > t/t |
|
238 | pulling subrepo s from .*/sub/t/s | |
113 | hg ci -m13 |
|
239 | requesting all changes | |
|
240 | adding changesets | |||
|
241 | adding manifests | |||
|
242 | adding file changes | |||
|
243 | added 4 changesets with 5 changes to 3 files | |||
|
244 | pulling subrepo s/ss from .*/sub/t/s/ss | |||
|
245 | requesting all changes | |||
|
246 | adding changesets | |||
|
247 | adding manifests | |||
|
248 | adding file changes | |||
|
249 | added 1 changesets with 1 changes to 1 files | |||
|
250 | pulling subrepo t from .*/sub/t/t | |||
|
251 | requesting all changes | |||
|
252 | adding changesets | |||
|
253 | adding manifests | |||
|
254 | adding file changes | |||
|
255 | added 4 changesets with 4 changes to 1 files (+1 heads) | |||
|
256 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
257 | $ cd tc | |||
|
258 | $ hg debugsub | |||
|
259 | path s | |||
|
260 | source s | |||
|
261 | revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 | |||
|
262 | path t | |||
|
263 | source t | |||
|
264 | revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e | |||
114 |
|
265 | |||
115 | echo % pull |
|
266 | push | |
116 | cd ../tc |
|
267 | ||
117 | hg pull | sed 's/ .*sub/ ...sub/g' |
|
268 | $ echo bah > t/t | |
118 | # should pull t |
|
269 | $ hg ci -m11 | |
119 | hg up | sed 's|from .*/sub|from .../sub|g' |
|
270 | committing subrepository t | |
120 | cat t/t |
|
271 | $ hg push | |
|
272 | pushing .*sub/t | |||
|
273 | pushing .*sub/t/s/ss | |||
|
274 | searching for changes | |||
|
275 | no changes found | |||
|
276 | pushing .*sub/t/s | |||
|
277 | searching for changes | |||
|
278 | no changes found | |||
|
279 | pushing .*sub/t/t | |||
|
280 | searching for changes | |||
|
281 | adding changesets | |||
|
282 | adding manifests | |||
|
283 | adding file changes | |||
|
284 | added 1 changesets with 1 changes to 1 files | |||
|
285 | searching for changes | |||
|
286 | adding changesets | |||
|
287 | adding manifests | |||
|
288 | adding file changes | |||
|
289 | added 1 changesets with 1 changes to 1 files | |||
|
290 | ||||
|
291 | push -f | |||
121 |
|
292 | |||
122 | echo % bogus subrepo path aborts |
|
293 | $ echo bah > s/a | |
123 | echo 'bogus=[boguspath' >> .hgsub |
|
294 | $ hg ci -m12 | |
124 | hg ci -m 'bogus subrepo path' |
|
295 | committing subrepository s | |
|
296 | $ hg push | |||
|
297 | pushing .*sub/t | |||
|
298 | pushing .*sub/t/s/ss | |||
|
299 | searching for changes | |||
|
300 | no changes found | |||
|
301 | pushing .*sub/t/s | |||
|
302 | searching for changes | |||
|
303 | abort: push creates new remote heads on branch 'default'! | |||
|
304 | (did you forget to merge? use push -f to force) | |||
|
305 | $ hg push -f | |||
|
306 | pushing .*sub/t | |||
|
307 | pushing .*sub/t/s/ss | |||
|
308 | searching for changes | |||
|
309 | no changes found | |||
|
310 | pushing .*sub/t/s | |||
|
311 | searching for changes | |||
|
312 | adding changesets | |||
|
313 | adding manifests | |||
|
314 | adding file changes | |||
|
315 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
316 | pushing .*sub/t/t | |||
|
317 | searching for changes | |||
|
318 | no changes found | |||
|
319 | searching for changes | |||
|
320 | adding changesets | |||
|
321 | adding manifests | |||
|
322 | adding file changes | |||
|
323 | added 1 changesets with 1 changes to 1 files | |||
|
324 | ||||
|
325 | update | |||
125 |
|
326 | |||
126 | echo % issue 1986 |
|
327 | $ cd ../t | |
127 | cd .. |
|
328 | $ hg up -C # discard our earlier merge | |
128 | rm -rf sub |
|
329 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
129 | hg init main |
|
330 | $ echo blah > t/t | |
130 | cd main |
|
331 | $ hg ci -m13 | |
|
332 | committing subrepository t | |||
|
333 | ||||
|
334 | pull | |||
|
335 | ||||
|
336 | $ cd ../tc | |||
|
337 | $ hg pull | |||
|
338 | pulling .*sub/t | |||
|
339 | searching for changes | |||
|
340 | adding changesets | |||
|
341 | adding manifests | |||
|
342 | adding file changes | |||
|
343 | added 1 changesets with 1 changes to 1 files | |||
|
344 | (run 'hg update' to get a working copy) | |||
|
345 | ||||
|
346 | should pull t | |||
|
347 | ||||
|
348 | $ hg up | |||
|
349 | pulling subrepo t from .*/sub/t/t | |||
|
350 | searching for changes | |||
|
351 | adding changesets | |||
|
352 | adding manifests | |||
|
353 | adding file changes | |||
|
354 | added 1 changesets with 1 changes to 1 files | |||
|
355 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
356 | $ cat t/t | |||
|
357 | blah | |||
|
358 | ||||
|
359 | bogus subrepo path aborts | |||
131 |
|
360 | |||
132 | hg init s # subrepo layout |
|
361 | $ echo 'bogus=[boguspath' >> .hgsub | |
133 | cd s # |
|
362 | $ hg ci -m 'bogus subrepo path' | |
134 | echo a > a # o 5 br |
|
363 | abort: missing ] in subrepo source | |
135 | hg ci -Am1 # /| |
|
364 | ||
136 | hg branch br # o | 4 default |
|
365 | issue 1986 | |
137 | echo a >> a # | | |
|
366 | ||
138 | hg ci -m1 # | o 3 br |
|
367 | # subrepo layout | |
139 | hg up default # |/| |
|
368 | # | |
140 | echo b > b # o | 2 default |
|
369 | # o 5 br | |
141 | hg ci -Am1 # | | |
|
370 | # /| | |
142 | hg up br # | o 1 br |
|
371 | # o | 4 default | |
143 | hg merge tip # |/ |
|
372 | # | | | |
144 | hg ci -m1 # o 0 default |
|
373 | # | o 3 br | |
145 | hg up 2 |
|
374 | # |/| | |
146 | echo c > c |
|
375 | # o | 2 default | |
147 | hg ci -Am1 |
|
376 | # | | | |
148 | hg up 3 |
|
377 | # | o 1 br | |
149 | hg merge 4 |
|
378 | # |/ | |
150 | hg ci -m1 |
|
379 | # o 0 default | |
151 |
|
380 | |||
152 | cd .. # main repo layout: |
|
381 | $ cd .. | |
153 | echo 's = s' > .hgsub # |
|
382 | $ rm -rf sub | |
154 | hg -R s up 2 # * <-- try to merge default into br again |
|
383 | $ hg init main | |
155 | hg ci -Am1 # .`| |
|
384 | $ cd main | |
156 | hg branch br # . o 5 br --> substate = 5 |
|
385 | $ hg init s | |
157 | echo b > b # . | |
|
386 | $ cd s | |
158 | hg -R s up 3 # o | 4 default --> substate = 4 |
|
387 | $ echo a > a | |
159 | hg ci -Am1 # | | |
|
388 | $ hg ci -Am1 | |
160 | hg up default # | o 3 br --> substate = 2 |
|
389 | adding a | |
161 | echo c > c # |/| |
|
390 | $ hg branch br | |
162 | hg ci -Am1 # o | 2 default --> substate = 2 |
|
391 | marked working directory as branch br | |
163 | hg up 1 # | | |
|
392 | $ echo a >> a | |
164 | hg merge 2 # | o 1 br --> substate = 3 |
|
393 | $ hg ci -m1 | |
165 | hg ci -m1 # |/ |
|
394 | $ hg up default | |
166 | hg up 2 # o 0 default --> substate = 2 |
|
395 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
167 | hg -R s up 4 |
|
396 | $ echo b > b | |
168 | echo d > d |
|
397 | $ hg ci -Am1 | |
169 | hg ci -Am1 |
|
398 | adding b | |
170 |
hg up |
|
399 | $ hg up br | |
171 | hg -R s up 5 |
|
400 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
172 | echo e > e |
|
401 | $ hg merge tip | |
173 | hg ci -Am1 |
|
402 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
403 | (branch merge, don't forget to commit) | |||
|
404 | $ hg ci -m1 | |||
|
405 | $ hg up 2 | |||
|
406 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
407 | $ echo c > c | |||
|
408 | $ hg ci -Am1 | |||
|
409 | adding c | |||
|
410 | $ hg up 3 | |||
|
411 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
412 | $ hg merge 4 | |||
|
413 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
414 | (branch merge, don't forget to commit) | |||
|
415 | $ hg ci -m1 | |||
174 |
|
416 | |||
175 | hg up 5 |
|
417 | # main repo layout: | |
176 | hg merge 4 # try to merge default into br again |
|
418 | # | |
177 | cd .. |
|
419 | # * <-- try to merge default into br again | |
|
420 | # .`| | |||
|
421 | # . o 5 br --> substate = 5 | |||
|
422 | # . | | |||
|
423 | # o | 4 default --> substate = 4 | |||
|
424 | # | | | |||
|
425 | # | o 3 br --> substate = 2 | |||
|
426 | # |/| | |||
|
427 | # o | 2 default --> substate = 2 | |||
|
428 | # | | | |||
|
429 | # | o 1 br --> substate = 3 | |||
|
430 | # |/ | |||
|
431 | # o 0 default --> substate = 2 | |||
178 |
|
432 | |||
179 | echo % test subrepo delete from .hgsubstate |
|
433 | $ cd .. | |
180 | hg init testdelete |
|
434 | $ echo 's = s' > .hgsub | |
181 | mkdir testdelete/nested testdelete/nested2 |
|
435 | $ hg -R s up 2 | |
182 | hg init testdelete/nested |
|
436 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
183 | hg init testdelete/nested2 |
|
437 | $ hg ci -Am1 | |
184 | echo test > testdelete/nested/foo |
|
438 | adding .hgsub | |
185 | echo test > testdelete/nested2/foo |
|
439 | committing subrepository s | |
186 | hg -R testdelete/nested add |
|
440 | $ hg branch br | |
187 | hg -R testdelete/nested2 add |
|
441 | marked working directory as branch br | |
188 | hg -R testdelete/nested ci -m test |
|
442 | $ echo b > b | |
189 | hg -R testdelete/nested2 ci -m test |
|
443 | $ hg -R s up 3 | |
190 | echo nested = nested > testdelete/.hgsub |
|
444 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
191 | echo nested2 = nested2 >> testdelete/.hgsub |
|
445 | $ hg ci -Am1 | |
192 | hg -R testdelete add |
|
446 | adding b | |
193 | hg -R testdelete ci -m "nested 1 & 2 added" |
|
447 | committing subrepository s | |
194 | echo nested = nested > testdelete/.hgsub |
|
448 | $ hg up default | |
195 | hg -R testdelete ci -m "nested 2 deleted" |
|
449 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
196 | cat testdelete/.hgsubstate | sed "s:.* ::" |
|
450 | $ echo c > c | |
197 | hg -R testdelete remove testdelete/.hgsub |
|
451 | $ hg ci -Am1 | |
198 | hg -R testdelete ci -m ".hgsub deleted" |
|
452 | adding c | |
199 | cat testdelete/.hgsubstate |
|
453 | $ hg up 1 | |
|
454 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
455 | $ hg merge 2 | |||
|
456 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
457 | (branch merge, don't forget to commit) | |||
|
458 | $ hg ci -m1 | |||
|
459 | $ hg up 2 | |||
|
460 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
461 | $ hg -R s up 4 | |||
|
462 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
463 | $ echo d > d | |||
|
464 | $ hg ci -Am1 | |||
|
465 | adding d | |||
|
466 | committing subrepository s | |||
|
467 | $ hg up 3 | |||
|
468 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
469 | $ hg -R s up 5 | |||
|
470 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
471 | $ echo e > e | |||
|
472 | $ hg ci -Am1 | |||
|
473 | adding e | |||
|
474 | committing subrepository s | |||
|
475 | ||||
|
476 | $ hg up 5 | |||
|
477 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
478 | $ hg merge 4 # try to merge default into br again | |||
|
479 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
480 | (branch merge, don't forget to commit) | |||
|
481 | $ cd .. | |||
|
482 | ||||
|
483 | test subrepo delete from .hgsubstate | |||
200 |
|
484 | |||
201 | echo % test repository cloning |
|
485 | $ hg init testdelete | |
202 | mkdir mercurial mercurial2 |
|
486 | $ mkdir testdelete/nested testdelete/nested2 | |
203 | hg init nested_absolute |
|
487 | $ hg init testdelete/nested | |
204 | echo test > nested_absolute/foo |
|
488 | $ hg init testdelete/nested2 | |
205 | hg -R nested_absolute add |
|
489 | $ echo test > testdelete/nested/foo | |
206 | hg -R nested_absolute ci -mtest |
|
490 | $ echo test > testdelete/nested2/foo | |
207 | cd mercurial |
|
491 | $ hg -R testdelete/nested add | |
208 | hg init nested_relative |
|
492 | adding testdelete/nested/foo | |
209 | echo test2 > nested_relative/foo2 |
|
493 | $ hg -R testdelete/nested2 add | |
210 | hg -R nested_relative add |
|
494 | adding testdelete/nested2/foo | |
211 |
hg -R |
|
495 | $ hg -R testdelete/nested ci -m test | |
212 | hg init main |
|
496 | $ hg -R testdelete/nested2 ci -m test | |
213 | echo "nested_relative = ../nested_relative" > main/.hgsub |
|
497 | $ echo nested = nested > testdelete/.hgsub | |
214 | echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub |
|
498 | $ echo nested2 = nested2 >> testdelete/.hgsub | |
215 | hg -R main add |
|
499 | $ hg -R testdelete add | |
216 | hg -R main ci -m "add subrepos" |
|
500 | adding testdelete/.hgsub | |
217 | cd .. |
|
501 | $ hg -R testdelete ci -m "nested 1 & 2 added" | |
218 | hg clone mercurial/main mercurial2/main |
|
502 | committing subrepository nested2 | |
219 | cat mercurial2/main/nested_absolute/.hg/hgrc \ |
|
503 | committing subrepository nested | |
220 | mercurial2/main/nested_relative/.hg/hgrc \ |
|
504 | $ echo nested = nested > testdelete/.hgsub | |
221 | | "$TESTDIR/filtertmp.py" |
|
505 | $ hg -R testdelete ci -m "nested 2 deleted" | |
222 | rm -rf mercurial mercurial2 |
|
506 | $ cat testdelete/.hgsubstate | |
|
507 | bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested | |||
|
508 | $ hg -R testdelete remove testdelete/.hgsub | |||
|
509 | $ hg -R testdelete ci -m ".hgsub deleted" | |||
|
510 | $ cat testdelete/.hgsubstate | |||
|
511 | ||||
|
512 | test repository cloning | |||
223 |
|
513 | |||
224 | echo % issue 1977 |
|
514 | $ mkdir mercurial mercurial2 | |
225 | hg init repo |
|
515 | $ hg init nested_absolute | |
226 | hg init repo/s |
|
516 | $ echo test > nested_absolute/foo | |
227 | echo a > repo/s/a |
|
517 | $ hg -R nested_absolute add | |
228 | hg -R repo/s ci -Am0 |
|
518 | adding nested_absolute/foo | |
229 | echo s = s > repo/.hgsub |
|
519 | $ hg -R nested_absolute ci -mtest | |
230 | hg -R repo ci -Am1 |
|
520 | $ cd mercurial | |
231 | hg clone repo repo2 | sed 's|from .*/sub|from .../sub|g' |
|
521 | $ hg init nested_relative | |
232 | hg -q -R repo2 pull -u |
|
522 | $ echo test2 > nested_relative/foo2 | |
233 | echo 1 > repo2/s/a |
|
523 | $ hg -R nested_relative add | |
234 | hg -R repo2/s ci -m2 |
|
524 | adding nested_relative/foo2 | |
235 | hg -q -R repo2/s push |
|
525 | $ hg -R nested_relative ci -mtest2 | |
236 | hg -R repo2/s up -C 0 |
|
526 | $ hg init main | |
237 | echo 2 > repo2/s/a |
|
527 | $ echo "nested_relative = ../nested_relative" > main/.hgsub | |
238 | hg -R repo2/s ci -m3 |
|
528 | $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub | |
239 | hg -R repo2 ci -m3 |
|
529 | $ hg -R main add | |
240 | hg -q -R repo2 push |
|
530 | adding main/.hgsub | |
241 | hg -R repo update |
|
531 | $ hg -R main ci -m "add subrepos" | |
242 | rm -rf repo2 repo |
|
532 | committing subrepository nested_relative | |
|
533 | committing subrepository nested_absolute | |||
|
534 | $ cd .. | |||
|
535 | $ hg clone mercurial/main mercurial2/main | |||
|
536 | updating to branch default | |||
|
537 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
538 | $ cat mercurial2/main/nested_absolute/.hg/hgrc \ | |||
|
539 | > mercurial2/main/nested_relative/.hg/hgrc | |||
|
540 | [paths] | |||
|
541 | default = .*/test-subrepo.t/sub/mercurial/nested_absolute | |||
|
542 | [paths] | |||
|
543 | default = .*/test-subrepo.t/sub/mercurial/nested_relative | |||
|
544 | $ rm -rf mercurial mercurial2 | |||
|
545 | ||||
|
546 | issue 1977 | |||
243 |
|
547 | |||
244 | exit 0 |
|
548 | $ hg init repo | |
|
549 | $ hg init repo/s | |||
|
550 | $ echo a > repo/s/a | |||
|
551 | $ hg -R repo/s ci -Am0 | |||
|
552 | adding a | |||
|
553 | $ echo s = s > repo/.hgsub | |||
|
554 | $ hg -R repo ci -Am1 | |||
|
555 | adding .hgsub | |||
|
556 | committing subrepository s | |||
|
557 | $ hg clone repo repo2 | |||
|
558 | updating to branch default | |||
|
559 | pulling subrepo s from .*/sub/repo/s | |||
|
560 | requesting all changes | |||
|
561 | adding changesets | |||
|
562 | adding manifests | |||
|
563 | adding file changes | |||
|
564 | added 1 changesets with 1 changes to 1 files | |||
|
565 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
566 | $ hg -q -R repo2 pull -u | |||
|
567 | $ echo 1 > repo2/s/a | |||
|
568 | $ hg -R repo2/s ci -m2 | |||
|
569 | $ hg -q -R repo2/s push | |||
|
570 | $ hg -R repo2/s up -C 0 | |||
|
571 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
572 | $ echo 2 > repo2/s/a | |||
|
573 | $ hg -R repo2/s ci -m3 | |||
|
574 | created new head | |||
|
575 | $ hg -R repo2 ci -m3 | |||
|
576 | committing subrepository s | |||
|
577 | $ hg -q -R repo2 push | |||
|
578 | abort: push creates new remote heads on branch 'default'! | |||
|
579 | (did you forget to merge? use push -f to force) | |||
|
580 | $ hg -R repo update | |||
|
581 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
582 | $ rm -rf repo2 repo | |||
|
583 | ||||
|
584 | $ exit 0 |
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