Patchwork [04,of,41] basefilectx: move _filenode from filectx

login
register
mail settings
Submitter Sean Farley
Date Aug. 12, 2013, 4:27 p.m.
Message ID <5a868137b83032daf8f3.1376324820@laptop.local>
Download mbox | patch
Permalink /patch/2131/
State Accepted
Commit 5a868137b83032daf8f3affac4f44d35e243cfa8
Headers show

Comments

Sean Farley - Aug. 12, 2013, 4:27 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1376279059 18000
#      Sun Aug 11 22:44:19 2013 -0500
# Node ID 5a868137b83032daf8f3affac4f44d35e243cfa8
# Parent  a014367989887106e7bc3d31ee3ab4806ebaeb08
basefilectx: move _filenode from filectx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -430,10 +430,17 @@ 
         elif '_changectx' in self.__dict__:
             return self._changectx.rev()
         else:
             return self._filelog.linkrev(self._filerev)
 
+    @propertycache
+    def _filenode(self):
+        if '_fileid' in self.__dict__:
+            return self._filelog.lookup(self._fileid)
+        else:
+            return self._changectx.filenode(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):
@@ -480,17 +487,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 _filenode(self):
-        if '_fileid' in self.__dict__:
-            return self._filelog.lookup(self._fileid)
-        else:
-            return self._changectx.filenode(self._path)
-
-    @propertycache
     def _filerev(self):
         return self._filelog.rev(self._filenode)
 
     @propertycache
     def _repopath(self):