Debian Codegraph @

tests/test-journal-exists.t

raw
1 $ hg init repo
2 $ cd repo
3 $ echo a > a
4 $ hg ci -Am0
5 adding a
6
7 $ hg -q clone . foo
8
9 $ touch .hg/store/journal
10
11 $ echo foo > a
12 $ hg ci -Am0
13 abort: abandoned transaction found
14 (run 'hg recover' to clean up transaction)
15 [255]
16
17 $ hg recover
18 rolling back interrupted transaction
19 (verify step skipped, run `hg verify` to check your repository content)
20
21 recover, explicit verify
22
23 $ touch .hg/store/journal
24 $ hg ci -Am0
25 abort: abandoned transaction found
26 (run 'hg recover' to clean up transaction)
27 [255]
28 $ hg recover --verify -q
29
30 recover, no verify
31
32 $ touch .hg/store/journal
33 $ hg ci -Am0
34 abort: abandoned transaction found
35 (run 'hg recover' to clean up transaction)
36 [255]
37 $ hg recover --no-verify
38 rolling back interrupted transaction
39 (verify step skipped, run `hg verify` to check your repository content)
40
41
42 Check that zero-size journals are correctly aborted:
43
44 #if unix-permissions no-root
45 $ hg bundle -qa repo.hg
46 $ chmod -w foo/.hg/store/00changelog.i
47
48 #if rust
49 $ hg -R foo unbundle repo.hg
50 adding changesets
51 transaction abort!
52 rollback completed
53 abort: abort: when writing $TESTTMP/repo/foo/.hg/store/00changelog.i: $EACCES$
54 [50]
55 #else
56 $ hg -R foo unbundle repo.hg
57 adding changesets
58 transaction abort!
59 rollback completed
60 abort: $EACCES$: '$TESTTMP/repo/foo/.hg/store/.00changelog.i-*' (glob)
61 [255]
62 #endif
63
64 $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
65 #endif
66