##// END OF EJS Templates
exchange: support for streaming clone bundles...
exchange: support for streaming clone bundles Now that we have a mechanism to produce and consume streaming clone bundles, we need to teach the human-facing bundle specification parser and the internal bundle file header reading code to be aware of this new format. This patch does so. For the human-facing bundle specification, we choose the name "packed" to describe "streaming clone bundles" because the bundle is essentially a "pack" of raw revlog files that are "packed" together. There should probably be a bikeshed over the name, especially since it is human facing.

File last commit:

r24838:b2c1ff96 stable
r26756:9e272a96 default
Show More
test-clone-pull-corruption.t
52 lines | 1.2 KiB | text/troff | Tads3Lexer
/ tests / test-clone-pull-corruption.t
Corrupt an hg repo with a pull started during an aborted commit
Create two repos, so that one of them can pull from the other one.
$ hg init source
$ cd source
$ touch foo
$ hg add foo
$ hg ci -m 'add foo'
$ hg clone . ../corrupted
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo >> foo
$ hg ci -m 'change foo'
Add a hook to wait 5 seconds and then abort the commit
$ cd ../corrupted
$ echo "[hooks]" >> .hg/hgrc
$ echo 'pretxncommit = sh -c "sleep 5; exit 1"' >> .hg/hgrc
start a commit...
$ touch bar
$ hg add bar
$ hg ci -m 'add bar' &
... and start a pull while the commit is still running
$ sleep 1
$ hg pull ../source 2>/dev/null
pulling from ../source
transaction abort!
rollback completed
abort: pretxncommit hook exited with status 1
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)
see what happened
$ wait
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
1 files, 2 changesets, 2 total revisions
$ cd ..