Mercurial > hg
view tests/test-journal-exists.t @ 41107:3e2c02836420
transaction: do not overwrite atomic-temp files on error
Even though the original files can be restored from the backup, it should be
better to not write back a temporary file if we know it can be corrupted.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 23 Dec 2018 12:39:20 +0900 |
parents | f1186c292d03 |
children | b6673e9bdcf6 |
line wrap: on
line source
$ hg init $ echo a > a $ hg ci -Am0 adding a $ hg -q clone . foo $ touch .hg/store/journal $ echo foo > a $ hg ci -Am0 abort: abandoned transaction found! (run 'hg recover' to clean up transaction) [255] $ hg recover rolling back interrupted transaction checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 1 changesets with 1 changes to 1 files Check that zero-size journals are correctly aborted: #if unix-permissions no-root $ hg bundle -qa repo.hg $ chmod -w foo/.hg/store/00changelog.i $ hg -R foo unbundle repo.hg adding changesets abort: Permission denied: $TESTTMP/foo/.hg/store/.00changelog.i-* (glob) [255] $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi #endif