view tests/test-journal-exists.t @ 26936:d47ac02fcefa

discovery: pass pushop to _nowarnheads Previously, we passed only enough information to _nowarnheads to perform the old calculation. However, extensions may want to use more information in this calculation. Now that pushop is extensible, extensions will often want access to the additional fields they have added to the pushop, so pass that through. Specifically, the remotenames extension will use this information to allow pushing new heads that are bookmarked without requiring --force.
author Ryan McElroy <rmcelroy@fb.com>
date Tue, 10 Nov 2015 11:16:25 -0800
parents 3b4c75690206
children f1186c292d03
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
  1 files, 1 changesets, 1 total revisions

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