summaryrefslogtreecommitdiff
path: root/tests/test-journal-exists.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-journal-exists.t')
-rw-r--r--tests/test-journal-exists.t36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/test-journal-exists.t b/tests/test-journal-exists.t
new file mode 100644
index 0000000..4cc908f
--- /dev/null
+++ b/tests/test-journal-exists.t
@@ -0,0 +1,36 @@
+ $ 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!
+ [255]
+
+ $ hg recover
+ rolling back interrupted transaction
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 1 files, 1 changesets, 1 total revisions
+
+Check that zero-size journals are correctly aborted:
+
+#if unix-permissions
+ $ 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
+