##// END OF EJS Templates
tests: unify test-bundle
Martin Geisler -
r11870:33eb803e default
parent child Browse files
Show More
This diff has been collapsed as it changes many lines, (688 lines changed) Show them Hide them
@@ -1,168 +1,558
1 #!/bin/sh
1 $ cp "$TESTDIR"/printenv.py .
2
3 Setting up test
2 4
3 cp "$TESTDIR"/printenv.py .
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
4 63
5 echo "====== Setting up test"
6 hg init test
7 cd test
8 echo 0 > afile
9 hg add afile
10 hg commit -m "0.0" -d "1000000 0"
11 echo 1 >> afile
12 hg commit -m "0.1" -d "1000000 0"
13 echo 2 >> afile
14 hg commit -m "0.2" -d "1000000 0"
15 echo 3 >> afile
16 hg commit -m "0.3" -d "1000000 0"
17 hg update -C 0
18 echo 1 >> afile
19 hg commit -m "1.1" -d "1000000 0"
20 echo 2 >> afile
21 hg commit -m "1.2" -d "1000000 0"
22 echo "a line" > fred
23 echo 3 >> afile
24 hg add fred
25 hg commit -m "1.3" -d "1000000 0"
26 hg mv afile adifferentfile
27 hg commit -m "1.3m" -d "1000000 0"
28 hg update -C 3
29 hg mv afile anotherfile
30 hg commit -m "0.3m" -d "1000000 0"
31 hg verify
32 cd ..
33 hg init empty
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)
34 96
35 echo "====== Bundle --all"
36 hg -R test bundle --all all.hg
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
37 137
38 echo "====== Bundle test to full.hg"
39 hg -R test bundle full.hg empty
40 echo "====== Unbundle full.hg in test"
41 hg -R test unbundle full.hg
42 echo "====== Verify empty"
43 hg -R empty heads
44 hg -R empty verify
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
45 163
46 echo "====== Pull full.hg into test (using --cwd)"
47 hg --cwd test pull ../full.hg
48 echo "====== Pull full.hg into empty (using --cwd)"
49 hg --cwd empty pull ../full.hg
50 echo "====== Rollback empty"
51 hg -R empty rollback
52 echo "====== Pull full.hg into empty again (using --cwd)"
53 hg --cwd empty pull ../full.hg
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
54 199
55 echo "====== Pull full.hg into test (using -R)"
56 hg -R test pull full.hg
57 echo "====== Pull full.hg into empty (using -R)"
58 hg -R empty pull full.hg
59 echo "====== Rollback empty"
60 hg -R empty rollback
61 echo "====== Pull full.hg into empty again (using -R)"
62 hg -R empty pull full.hg
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 ..
63 215
64 echo "====== Log -R full.hg in fresh empty"
65 rm -r empty
66 hg init empty
67 cd empty
68 hg -R bundle://../full.hg log
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
69 234
70 echo "====== Pull ../full.hg into empty (with hook)"
71 echo '[hooks]' >> .hg/hgrc
72 echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
73 #doesn't work (yet ?)
74 #hg -R bundle://../full.hg verify
75 hg pull bundle://../full.hg
76 echo "====== Rollback empty"
77 hg rollback
78 cd ..
79 echo "====== Log -R bundle:empty+full.hg"
80 hg -R bundle:empty+full.hg log --template="{rev} "
81 echo ""
82 echo "====== Pull full.hg into empty again (using -R; with hook)"
83 hg -R empty pull full.hg
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
84 274
85 echo "====== Create partial clones"
86 rm -r empty
87 hg init empty
88 hg clone -r 3 test partial
89 hg clone partial partial2
90 cd partial
91 echo "====== Log -R full.hg in partial"
92 hg -R bundle://../full.hg log
93 echo "====== Incoming full.hg in partial"
94 hg incoming bundle://../full.hg
95 echo "====== Outgoing -R full.hg vs partial2 in partial"
96 hg -R bundle://../full.hg outgoing ../partial2
97 echo "====== Outgoing -R does-not-exist.hg vs partial2 in partial"
98 hg -R bundle://../does-not-exist.hg outgoing ../partial2
99 cd ..
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
100 337
101 echo "====== Direct clone from bundle (all-history)"
102 hg clone full.hg full-clone
103 hg -R full-clone heads
104 rm -r full-clone
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
105 369
106 # test for http://mercurial.selenic.com/bts/issue216
107 echo "====== Unbundle incremental bundles into fresh empty in one go"
108 rm -r empty
109 hg init empty
110 hg -R test bundle --base null -r 0 ../0.hg
111 hg -R test bundle --base 0 -r 1 ../1.hg
112 hg -R empty unbundle -u ../0.hg ../1.hg
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)
113 377
114 # test for 540d1059c802
115 echo "====== test for 540d1059c802"
116 hg init orig
117 cd orig
118 echo foo > foo
119 hg add foo
120 hg ci -m 'add foo'
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
121 393
122 hg clone . ../copy
123 hg tag foo
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
124 404
125 cd ../copy
126 echo >> foo
127 hg ci -m 'change foo'
128 hg bundle ../bundle.hg ../orig
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
129 421
130 cd ../orig
131 hg incoming ../bundle.hg
132 cd ..
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
133 436
134 # test for http://mercurial.selenic.com/bts/issue1144
135 echo "===== test that verify bundle does not traceback"
136 # partial history bundle, fails w/ unkown parent
137 hg -R bundle.hg verify
138 # full history bundle, refuses to verify non-local repo
139 hg -R all.hg verify
140 # but, regular verify must continue to work
141 hg -R orig verify
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
142 481
143 echo "====== diff against bundle"
144 hg init b
145 cd b
146 hg -R ../all.hg diff -r tip
147 cd ..
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
148 520
149 echo "====== bundle single branch"
150 hg init branchy
151 cd branchy
152 echo a >a
153 hg ci -Ama
154 echo b >b
155 hg ci -Amb
156 echo b1 >b1
157 hg ci -Amb1
158 hg up 0
159 echo c >c
160 hg ci -Amc
161 echo c1 >c1
162 hg ci -Amc1
163 hg clone -q .#tip part
164 echo "== bundling via incoming"
165 hg in -R part --bundle incoming.hg --template "{node}\n" .
166 echo "== bundling"
167 hg bundle bundle.hg part --debug
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
168 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
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now