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