comparison tests/test-clone-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 a pull started during an aborted commit
4 #
5
6 # Create two repos, so that one of them can pull from the other one.
7 hg init source
8 cd source
9 touch foo
10 hg add foo
11 hg ci -m 'add foo'
12 hg clone . ../corrupted
13 echo >> foo
14 hg ci -m 'change foo'
15
16 # Add a hook to wait 5 seconds and then abort the commit
17 cd ../corrupted
18 echo '[hooks]' >> .hg/hgrc
19 echo 'pretxncommit = sleep 5; exit 1' >> .hg/hgrc
20
21 # start a commit...
22 touch bar
23 hg add bar
24 hg ci -m 'add bar' &
25
26 # ... and start a pull while the commit is still running
27 sleep 1
28 hg pull ../source 2>/dev/null
29
30 # see what happened
31 wait
32 hg verify