comparison tests/test-pull-pull-corruption @ 1785:81ca1a9bd061

Added test cases for repo corruption fixed in 2e0a288ca93e (issue132) (submitted by Alexis S. L. Carvalho <alexis@cecm.usp.br>)
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 22 Feb 2006 07:45:14 +0100
parents
children
comparison
equal deleted inserted replaced
1784:2e0a288ca93e 1785:81ca1a9bd061
1 #!/bin/sh
2 #
3 # Corrupt an hg repo with two pulls.
4 #
5
6 # create one repo with a long history
7 hg init source1
8 cd source1
9 touch foo
10 hg add foo
11 for i in 1 2 3 4 5 6 7 8 9 10; do
12 echo $i >> foo
13 hg ci -m $i
14 done
15 cd ..
16
17 # create one repo with a shorter history
18 hg clone -r 0 source1 source2
19 cd source2
20 echo a >> foo
21 hg ci -m a
22 cd ..
23
24 # create a third repo to pull both other repos into it
25 hg init corrupted
26 cd corrupted
27 # use a hook to make the second pull start while the first one is still running
28 echo '[hooks]' >> .hg/hgrc
29 echo 'prechangegroup = sleep 5' >> .hg/hgrc
30
31 # start a pull...
32 hg pull ../source1 &
33
34 # ... and start another pull before the first one has finished
35 sleep 1
36 hg pull ../source2 2>/dev/null
37
38 # see the result
39 wait
40 hg verify
41