##// 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)
61
62 Verify empty
4
63
5 echo "====== Setting up test"
64 $ hg -R empty heads
6 hg init test
65 $ hg -R empty verify
7 cd test
66 checking changesets
8 echo 0 > afile
67 checking manifests
9 hg add afile
68 crosschecking files in changesets and manifests
10 hg commit -m "0.0" -d "1000000 0"
69 checking files
11 echo 1 >> afile
70 0 files, 0 changesets, 0 total revisions
12 hg commit -m "0.1" -d "1000000 0"
71
13 echo 2 >> afile
72 Pull full.hg into test (using --cwd)
14 hg commit -m "0.2" -d "1000000 0"
73
15 echo 3 >> afile
74 $ hg --cwd test pull ../full.hg
16 hg commit -m "0.3" -d "1000000 0"
75 pulling from ../full.hg
17 hg update -C 0
76 searching for changes
18 echo 1 >> afile
77 no changes found
19 hg commit -m "1.1" -d "1000000 0"
78
20 echo 2 >> afile
79 Pull full.hg into empty (using --cwd)
21 hg commit -m "1.2" -d "1000000 0"
80
22 echo "a line" > fred
81 $ hg --cwd empty pull ../full.hg
23 echo 3 >> afile
82 pulling from ../full.hg
24 hg add fred
83 requesting all changes
25 hg commit -m "1.3" -d "1000000 0"
84 adding changesets
26 hg mv afile adifferentfile
85 adding manifests
27 hg commit -m "1.3m" -d "1000000 0"
86 adding file changes
28 hg update -C 3
87 added 9 changesets with 7 changes to 4 files (+1 heads)
29 hg mv afile anotherfile
88 (run 'hg heads' to see heads, 'hg merge' to merge)
30 hg commit -m "0.3m" -d "1000000 0"
89
31 hg verify
90 Rollback empty
32 cd ..
91
33 hg init empty
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"
97 $ hg --cwd empty pull ../full.hg
36 hg -R test bundle --all all.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"
138 $ rm -r empty
39 hg -R test bundle full.hg empty
139 $ hg init empty
40 echo "====== Unbundle full.hg in test"
140 $ cd empty
41 hg -R test unbundle full.hg
141 $ hg -R bundle://../full.hg log
42 echo "====== Verify empty"
142 changeset: 8:088ff9d6e1e1
43 hg -R empty heads
143 tag: tip
44 hg -R empty verify
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)"
164 changeset: 4:5f4f3ceb285e
47 hg --cwd test pull ../full.hg
165 parent: 0:5649c9d34dd8
48 echo "====== Pull full.hg into empty (using --cwd)"
166 user: test
49 hg --cwd empty pull ../full.hg
167 date: Mon Jan 12 13:46:40 1970 +0000
50 echo "====== Rollback empty"
168 summary: 1.1
51 hg -R empty rollback
169
52 echo "====== Pull full.hg into empty again (using --cwd)"
170 changeset: 3:ac69c658229d
53 hg --cwd empty pull ../full.hg
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)"
200 $ hg pull bundle://../full.hg
56 hg -R test pull full.hg
201 changegroup hook: HG_NODE=5649c9d34dd87d0ecb5fd39672128376e83b22e1 HG_SOURCE=pull HG_URL=bundle:../full.hg
57 echo "====== Pull full.hg into empty (using -R)"
202 pulling from bundle://../full.hg
58 hg -R empty pull full.hg
203 requesting all changes
59 echo "====== Rollback empty"
204 adding changesets
60 hg -R empty rollback
205 adding manifests
61 echo "====== Pull full.hg into empty again (using -R)"
206 adding file changes
62 hg -R empty pull full.hg
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"
216 Log -R bundle:empty+full.hg
65 rm -r empty
217
66 hg init empty
218 $ hg -R bundle:empty+full.hg log --template="{rev} "; echo ""
67 cd empty
219 8 7 6 5 4 3 2 1 0
68 hg -R bundle://../full.hg log
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)"
235 $ rm -r empty
71 echo '[hooks]' >> .hg/hgrc
236 $ hg init empty
72 echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
237 $ hg clone -r 3 test partial
73 #doesn't work (yet ?)
238 requesting all changes
74 #hg -R bundle://../full.hg verify
239 adding changesets
75 hg pull bundle://../full.hg
240 adding manifests
76 echo "====== Rollback empty"
241 adding file changes
77 hg rollback
242 added 4 changesets with 4 changes to 1 files
78 cd ..
243 updating to branch default
79 echo "====== Log -R bundle:empty+full.hg"
244 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 hg -R bundle:empty+full.hg log --template="{rev} "
245 $ hg clone partial partial2
81 echo ""
246 updating to branch default
82 echo "====== Pull full.hg into empty again (using -R; with hook)"
247 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 hg -R empty pull full.hg
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"
275 changeset: 4:5f4f3ceb285e
86 rm -r empty
276 parent: 0:5649c9d34dd8
87 hg init empty
277 user: test
88 hg clone -r 3 test partial
278 date: Mon Jan 12 13:46:40 1970 +0000
89 hg clone partial partial2
279 summary: 1.1
90 cd partial
280
91 echo "====== Log -R full.hg in partial"
281 changeset: 3:ac69c658229d
92 hg -R bundle://../full.hg log
282 user: test
93 echo "====== Incoming full.hg in partial"
283 date: Mon Jan 12 13:46:40 1970 +0000
94 hg incoming bundle://../full.hg
284 summary: 0.3
95 echo "====== Outgoing -R full.hg vs partial2 in partial"
285
96 hg -R bundle://../full.hg outgoing ../partial2
286 changeset: 2:d62976ca1e50
97 echo "====== Outgoing -R does-not-exist.hg vs partial2 in partial"
287 user: test
98 hg -R bundle://../does-not-exist.hg outgoing ../partial2
288 date: Mon Jan 12 13:46:40 1970 +0000
99 cd ..
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)"
338 $ hg -R bundle://../full.hg outgoing ../partial2
102 hg clone full.hg full-clone
339 comparing with ../partial2
103 hg -R full-clone heads
340 searching for changes
104 rm -r full-clone
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
370 Outgoing -R does-not-exist.hg vs partial2 in partial
107 echo "====== Unbundle incremental bundles into fresh empty in one go"
371
108 rm -r empty
372 $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
109 hg init empty
373 abort: No such file or directory: ../does-not-exist.hg
110 hg -R test bundle --base null -r 0 ../0.hg
374 $ cd ..
111 hg -R test bundle --base 0 -r 1 ../1.hg
375
112 hg -R empty unbundle -u ../0.hg ../1.hg
376 Direct clone from bundle (all-history)
113
377
114 # test for 540d1059c802
378 $ hg clone full.hg full-clone
115 echo "====== test for 540d1059c802"
379 requesting all changes
116 hg init orig
380 adding changesets
117 cd orig
381 adding manifests
118 echo foo > foo
382 adding file changes
119 hg add foo
383 added 9 changesets with 7 changes to 4 files (+1 heads)
120 hg ci -m 'add foo'
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
394 changeset: 7:27f57c869697
123 hg tag foo
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