Patchwork D6246: copies: fix up "fullcopy" with missing entries from "copy"

login
register
mail settings
Submitter phabricator
Date April 16, 2019, 5:18 p.m.
Message ID <differential-rev-PHID-DREV-w3e35sdpovfmaxccneib-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39649/
State Superseded
Headers show

Comments

phabricator - April 16, 2019, 5:18 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is just a workaround similar to the previous one. It will make it
  easier to follow later patches.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/copies.py
  tests/test-graft.t
  tests/test-rename-merge2.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -366,6 +366,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
@@ -953,6 +956,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' *
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -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
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -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")