Patchwork [40,of,41] basefilectx: move copies from filectx

login
register
mail settings
Submitter Sean Farley
Date Aug. 12, 2013, 4:27 p.m.
Message ID <3ff4552ea7280928297d.1376324856@laptop.local>
Download mbox | patch
Permalink /patch/2167/
State Accepted
Commit bae0493b6dc05ecf08c94aca5ca0431cb39818fc
Headers show

Comments

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

Patch

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.