changeset 42246:618b9ffefa87

tests: demonstrate that rename is followed to wrong parent from merge This test case shows another way that copies are handled differently between `hg st` (pathcopies()) and `hg co -m` (mergecopies). The reason is that pathcopies() calls _tracefiles(), which checks that the file nodeid of an ancestor matches the file nodeid in the base commit. mergecopies() should probably be doing the same. Differential Revision: https://phab.mercurial-scm.org/D6323
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 27 Apr 2019 23:30:19 -0700
parents 7bb2f358a13b
children 9893d7aa7420
files tests/test-commit-amend.t
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-commit-amend.t	Sat Apr 27 23:14:49 2019 -0700
+++ b/tests/test-commit-amend.t	Sat Apr 27 23:30:19 2019 -0700
@@ -783,6 +783,21 @@
   
   $ hg debugrename aaa
   aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980
+
+Update to p1 with 'aaa' modified. 'aaa' was renamed from 'aa' in p2. 'aa' exists
+in p1 too, but it was recorded as copied from p2.
+  $ echo modified >> aaa
+BROKEN: should not be follow the rename back to 'aa' here, since the rename
+happened compared to p2
+  $ hg co -m '.^' -t :merge3
+  merging aaa and aa to aa
+  warning: conflicts while merging aa! (edit, then use 'hg resolve --mark')
+  0 files updated, 0 files merged, 1 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges
+  [1]
+  $ hg co -C tip
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
   $ hg mv aaa aa
   $ hg ci --amend -m 'merge bar again (undo rename)'
   $ hg log --config diff.git=1 -pr .