[PATCH 40 of 41] basefilectx: move copies from filectx

Sean Farley sean.michael.farley at gmail.com
Mon Aug 12 16:27:36 UTC 2013


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1376280370 18000
#      Sun Aug 11 23:06:10 2013 -0500
# Node ID 3ff4552ea7280928297d313cfac7e46675a31bd3
# Parent  7a90f67b36bc157dfecd81512b62e7eccbfbce0c
basefilectx: move copies from filectx

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -720,10 +720,18 @@
             if not visit:
                 break
             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."""
     def __init__(self, repo, path, changeid=None, fileid=None,
                  filelog=None, changectx=None):
@@ -811,18 +819,10 @@
         # hard for renames
         c = self._filelog.children(self._filenode)
         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.
     date - any valid date string or (unixtime, offset), or None.
     user - username string, or None.



More information about the Mercurial-devel mailing list