basefilectx: move copies from filectx
authorSean Farley <sean.michael.farley@gmail.com>
Sun, 11 Aug 2013 23:06:10 -0500
changeset 19611 bae0493b6dc0
parent 19610 0670422d58c6
child 19612 df54cc67b91b
basefilectx: move copies from filectx
mercurial/context.py
--- a/mercurial/context.py	Sun Aug 11 23:05:50 2013 -0500
+++ b/mercurial/context.py	Sun Aug 11 23:06:10 2013 -0500
@@ -722,6 +722,14 @@
             c = visit.pop(max(visit))
             yield c
 
+    def copies(self, c2):
+        if not util.safehasattr(self, "_copycache"):
+            self._copycache = {}
+        sc2 = str(c2)
+        if sc2 not in self._copycache:
+            self._copycache[sc2] = copies.pathcopies(c2)
+        return self._copycache[sc2]
+
 class filectx(basefilectx):
     """A filecontext object makes access to data related to a particular
        filerevision convenient."""
@@ -813,14 +821,6 @@
         return [filectx(self._repo, self._path, fileid=x,
                         filelog=self._filelog) for x in c]
 
-    def copies(self, c2):
-        if not util.safehasattr(self, "_copycache"):
-            self._copycache = {}
-        sc2 = str(c2)
-        if sc2 not in self._copycache:
-            self._copycache[sc2] = copies.pathcopies(c2)
-        return self._copycache[sc2]
-
 class workingctx(basectx):
     """A workingctx object makes access to data related to
     the current working directory convenient.