changeset 41774:2e2076c8c25f

commit: migrate to new method for getting copy info Differential Revision: https://phab.mercurial-scm.org/D6014
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 27 Dec 2017 22:31:24 -0800
parents 151cc149b17f
children a86e22007b54
files mercurial/localrepo.py tests/drawdag.py
diffstat 2 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Dec 27 22:31:00 2017 -0800
+++ b/mercurial/localrepo.py	Wed Dec 27 22:31:24 2017 -0800
@@ -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
 
--- a/tests/drawdag.py	Wed Dec 27 22:31:00 2017 -0800
+++ b/tests/drawdag.py	Wed Dec 27 22:31:24 2017 -0800
@@ -275,7 +275,7 @@
     def path(self):
         return self._path
 
-    def renamed(self):
+    def copysource(self):
         return None
 
     def flags(self):