copies: fix up "fullcopy" with missing entries from "copy"
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 15 Apr 2019 16:41:43 -0700
changeset 42164 96bd75e67a94
parent 42163 beec7fc6adec
child 42165 22c9ffdf8ef6
copies: fix up "fullcopy" with missing entries from "copy" This is just a workaround similar to the previous one. It will make it easier to follow later patches. Differential Revision: https://phab.mercurial-scm.org/D6246
mercurial/copies.py
tests/test-graft.t
tests/test-rename-merge2.t
--- a/mercurial/copies.py	Sun Apr 14 00:46:25 2019 -0700
+++ b/mercurial/copies.py	Mon Apr 15 16:41:43 2019 -0700
@@ -687,6 +687,10 @@
     for dst, src in fullcopy.copy().items():
         if src not in mb:
             del fullcopy[dst]
+    # Sometimes we forget to add entries from "copy" to "fullcopy", so fix
+    # that up here
+    for dst, src in copy.items():
+        fullcopy[dst] = src
     if fullcopy and repo.ui.debugflag:
         repo.ui.debug("  all copies found (* = to merge, ! = divergent, "
                       "% = renamed and deleted):\n")
--- a/tests/test-graft.t	Sun Apr 14 00:46:25 2019 -0700
+++ b/tests/test-graft.t	Mon Apr 15 16:41:43 2019 -0700
@@ -749,6 +749,9 @@
      g
     unmatched files new in both:
      b
+    all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+     src: 'a' -> dst: 'b' *
+    checking for directory renames
   resolving manifests
    branchmerge: True, force: True, partial: False
    ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
--- a/tests/test-rename-merge2.t	Sun Apr 14 00:46:25 2019 -0700
+++ b/tests/test-rename-merge2.t	Mon Apr 15 16:41:43 2019 -0700
@@ -365,6 +365,9 @@
     searching for copies back to rev 1
     unmatched files new in both:
      b
+    all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+     src: 'a' -> dst: 'b' *
+    checking for directory renames
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 924404dff337, local: 62e7bf090eba+, remote: 49b6d8032493
@@ -952,6 +955,7 @@
      0/f
      1/g
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+     src: '1/f' -> dst: '1/g' *
      src: '3/f' -> dst: '3/g' *
      src: '4/f' -> dst: '4/g' *
      src: '5/f' -> dst: '5/g' *