tests/test-journal-exists.t
author Martin von Zweigbergk <martinvonz@google.com>
Sat, 09 Feb 2019 14:37:58 -0800
changeset 41666 a950b65cbe1b
parent 41420 b6673e9bdcf6
child 42144 013de80bf90e
permissions -rw-r--r--
scmutil: remove special handling of pats==("",) in matchandpats() (API) I don't know under what circumstances we used to pass that value, but we don't seem to do it now. Differential Revision: https://phab.mercurial-scm.org/D5921

  $ 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