Patchwork D6010: context: move equivalent renamed() implementations to superclass

login
register
mail settings
Submitter phabricator
Date Feb. 24, 2019, 8:24 a.m.
Message ID <9cddba627ea145be7261d34d94d3f8ef@localhost.localdomain>
Download mbox | patch
Permalink /patch/38897/
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 rHGc7a843aa4b42: context: move equivalent renamed() implementations to superclass (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6010?vs=14198&id=14213

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1664,6 +1664,12 @@ 
         # linked to self._changectx no matter if file is modified or not
         return self.rev()
 
+    def renamed(self):
+        path = self.copysource()
+        if not path:
+            return None
+        return path, self._changectx._parents[0]._manifest.get(path, nullid)
+
     def parents(self):
         '''return parent filectxs, following copies if necessary'''
         def filenode(ctx, path):
@@ -1700,11 +1706,6 @@ 
 
     def data(self):
         return self._repo.wread(self._path)
-    def renamed(self):
-        rp = self.copysource()
-        if not rp:
-            return None
-        return rp, self._changectx._parents[0]._manifest.get(rp, nullid)
     def copysource(self):
         return self._repo.dirstate.copied(self._path)
 
@@ -2146,12 +2147,6 @@ 
     def lexists(self):
         return self._parent.exists(self._path)
 
-    def renamed(self):
-        path = self.copysource()
-        if not path:
-            return None
-        return path, self._changectx._parents[0]._manifest.get(path, nullid)
-
     def copysource(self):
         return self._parent.copydata(self._path)