tests/test-empty-dir.t
author Martin von Zweigbergk <martinvonz@google.com>
Sat, 13 Apr 2019 00:24:17 -0700
changeset 42161 7815cf0ea88b
parent 12346 3b165c127690
permissions -rw-r--r--
tests: add test for issue5343 (grafting with copies) It seems that issue5353 resulted in a lot of tests in test-graft.t, but the bug actually reported in that issue didn't get a test case. This patch adds one for the "move" and one for the "copy" version of it. I also added a "copy+modify" case, to show what should be a merge conflict. I didn't add one for the "backwards" version of it since the comment says that that was already covered by previous work. The tests added by this patch show the broken behavior (the bug is still open). I suspect the results returned from mergecopies() are not expressive enough to fix this issue: it has a dict for copies to merge with, but that can only give one more filename, but here we need two (one for the path on the remote side and one for the path in the merge base). I want to have it tested anyway since I'm about to refactor mergecopies(). Differential Revision: https://phab.mercurial-scm.org/D6242

  $ hg init

  $ echo 123 > a
  $ hg add a
  $ hg commit -m "first" a

  $ mkdir sub
  $ echo 321 > sub/b
  $ hg add sub/b
  $ hg commit -m "second" sub/b

  $ cat sub/b
  321

  $ hg co 0
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved

  $ cat sub/b 2>/dev/null || echo "sub/b not present"
  sub/b not present

  $ test -d sub || echo "sub not present"
  sub not present