tests/test-dirstate-backup.t
author Matt Harbison <matt_harbison@yahoo.com>
Sat, 24 Mar 2018 01:30:50 -0400
changeset 37104 656ac240f392
parent 34940 c2b30348930f
child 45846 8d72e29ad1e0
permissions -rw-r--r--
context: skip path conflicts by default when clearing unknown file (issue5776) Prior to adding path conflict checking in 989e884d1be9, the test-audit-path.t tests failed as shown here (but it was globbed away). 989e884d1be9 made it fail with a message about the destination manifest containing a conflict (though the no-symlink case wasn't updated). When the path conflict checking was gated behind an experimental config in 2a774cae3a03^::2a774cae3a03, the update started erroneously succeeding here. It turns out that the child of 989e884d1be9 is the origin of this change when path conflict checking is disabled, as shown by grafting the experimental config range on top of it. What's happening here is merge.batchget() is writing the symlink 'back' to wdir (but as a regular file for the no-symlink case), and then tries to write 'back/test', but calls wctx['back/test'].clearunknown() first. The code that's gated here was removing the newly written 'back' file, allowing 'back/test' to succeed. I tried checking for the dir components of 'back/test' in dirstate, and skipping removal if present. But that didn't work because the dirstate isn't updated after each file is written out. This is the last persistent test failure on Windows, so the testbot should start turning green now. \o/

Set up

  $ hg init repo
  $ cd repo

Try to import an empty patch

  $ hg import --no-commit - <<EOF
  > EOF
  applying patch from stdin
  abort: stdin: no diffs found
  [255]

No dirstate backups are left behind

  $ ls .hg/dirstate* | sort
  .hg/dirstate