Show More
@@ -1,69 +1,70 b'' | |||
|
1 | 1 | Corrupt an hg repo with two pulls. |
|
2 | 2 | create one repo with a long history |
|
3 | 3 | |
|
4 | 4 | $ hg init source1 |
|
5 | 5 | $ cd source1 |
|
6 | 6 | $ touch foo |
|
7 | 7 | $ hg add foo |
|
8 | 8 | $ for i in 1 2 3 4 5 6 7 8 9 10; do |
|
9 | 9 | > echo $i >> foo |
|
10 | 10 | > hg ci -m $i |
|
11 | 11 | > done |
|
12 | 12 | $ cd .. |
|
13 | 13 | |
|
14 | 14 | create one repo with a shorter history |
|
15 | 15 | |
|
16 | 16 | $ hg clone -r 0 source1 source2 |
|
17 | 17 | adding changesets |
|
18 | 18 | adding manifests |
|
19 | 19 | adding file changes |
|
20 | 20 | added 1 changesets with 1 changes to 1 files |
|
21 | 21 | updating to branch default |
|
22 | 22 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
23 | 23 | $ cd source2 |
|
24 | 24 | $ echo a >> foo |
|
25 | 25 | $ hg ci -m a |
|
26 | 26 | $ cd .. |
|
27 | 27 | |
|
28 | 28 | create a third repo to pull both other repos into it |
|
29 | 29 | |
|
30 | 30 | $ hg init corrupted |
|
31 | 31 | $ cd corrupted |
|
32 | 32 | |
|
33 | 33 | use a hook to make the second pull start while the first one is still running |
|
34 | 34 | |
|
35 | 35 | $ echo '[hooks]' >> .hg/hgrc |
|
36 | 36 | $ echo 'prechangegroup = sleep 5' >> .hg/hgrc |
|
37 | 37 | |
|
38 | 38 | start a pull... |
|
39 | 39 | |
|
40 | $ hg pull ../source1 & | |
|
40 | $ hg pull ../source1 > pull.out 2>&1 & | |
|
41 | 41 | |
|
42 | 42 | ... and start another pull before the first one has finished |
|
43 | 43 | |
|
44 | 44 | $ sleep 1 |
|
45 | pulling from ../source1 | |
|
46 | requesting all changes | |
|
47 | 45 | $ hg pull ../source2 2>/dev/null |
|
48 | 46 | pulling from ../source2 |
|
49 | adding changesets | |
|
50 | adding manifests | |
|
51 | adding file changes | |
|
52 | added 10 changesets with 10 changes to 1 files | |
|
53 | (run 'hg update' to get a working copy) | |
|
54 | 47 | searching for changes |
|
55 | 48 | adding changesets |
|
56 | 49 | adding manifests |
|
57 | 50 | adding file changes |
|
58 | 51 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
59 | 52 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
53 | $ cat pull.out | |
|
54 | pulling from ../source1 | |
|
55 | requesting all changes | |
|
56 | adding changesets | |
|
57 | adding manifests | |
|
58 | adding file changes | |
|
59 | added 10 changesets with 10 changes to 1 files | |
|
60 | (run 'hg update' to get a working copy) | |
|
60 | 61 | |
|
61 | 62 | see the result |
|
62 | 63 | |
|
63 | 64 | $ wait |
|
64 | 65 | $ hg verify |
|
65 | 66 | checking changesets |
|
66 | 67 | checking manifests |
|
67 | 68 | crosschecking files in changesets and manifests |
|
68 | 69 | checking files |
|
69 | 70 | 1 files, 11 changesets, 11 total revisions |
General Comments 0
You need to be logged in to leave comments.
Login now