##// 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 b''
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)
4
61
5 echo "====== Setting up test"
62 Verify empty
6 hg init test
63
7 cd test
64 $ hg -R empty heads
8 echo 0 > afile
65 $ hg -R empty verify
9 hg add afile
66 checking changesets
10 hg commit -m "0.0" -d "1000000 0"
67 checking manifests
11 echo 1 >> afile
68 crosschecking files in changesets and manifests
12 hg commit -m "0.1" -d "1000000 0"
69 checking files
13 echo 2 >> afile
70 0 files, 0 changesets, 0 total revisions
14 hg commit -m "0.2" -d "1000000 0"
71
15 echo 3 >> afile
72 Pull full.hg into test (using --cwd)
16 hg commit -m "0.3" -d "1000000 0"
73
17 hg update -C 0
74 $ hg --cwd test pull ../full.hg
18 echo 1 >> afile
75 pulling from ../full.hg
19 hg commit -m "1.1" -d "1000000 0"
76 searching for changes
20 echo 2 >> afile
77 no changes found
21 hg commit -m "1.2" -d "1000000 0"
78
22 echo "a line" > fred
79 Pull full.hg into empty (using --cwd)
23 echo 3 >> afile
80
24 hg add fred
81 $ hg --cwd empty pull ../full.hg
25 hg commit -m "1.3" -d "1000000 0"
82 pulling from ../full.hg
26 hg mv afile adifferentfile
83 requesting all changes
27 hg commit -m "1.3m" -d "1000000 0"
84 adding changesets
28 hg update -C 3
85 adding manifests
29 hg mv afile anotherfile
86 adding file changes
30 hg commit -m "0.3m" -d "1000000 0"
87 added 9 changesets with 7 changes to 4 files (+1 heads)
31 hg verify
88 (run 'hg heads' to see heads, 'hg merge' to merge)
32 cd ..
89
33 hg init empty
90 Rollback empty
34
91
35 echo "====== Bundle --all"
92 $ hg -R empty rollback
36 hg -R test bundle --all all.hg
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)
37
124
38 echo "====== Bundle test to full.hg"
125 Pull full.hg into empty again (using -R)
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
45
126
46 echo "====== Pull full.hg into test (using --cwd)"
127 $ hg -R empty pull full.hg
47 hg --cwd test pull ../full.hg
128 pulling from full.hg
48 echo "====== Pull full.hg into empty (using --cwd)"
129 requesting all changes
49 hg --cwd empty pull ../full.hg
130 adding changesets
50 echo "====== Rollback empty"
131 adding manifests
51 hg -R empty rollback
132 adding file changes
52 echo "====== Pull full.hg into empty again (using --cwd)"
133 added 9 changesets with 7 changes to 4 files (+1 heads)
53 hg --cwd empty pull ../full.hg
134 (run 'hg heads' to see heads, 'hg merge' to merge)
135
136 Log -R full.hg in fresh empty
54
137
55 echo "====== Pull full.hg into test (using -R)"
138 $ rm -r empty
56 hg -R test pull full.hg
139 $ hg init empty
57 echo "====== Pull full.hg into empty (using -R)"
140 $ cd empty
58 hg -R empty pull full.hg
141 $ hg -R bundle://../full.hg log
59 echo "====== Rollback empty"
142 changeset: 8:088ff9d6e1e1
60 hg -R empty rollback
143 tag: tip
61 echo "====== Pull full.hg into empty again (using -R)"
144 parent: 3:ac69c658229d
62 hg -R empty pull full.hg
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
63
190
64 echo "====== Log -R full.hg in fresh empty"
191 Pull ../full.hg into empty (with hook)
65 rm -r empty
66 hg init empty
67 cd empty
68 hg -R bundle://../full.hg log
69
192
70 echo "====== Pull ../full.hg into empty (with hook)"
193 $ echo '[hooks]' >> .hg/hgrc
71 echo '[hooks]' >> .hg/hgrc
194 $ echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
72 echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
195
73 #doesn't work (yet ?)
196 doesn't work (yet ?)
74 #hg -R bundle://../full.hg verify
197
75 hg pull bundle://../full.hg
198 hg -R bundle://../full.hg verify
76 echo "====== Rollback empty"
199
77 hg rollback
200 $ hg pull bundle://../full.hg
78 cd ..
201 changegroup hook: HG_NODE=5649c9d34dd87d0ecb5fd39672128376e83b22e1 HG_SOURCE=pull HG_URL=bundle:../full.hg
79 echo "====== Log -R bundle:empty+full.hg"
202 pulling from bundle://../full.hg
80 hg -R bundle:empty+full.hg log --template="{rev} "
203 requesting all changes
81 echo ""
204 adding changesets
82 echo "====== Pull full.hg into empty again (using -R; with hook)"
205 adding manifests
83 hg -R empty pull full.hg
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
84
251
85 echo "====== Create partial clones"
252 $ hg -R bundle://../full.hg log
86 rm -r empty
253 changeset: 8:088ff9d6e1e1
87 hg init empty
254 tag: tip
88 hg clone -r 3 test partial
255 parent: 3:ac69c658229d
89 hg clone partial partial2
256 user: test
90 cd partial
257 date: Mon Jan 12 13:46:40 1970 +0000
91 echo "====== Log -R full.hg in partial"
258 summary: 0.3m
92 hg -R bundle://../full.hg log
259
93 echo "====== Incoming full.hg in partial"
260 changeset: 7:27f57c869697
94 hg incoming bundle://../full.hg
261 user: test
95 echo "====== Outgoing -R full.hg vs partial2 in partial"
262 date: Mon Jan 12 13:46:40 1970 +0000
96 hg -R bundle://../full.hg outgoing ../partial2
263 summary: 1.3m
97 echo "====== Outgoing -R does-not-exist.hg vs partial2 in partial"
264
98 hg -R bundle://../does-not-exist.hg outgoing ../partial2
265 changeset: 6:1e3f6b843bd6
99 cd ..
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
100
303
101 echo "====== Direct clone from bundle (all-history)"
304 $ hg incoming bundle://../full.hg
102 hg clone full.hg full-clone
305 comparing with bundle://../full.hg
103 hg -R full-clone heads
306 searching for changes
104 rm -r full-clone
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
105
337
106 # test for http://mercurial.selenic.com/bts/issue216
338 $ hg -R bundle://../full.hg outgoing ../partial2
107 echo "====== Unbundle incremental bundles into fresh empty in one go"
339 comparing with ../partial2
108 rm -r empty
340 searching for changes
109 hg init empty
341 changeset: 4:5f4f3ceb285e
110 hg -R test bundle --base null -r 0 ../0.hg
342 parent: 0:5649c9d34dd8
111 hg -R test bundle --base 0 -r 1 ../1.hg
343 user: test
112 hg -R empty unbundle -u ../0.hg ../1.hg
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
113
369
114 # test for 540d1059c802
370 Outgoing -R does-not-exist.hg vs partial2 in partial
115 echo "====== test for 540d1059c802"
371
116 hg init orig
372 $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
117 cd orig
373 abort: No such file or directory: ../does-not-exist.hg
118 echo foo > foo
374 $ cd ..
119 hg add foo
375
120 hg ci -m 'add foo'
376 Direct clone from bundle (all-history)
121
377
122 hg clone . ../copy
378 $ hg clone full.hg full-clone
123 hg tag foo
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
124
404
125 cd ../copy
405 $ rm -r empty
126 echo >> foo
406 $ hg init empty
127 hg ci -m 'change foo'
407 $ hg -R test bundle --base null -r 0 ../0.hg
128 hg bundle ../bundle.hg ../orig
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
422 test for 540d1059c802
131 hg incoming ../bundle.hg
423
132 cd ..
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
437 $ cd ../copy
135 echo "===== test that verify bundle does not traceback"
438 $ echo >> foo
136 # partial history bundle, fails w/ unkown parent
439 $ hg ci -m 'change foo'
137 hg -R bundle.hg verify
440 $ hg bundle ../bundle.hg ../orig
138 # full history bundle, refuses to verify non-local repo
441 searching for changes
139 hg -R all.hg verify
442 1 changesets found
140 # but, regular verify must continue to work
443
141 hg -R orig verify
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"
482 $ hg init b
144 hg init b
483 $ cd b
145 cd b
484 $ hg -R ../all.hg diff -r tip
146 hg -R ../all.hg diff -r tip
485 diff -r 088ff9d6e1e1 anotherfile
147 cd ..
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"
521 $ hg in -R part --bundle incoming.hg --template "{node}\n" .
150 hg init branchy
522 comparing with .
151 cd branchy
523 searching for changes
152 echo a >a
524 d2ae7f538514cd87c17547b0de4cea71fe1af9fb
153 hg ci -Ama
525 5ece8e77363e2b5269e27c66828b72da29e4341a
154 echo b >b
526
155 hg ci -Amb
527 == bundling
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
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
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now