Patchwork [02,of,41] basefilectx: move _filelog from filectx

login
register
mail settings
Submitter Sean Farley
Date Aug. 12, 2013, 4:26 p.m.
Message ID <dffad92ab7095f1e715b.1376324818@laptop.local>
Download mbox | patch
Permalink /patch/2129/
State Accepted
Commit dffad92ab7095f1e715b2fcb59e4826cd9bdbabc
Headers show

Comments

Sean Farley - Aug. 12, 2013, 4:26 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1376278859 18000
#      Sun Aug 11 22:40:59 2013 -0500
# Node ID dffad92ab7095f1e715b2fcb59e4826cd9bdbabc
# Parent  c19f46b904b99937a9391f4f98f01f3b7aee3ba9
basefilectx: move _filelog from filectx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -417,10 +417,14 @@ 
                     directory,
     memfilectx: a filecontext that represents files in-memory."""
     def __new__(cls, repo, path, *args, **kwargs):
         return super(basefilectx, cls).__new__(cls)
 
+    @propertycache
+    def _filelog(self):
+        return self._repo.file(self._path)
+
 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):
@@ -467,14 +471,10 @@ 
             # complicated to solve. Proper handling of the issue here should be
             # considered when solving linkrev issue are on the table.
             return changectx(self._repo.unfiltered(), self._changeid)
 
     @propertycache
-    def _filelog(self):
-        return self._repo.file(self._path)
-
-    @propertycache
     def _changeid(self):
         if '_changeid' in self.__dict__:
             return self._changeid
         elif '_changectx' in self.__dict__:
             return self._changectx.rev()