Patchwork D9171: tests: add test of copies suggested by Pierre-Yves on D9159

login
register
mail settings
Submitter phabricator
Date Oct. 8, 2020, 3:14 p.m.
Message ID <differential-rev-PHID-DREV-5b5xijgyuesiv4am3qsi-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47406/
State Superseded
Headers show

Comments

phabricator - Oct. 8, 2020, 3:14 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9171

AFFECTED FILES
  tests/test-copies.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-copies.t b/tests/test-copies.t
--- a/tests/test-copies.t
+++ b/tests/test-copies.t
@@ -463,6 +463,53 @@ 
   x -> z
 
 
+Create x and y, then rename x to z on one side of merge, and rename y to z and
+then delete z on the other side.
+  $ newrepo
+  $ echo x > x
+  $ echo y > y
+  $ hg ci -Aqm 'add x and y'
+  $ hg mv x z
+  $ hg ci -qm 'rename x to z'
+  $ hg co -q 0
+  $ hg mv y z
+  $ hg ci -qm 'rename y to z'
+  $ hg rm z
+  $ hg ci -m 'delete z'
+  $ hg merge -q 1
+  $ echo z > z
+  $ hg ci -m 'merge 1 into 3'
+Try merging the other direction too
+  $ hg co -q 1
+  $ hg merge -q 3
+  $ echo z > z
+  $ hg ci -m 'merge 3 into 1'
+  created new head
+  $ hg l
+  @    5 merge 3 into 1
+  |\   z
+  +---o  4 merge 1 into 3
+  | |/   z
+  | o  3 delete z
+  | |  z
+  | o  2 rename y to z
+  | |  y z
+  o |  1 rename x to z
+  |/   x z
+  o  0 add x and y
+     x y
+  $ hg debugpathcopies 1 4
+  $ hg debugpathcopies 2 4
+  x -> z (no-filelog !)
+  $ hg debugpathcopies 0 4
+  x -> z (filelog !)
+  $ hg debugpathcopies 1 5
+  $ hg debugpathcopies 2 5
+  x -> z (no-filelog !)
+  $ hg debugpathcopies 0 5
+  x -> z
+
+
 Test for a case in fullcopytracing algorithm where neither of the merging csets
 is a descendant of the merge base. This test reflects that the algorithm
 correctly finds the copies: