basectx: move _fileinfo from changectx
authorSean Farley <sean.michael.farley@gmail.com>
Mon, 05 Aug 2013 18:28:23 -0500
changeset 19559 80ad9fe22e18
parent 19558 d0448e9d4554
child 19560 f256e1108053
basectx: move _fileinfo from changectx
mercurial/context.py
--- a/mercurial/context.py	Mon Aug 05 18:26:54 2013 -0500
+++ b/mercurial/context.py	Mon Aug 05 18:28:23 2013 -0500
@@ -92,6 +92,24 @@
             return self._parents[1]
         return changectx(self._repo, -1)
 
+    def _fileinfo(self, path):
+        if '_manifest' in self.__dict__:
+            try:
+                return self._manifest[path], self._manifest.flags(path)
+            except KeyError:
+                raise error.ManifestLookupError(self._node, path,
+                                                _('not found in manifest'))
+        if '_manifestdelta' in self.__dict__ or path in self.files():
+            if path in self._manifestdelta:
+                return (self._manifestdelta[path],
+                        self._manifestdelta.flags(path))
+        node, flag = self._repo.manifest.find(self._changeset[0], path)
+        if not node:
+            raise error.ManifestLookupError(self._node, path,
+                                            _('not found in manifest'))
+
+        return node, flag
+
 class changectx(basectx):
     """A changecontext object makes access to data related to a particular
     changeset convenient. It represents a read-only context already presnt in
@@ -313,24 +331,6 @@
             troubles.append('divergent')
         return troubles
 
-    def _fileinfo(self, path):
-        if '_manifest' in self.__dict__:
-            try:
-                return self._manifest[path], self._manifest.flags(path)
-            except KeyError:
-                raise error.ManifestLookupError(self._node, path,
-                                                _('not found in manifest'))
-        if '_manifestdelta' in self.__dict__ or path in self.files():
-            if path in self._manifestdelta:
-                return (self._manifestdelta[path],
-                        self._manifestdelta.flags(path))
-        node, flag = self._repo.manifest.find(self._changeset[0], path)
-        if not node:
-            raise error.ManifestLookupError(self._node, path,
-                                            _('not found in manifest'))
-
-        return node, flag
-
     def filenode(self, path):
         return self._fileinfo(path)[0]