Patchwork D6014: commit: migrate to new method for getting copy info

login
register
mail settings
Submitter phabricator
Date Feb. 24, 2019, 8:24 a.m.
Message ID <e6ac8458390bd587badb190b0387667a@localhost.localdomain>
Download mbox | patch
Permalink /patch/38903/
State Not Applicable
Headers show

Comments

phabricator - Feb. 24, 2019, 8:24 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2e2076c8c25f: commit: migrate to new method for getting copy info (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6014?vs=14202&id=14217

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

AFFECTED FILES
  mercurial/localrepo.py
  tests/drawdag.py

CHANGE DETAILS




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

Patch

diff --git a/tests/drawdag.py b/tests/drawdag.py
--- a/tests/drawdag.py
+++ b/tests/drawdag.py
@@ -275,7 +275,7 @@ 
     def path(self):
         return self._path
 
-    def renamed(self):
+    def copysource(self):
         return None
 
     def flags(self):
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2293,8 +2293,8 @@ 
 
         flog = self.file(fname)
         meta = {}
-        copy = fctx.renamed()
-        if copy and copy[0] != fname:
+        cfname = fctx.copysource()
+        if cfname and cfname != fname:
             # Mark the new revision of this file as a copy of another
             # file.  This copy data will effectively act as a parent
             # of this new revision.  If this is a merge, the first
@@ -2314,7 +2314,6 @@ 
             #    \- 2 --- 4        as the merge base
             #
 
-            cfname = copy[0]
             crev = manifest1.get(cfname)
             newfparent = fparent2