tests/test-hup.t
author Alexander Solovyov <alexander@solovyov.net>
Sun, 01 May 2011 13:07:00 +0200
branchstable
changeset 14266 89e7d35e0ef0
parent 12413 f8dc83689f19
child 15446 c5c9ca3719f9
permissions -rw-r--r--
fix bookmarks rollback behavior Before this patch undo.bookmarks was created on bookmarks write and not with other transaction-related files. There were two issues: first is that if you have changed bookmarks few times after a transaction happened, rollback will give you a state which can point to non-existing revision. Second is that if you have not changed bookmarks after a transaction, rollback will touch your state anyway. This change also adds `localrepo._writejournal` method, which can be used by other extensions to save their transaction-related backup in right time.

Test hangup signal in the middle of transaction

  $ "$TESTDIR/hghave" fifo || exit 80
  $ hg init
  $ mkfifo p
  $ hg serve --stdio < p &
  $ P=$!
  $ (echo lock; echo addchangegroup; sleep 5) > p &
  $ Q=$!
  $ sleep 3
  0
  0
  adding changesets
  $ kill -HUP $P
  $ wait
  transaction abort!
  rollback completed
  killed!
  $ echo .hg/* .hg/store/*
  .hg/00changelog.i .hg/journal.bookmarks .hg/journal.branch .hg/journal.desc .hg/journal.dirstate .hg/requires .hg/store .hg/store/00changelog.i .hg/store/00changelog.i.a