tests/test-mq-qsave.t
author Durham Goode <durham@fb.com>
Mon, 20 Oct 2014 16:53:56 -0700
branchstable
changeset 23063 cd86a6707159
parent 12324 b701610f6c56
child 49621 55c6ebd11cb9
permissions -rw-r--r--
transactions: fix hg recover with fncache backups The transaction backupfiles logic was broken for 'hg recover'. The file format is XXX\0XXX\0YYY\0YYY\0 but the parser did a couple things wrong. 1) It went one step beyond the final \0 and tried to read past the end of the array. 2) array[i:i+1] returns a single item, instead of two items as intended. Added a test to catch it, which turns out to be the first actual 'hg recover' test.

  $ echo "[extensions]" >> $HGRCPATH
  $ echo "mq=" >> $HGRCPATH

  $ hg init

  $ echo 'base' > base
  $ hg ci -Ambase
  adding base

  $ hg qnew -mmqbase mqbase

  $ hg qsave
  $ hg qrestore 2
  restoring status: hg patches saved state