Mercurial > hg
comparison tests/test-journal-exists @ 9693:c40a1ee20aa5
transaction: always remove empty journal on abort
When transactions without entries were aborted, the journal (of size 0) was not
unlinked, which prevents subsequent operations until hg recover is run on the
repository.
We also make sure the journal is unlinked when committing, even if the provided
hook doesn't do so.
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Mon, 02 Nov 2009 10:19:14 +0100 |
parents | b6d8972ce339 |
children |
comparison
equal
deleted
inserted
replaced
9692:807633f1e3c2 | 9693:c40a1ee20aa5 |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 hg init | 3 hg init |
4 echo a > a | 4 echo a > a |
5 hg ci -Am0 | 5 hg ci -Am0 |
6 hg -q clone . foo | |
6 | 7 |
7 touch .hg/store/journal | 8 touch .hg/store/journal |
8 | 9 |
9 echo foo > a | 10 echo foo > a |
10 hg ci -Am0 | 11 hg ci -Am0 |
11 | 12 |
12 hg recover | 13 hg recover |
14 | |
15 echo % check that zero-size journals are correctly aborted | |
16 hg bundle -qa repo.hg | |
17 chmod -w foo/.hg/store/00changelog.i | |
18 hg -R foo unbundle repo.hg 2>&1 | sed 's/\(abort: Permission denied\).*/\1/' | |
19 if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi | |
20 exit 0 |