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

login
register
mail settings
Submitter phabricator
Date April 17, 2019, 11:27 p.m.
Message ID <a2f2d452810b888b33cb825d00600276@localhost.localdomain>
Download mbox | patch
Permalink /patch/39732/
State Not Applicable
Headers show

Comments

phabricator - April 17, 2019, 11:27 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG96bd75e67a94: copies: fix up &quot;fullcopy&quot; with missing entries from &quot;copy&quot; (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6246?vs=14820&id=14829

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
@@ -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' *
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")