Mercurial > hg
comparison tests/test-bundle.t @ 11870:33eb803e9343
tests: unify test-bundle
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Sat, 14 Aug 2010 03:16:02 +0200 |
parents | tests/test-bundle@0b999aec64e8 |
children | 4c94b6d0fb1c |
comparison
equal
deleted
inserted
replaced
11869:36a5e7cb6c8d | 11870:33eb803e9343 |
---|---|
1 $ cp "$TESTDIR"/printenv.py . | |
2 | |
3 Setting up test | |
4 | |
5 $ hg init test | |
6 $ cd test | |
7 $ echo 0 > afile | |
8 $ hg add afile | |
9 $ hg commit -m "0.0" -d "1000000 0" | |
10 $ echo 1 >> afile | |
11 $ hg commit -m "0.1" -d "1000000 0" | |
12 $ echo 2 >> afile | |
13 $ hg commit -m "0.2" -d "1000000 0" | |
14 $ echo 3 >> afile | |
15 $ hg commit -m "0.3" -d "1000000 0" | |
16 $ hg update -C 0 | |
17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
18 $ echo 1 >> afile | |
19 $ hg commit -m "1.1" -d "1000000 0" | |
20 created new head | |
21 $ echo 2 >> afile | |
22 $ hg commit -m "1.2" -d "1000000 0" | |
23 $ echo "a line" > fred | |
24 $ echo 3 >> afile | |
25 $ hg add fred | |
26 $ hg commit -m "1.3" -d "1000000 0" | |
27 $ hg mv afile adifferentfile | |
28 $ hg commit -m "1.3m" -d "1000000 0" | |
29 $ hg update -C 3 | |
30 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
31 $ hg mv afile anotherfile | |
32 $ hg commit -m "0.3m" -d "1000000 0" | |
33 $ hg verify | |
34 checking changesets | |
35 checking manifests | |
36 crosschecking files in changesets and manifests | |
37 checking files | |
38 4 files, 9 changesets, 7 total revisions | |
39 $ cd .. | |
40 $ hg init empty | |
41 | |
42 Bundle --all | |
43 | |
44 $ hg -R test bundle --all all.hg | |
45 9 changesets found | |
46 | |
47 Bundle test to full.hg | |
48 | |
49 $ hg -R test bundle full.hg empty | |
50 searching for changes | |
51 9 changesets found | |
52 | |
53 Unbundle full.hg in test | |
54 | |
55 $ hg -R test unbundle full.hg | |
56 adding changesets | |
57 adding manifests | |
58 adding file changes | |
59 added 0 changesets with 0 changes to 4 files | |
60 (run 'hg update' to get a working copy) | |
61 | |
62 Verify empty | |
63 | |
64 $ hg -R empty heads | |
65 $ hg -R empty verify | |
66 checking changesets | |
67 checking manifests | |
68 crosschecking files in changesets and manifests | |
69 checking files | |
70 0 files, 0 changesets, 0 total revisions | |
71 | |
72 Pull full.hg into test (using --cwd) | |
73 | |
74 $ hg --cwd test pull ../full.hg | |
75 pulling from ../full.hg | |
76 searching for changes | |
77 no changes found | |
78 | |
79 Pull full.hg into empty (using --cwd) | |
80 | |
81 $ hg --cwd empty pull ../full.hg | |
82 pulling from ../full.hg | |
83 requesting all changes | |
84 adding changesets | |
85 adding manifests | |
86 adding file changes | |
87 added 9 changesets with 7 changes to 4 files (+1 heads) | |
88 (run 'hg heads' to see heads, 'hg merge' to merge) | |
89 | |
90 Rollback empty | |
91 | |
92 $ hg -R empty rollback | |
93 rolling back to revision -1 (undo pull) | |
94 | |
95 Pull full.hg into empty again (using --cwd) | |
96 | |
97 $ hg --cwd empty pull ../full.hg | |
98 pulling from ../full.hg | |
99 requesting all changes | |
100 adding changesets | |
101 adding manifests | |
102 adding file changes | |
103 added 9 changesets with 7 changes to 4 files (+1 heads) | |
104 (run 'hg heads' to see heads, 'hg merge' to merge) | |
105 | |
106 Pull full.hg into test (using -R) | |
107 | |
108 $ hg -R test pull full.hg | |
109 pulling from full.hg | |
110 searching for changes | |
111 no changes found | |
112 | |
113 Pull full.hg into empty (using -R) | |
114 | |
115 $ hg -R empty pull full.hg | |
116 pulling from full.hg | |
117 searching for changes | |
118 no changes found | |
119 | |
120 Rollback empty | |
121 | |
122 $ hg -R empty rollback | |
123 rolling back to revision -1 (undo pull) | |
124 | |
125 Pull full.hg into empty again (using -R) | |
126 | |
127 $ hg -R empty pull full.hg | |
128 pulling from full.hg | |
129 requesting all changes | |
130 adding changesets | |
131 adding manifests | |
132 adding file changes | |
133 added 9 changesets with 7 changes to 4 files (+1 heads) | |
134 (run 'hg heads' to see heads, 'hg merge' to merge) | |
135 | |
136 Log -R full.hg in fresh empty | |
137 | |
138 $ rm -r empty | |
139 $ hg init empty | |
140 $ cd empty | |
141 $ hg -R bundle://../full.hg log | |
142 changeset: 8:088ff9d6e1e1 | |
143 tag: tip | |
144 parent: 3:ac69c658229d | |
145 user: test | |
146 date: Mon Jan 12 13:46:40 1970 +0000 | |
147 summary: 0.3m | |
148 | |
149 changeset: 7:27f57c869697 | |
150 user: test | |
151 date: Mon Jan 12 13:46:40 1970 +0000 | |
152 summary: 1.3m | |
153 | |
154 changeset: 6:1e3f6b843bd6 | |
155 user: test | |
156 date: Mon Jan 12 13:46:40 1970 +0000 | |
157 summary: 1.3 | |
158 | |
159 changeset: 5:024e4e7df376 | |
160 user: test | |
161 date: Mon Jan 12 13:46:40 1970 +0000 | |
162 summary: 1.2 | |
163 | |
164 changeset: 4:5f4f3ceb285e | |
165 parent: 0:5649c9d34dd8 | |
166 user: test | |
167 date: Mon Jan 12 13:46:40 1970 +0000 | |
168 summary: 1.1 | |
169 | |
170 changeset: 3:ac69c658229d | |
171 user: test | |
172 date: Mon Jan 12 13:46:40 1970 +0000 | |
173 summary: 0.3 | |
174 | |
175 changeset: 2:d62976ca1e50 | |
176 user: test | |
177 date: Mon Jan 12 13:46:40 1970 +0000 | |
178 summary: 0.2 | |
179 | |
180 changeset: 1:10b2180f755b | |
181 user: test | |
182 date: Mon Jan 12 13:46:40 1970 +0000 | |
183 summary: 0.1 | |
184 | |
185 changeset: 0:5649c9d34dd8 | |
186 user: test | |
187 date: Mon Jan 12 13:46:40 1970 +0000 | |
188 summary: 0.0 | |
189 | |
190 | |
191 Pull ../full.hg into empty (with hook) | |
192 | |
193 $ echo '[hooks]' >> .hg/hgrc | |
194 $ echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc | |
195 | |
196 doesn't work (yet ?) | |
197 | |
198 hg -R bundle://../full.hg verify | |
199 | |
200 $ hg pull bundle://../full.hg | |
201 changegroup hook: HG_NODE=5649c9d34dd87d0ecb5fd39672128376e83b22e1 HG_SOURCE=pull HG_URL=bundle:../full.hg | |
202 pulling from bundle://../full.hg | |
203 requesting all changes | |
204 adding changesets | |
205 adding manifests | |
206 adding file changes | |
207 added 9 changesets with 7 changes to 4 files (+1 heads) | |
208 (run 'hg heads' to see heads, 'hg merge' to merge) | |
209 | |
210 Rollback empty | |
211 | |
212 $ hg rollback | |
213 rolling back to revision -1 (undo pull) | |
214 $ cd .. | |
215 | |
216 Log -R bundle:empty+full.hg | |
217 | |
218 $ hg -R bundle:empty+full.hg log --template="{rev} "; echo "" | |
219 8 7 6 5 4 3 2 1 0 | |
220 | |
221 Pull full.hg into empty again (using -R; with hook) | |
222 | |
223 $ hg -R empty pull full.hg | |
224 changegroup hook: HG_NODE=5649c9d34dd87d0ecb5fd39672128376e83b22e1 HG_SOURCE=pull HG_URL=bundle:empty+full.hg | |
225 pulling from full.hg | |
226 requesting all changes | |
227 adding changesets | |
228 adding manifests | |
229 adding file changes | |
230 added 9 changesets with 7 changes to 4 files (+1 heads) | |
231 (run 'hg heads' to see heads, 'hg merge' to merge) | |
232 | |
233 Create partial clones | |
234 | |
235 $ rm -r empty | |
236 $ hg init empty | |
237 $ hg clone -r 3 test partial | |
238 requesting all changes | |
239 adding changesets | |
240 adding manifests | |
241 adding file changes | |
242 added 4 changesets with 4 changes to 1 files | |
243 updating to branch default | |
244 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
245 $ hg clone partial partial2 | |
246 updating to branch default | |
247 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
248 $ cd partial | |
249 | |
250 Log -R full.hg in partial | |
251 | |
252 $ hg -R bundle://../full.hg log | |
253 changeset: 8:088ff9d6e1e1 | |
254 tag: tip | |
255 parent: 3:ac69c658229d | |
256 user: test | |
257 date: Mon Jan 12 13:46:40 1970 +0000 | |
258 summary: 0.3m | |
259 | |
260 changeset: 7:27f57c869697 | |
261 user: test | |
262 date: Mon Jan 12 13:46:40 1970 +0000 | |
263 summary: 1.3m | |
264 | |
265 changeset: 6:1e3f6b843bd6 | |
266 user: test | |
267 date: Mon Jan 12 13:46:40 1970 +0000 | |
268 summary: 1.3 | |
269 | |
270 changeset: 5:024e4e7df376 | |
271 user: test | |
272 date: Mon Jan 12 13:46:40 1970 +0000 | |
273 summary: 1.2 | |
274 | |
275 changeset: 4:5f4f3ceb285e | |
276 parent: 0:5649c9d34dd8 | |
277 user: test | |
278 date: Mon Jan 12 13:46:40 1970 +0000 | |
279 summary: 1.1 | |
280 | |
281 changeset: 3:ac69c658229d | |
282 user: test | |
283 date: Mon Jan 12 13:46:40 1970 +0000 | |
284 summary: 0.3 | |
285 | |
286 changeset: 2:d62976ca1e50 | |
287 user: test | |
288 date: Mon Jan 12 13:46:40 1970 +0000 | |
289 summary: 0.2 | |
290 | |
291 changeset: 1:10b2180f755b | |
292 user: test | |
293 date: Mon Jan 12 13:46:40 1970 +0000 | |
294 summary: 0.1 | |
295 | |
296 changeset: 0:5649c9d34dd8 | |
297 user: test | |
298 date: Mon Jan 12 13:46:40 1970 +0000 | |
299 summary: 0.0 | |
300 | |
301 | |
302 Incoming full.hg in partial | |
303 | |
304 $ hg incoming bundle://../full.hg | |
305 comparing with bundle://../full.hg | |
306 searching for changes | |
307 changeset: 4:5f4f3ceb285e | |
308 parent: 0:5649c9d34dd8 | |
309 user: test | |
310 date: Mon Jan 12 13:46:40 1970 +0000 | |
311 summary: 1.1 | |
312 | |
313 changeset: 5:024e4e7df376 | |
314 user: test | |
315 date: Mon Jan 12 13:46:40 1970 +0000 | |
316 summary: 1.2 | |
317 | |
318 changeset: 6:1e3f6b843bd6 | |
319 user: test | |
320 date: Mon Jan 12 13:46:40 1970 +0000 | |
321 summary: 1.3 | |
322 | |
323 changeset: 7:27f57c869697 | |
324 user: test | |
325 date: Mon Jan 12 13:46:40 1970 +0000 | |
326 summary: 1.3m | |
327 | |
328 changeset: 8:088ff9d6e1e1 | |
329 tag: tip | |
330 parent: 3:ac69c658229d | |
331 user: test | |
332 date: Mon Jan 12 13:46:40 1970 +0000 | |
333 summary: 0.3m | |
334 | |
335 | |
336 Outgoing -R full.hg vs partial2 in partial | |
337 | |
338 $ hg -R bundle://../full.hg outgoing ../partial2 | |
339 comparing with ../partial2 | |
340 searching for changes | |
341 changeset: 4:5f4f3ceb285e | |
342 parent: 0:5649c9d34dd8 | |
343 user: test | |
344 date: Mon Jan 12 13:46:40 1970 +0000 | |
345 summary: 1.1 | |
346 | |
347 changeset: 5:024e4e7df376 | |
348 user: test | |
349 date: Mon Jan 12 13:46:40 1970 +0000 | |
350 summary: 1.2 | |
351 | |
352 changeset: 6:1e3f6b843bd6 | |
353 user: test | |
354 date: Mon Jan 12 13:46:40 1970 +0000 | |
355 summary: 1.3 | |
356 | |
357 changeset: 7:27f57c869697 | |
358 user: test | |
359 date: Mon Jan 12 13:46:40 1970 +0000 | |
360 summary: 1.3m | |
361 | |
362 changeset: 8:088ff9d6e1e1 | |
363 tag: tip | |
364 parent: 3:ac69c658229d | |
365 user: test | |
366 date: Mon Jan 12 13:46:40 1970 +0000 | |
367 summary: 0.3m | |
368 | |
369 | |
370 Outgoing -R does-not-exist.hg vs partial2 in partial | |
371 | |
372 $ hg -R bundle://../does-not-exist.hg outgoing ../partial2 | |
373 abort: No such file or directory: ../does-not-exist.hg | |
374 $ cd .. | |
375 | |
376 Direct clone from bundle (all-history) | |
377 | |
378 $ hg clone full.hg full-clone | |
379 requesting all changes | |
380 adding changesets | |
381 adding manifests | |
382 adding file changes | |
383 added 9 changesets with 7 changes to 4 files (+1 heads) | |
384 updating to branch default | |
385 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
386 $ hg -R full-clone heads | |
387 changeset: 8:088ff9d6e1e1 | |
388 tag: tip | |
389 parent: 3:ac69c658229d | |
390 user: test | |
391 date: Mon Jan 12 13:46:40 1970 +0000 | |
392 summary: 0.3m | |
393 | |
394 changeset: 7:27f57c869697 | |
395 user: test | |
396 date: Mon Jan 12 13:46:40 1970 +0000 | |
397 summary: 1.3m | |
398 | |
399 $ rm -r full-clone | |
400 | |
401 test for http://mercurial.selenic.com/bts/issue216 | |
402 | |
403 Unbundle incremental bundles into fresh empty in one go | |
404 | |
405 $ rm -r empty | |
406 $ hg init empty | |
407 $ hg -R test bundle --base null -r 0 ../0.hg | |
408 1 changesets found | |
409 $ hg -R test bundle --base 0 -r 1 ../1.hg | |
410 1 changesets found | |
411 $ hg -R empty unbundle -u ../0.hg ../1.hg | |
412 adding changesets | |
413 adding manifests | |
414 adding file changes | |
415 added 1 changesets with 1 changes to 1 files | |
416 adding changesets | |
417 adding manifests | |
418 adding file changes | |
419 added 1 changesets with 1 changes to 1 files | |
420 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
421 | |
422 test for 540d1059c802 | |
423 | |
424 test for 540d1059c802 | |
425 | |
426 $ hg init orig | |
427 $ cd orig | |
428 $ echo foo > foo | |
429 $ hg add foo | |
430 $ hg ci -m 'add foo' | |
431 | |
432 $ hg clone . ../copy | |
433 updating to branch default | |
434 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
435 $ hg tag foo | |
436 | |
437 $ cd ../copy | |
438 $ echo >> foo | |
439 $ hg ci -m 'change foo' | |
440 $ hg bundle ../bundle.hg ../orig | |
441 searching for changes | |
442 1 changesets found | |
443 | |
444 $ cd ../orig | |
445 $ hg incoming ../bundle.hg | |
446 comparing with ../bundle.hg | |
447 searching for changes | |
448 changeset: 2:ed1b79f46b9a | |
449 tag: tip | |
450 parent: 0:bbd179dfa0a7 | |
451 user: test | |
452 date: Thu Jan 01 00:00:00 1970 +0000 | |
453 summary: change foo | |
454 | |
455 $ cd .. | |
456 | |
457 test for http://mercurial.selenic.com/bts/issue1144 | |
458 | |
459 test that verify bundle does not traceback | |
460 | |
461 partial history bundle, fails w/ unkown parent | |
462 | |
463 $ hg -R bundle.hg verify | |
464 abort: 00changelog.i@bbd179dfa0a7: unknown parent! | |
465 | |
466 full history bundle, refuses to verify non-local repo | |
467 | |
468 $ hg -R all.hg verify | |
469 abort: cannot verify bundle or remote repos | |
470 | |
471 but, regular verify must continue to work | |
472 | |
473 $ hg -R orig verify | |
474 checking changesets | |
475 checking manifests | |
476 crosschecking files in changesets and manifests | |
477 checking files | |
478 2 files, 2 changesets, 2 total revisions | |
479 | |
480 diff against bundle | |
481 | |
482 $ hg init b | |
483 $ cd b | |
484 $ hg -R ../all.hg diff -r tip | |
485 diff -r 088ff9d6e1e1 anotherfile | |
486 --- a/anotherfile Mon Jan 12 13:46:40 1970 +0000 | |
487 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
488 @@ -1,4 +0,0 @@ | |
489 -0 | |
490 -1 | |
491 -2 | |
492 -3 | |
493 $ cd .. | |
494 | |
495 bundle single branch | |
496 | |
497 $ hg init branchy | |
498 $ cd branchy | |
499 $ echo a >a | |
500 $ hg ci -Ama | |
501 adding a | |
502 $ echo b >b | |
503 $ hg ci -Amb | |
504 adding b | |
505 $ echo b1 >b1 | |
506 $ hg ci -Amb1 | |
507 adding b1 | |
508 $ hg up 0 | |
509 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
510 $ echo c >c | |
511 $ hg ci -Amc | |
512 adding c | |
513 created new head | |
514 $ echo c1 >c1 | |
515 $ hg ci -Amc1 | |
516 adding c1 | |
517 $ hg clone -q .#tip part | |
518 | |
519 == bundling via incoming | |
520 | |
521 $ hg in -R part --bundle incoming.hg --template "{node}\n" . | |
522 comparing with . | |
523 searching for changes | |
524 d2ae7f538514cd87c17547b0de4cea71fe1af9fb | |
525 5ece8e77363e2b5269e27c66828b72da29e4341a | |
526 | |
527 == bundling | |
528 | |
529 $ hg bundle bundle.hg part --debug | |
530 searching for changes | |
531 common changesets up to c0025332f9ed | |
532 2 changesets found | |
533 list of changesets: | |
534 d2ae7f538514cd87c17547b0de4cea71fe1af9fb | |
535 5ece8e77363e2b5269e27c66828b72da29e4341a | |
536 bundling changes: 0 chunks | |
537 bundling changes: 1 chunks | |
538 bundling changes: 2 chunks | |
539 bundling changes: 3 chunks | |
540 bundling changes: 4 chunks | |
541 bundling changes: 5 chunks | |
542 bundling changes: 6 chunks | |
543 bundling manifests: 0 chunks | |
544 bundling manifests: 1 chunks | |
545 bundling manifests: 2 chunks | |
546 bundling manifests: 3 chunks | |
547 bundling manifests: 4 chunks | |
548 bundling manifests: 5 chunks | |
549 bundling manifests: 6 chunks | |
550 bundling files: b 0 chunks | |
551 bundling files: b 1 chunks | |
552 bundling files: b 2 chunks | |
553 bundling files: b 3 chunks | |
554 bundling files: b1 4 chunks | |
555 bundling files: b1 5 chunks | |
556 bundling files: b1 6 chunks | |
557 bundling files: b1 7 chunks | |
558 |