view tests/test-hup.t @ 24213:e0c1328df872

workingctx: use normal dirs() instead of dirstate.dirs() The workingctx class was using dirstate.dirs() as it's implementation. The sparse extension maintains a pruned down version of the dirstate, so this resulted in the workingctx reporting an incorrect listing of directories during merge calculations (it was detecting directory renames when it shouldn't have). The fix is to use the default implementation, which uses workingctx._manifest, which unions the manifest with the dirstate to produce the correct overall picture. This also produces more accurate output since it will no longer return directories that have been entirely deleted in the dirstate. Tests will be added to the sparse extension to detect regressions for this.
author Durham Goode <durham@fb.com>
date Thu, 05 Mar 2015 22:16:28 -0800
parents 581d3bc03aad
children
line wrap: on
line source

#require serve fifo

Test hangup signal in the middle of transaction

  $ hg init
  $ mkfifo p
  $ hg serve --stdio < p 1>out 2>&1 &
  $ P=$!

Do test while holding fifo open

  $ (
  > echo lock
  > echo addchangegroup
  > start=`date +%s`
  > # 10 second seems much enough to let the server catch up
  > deadline=`expr $start + 10`
  > while [ ! -s .hg/store/journal ]; do
  >     sleep 0;
  >     if [ `date +%s` -gt $deadline ]; then
  >         echo "transaction did not start after 10 seconds" >&2;
  >         exit 1;
  >     fi
  > done
  > kill -HUP $P
  > ) > p

  $ wait
  $ cat out
  0
  0
  adding changesets
  transaction abort!
  rollback completed
  killed!

  $ ls -1d .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
  .hg/store/journal.phaseroots