changectx: search manifest delta for filenode
authorBrendan Cully <brendan@kublai.com>
Wed, 11 Oct 2006 13:56:35 -0700
changeset 3337 b02e60097bbe
parent 3336 e44eadc92ec4
child 3351 04fa31a43b93
changectx: search manifest delta for filenode
mercurial/context.py
--- a/mercurial/context.py	Wed Oct 11 13:34:12 2006 -0700
+++ b/mercurial/context.py	Wed Oct 11 13:56:35 2006 -0700
@@ -48,6 +48,10 @@
         elif name == '_manifest':
             self._manifest = self._repo.manifest.read(self._changeset[0])
             return self._manifest
+        elif name == '_manifestdelta':
+            md = self._repo.manifest.readdelta(self._changeset[0])
+            self._manifestdelta = md
+            return self._manifestdelta
         else:
             raise AttributeError, name
 
@@ -77,6 +81,9 @@
                 return self._manifest[path]
             except KeyError:
                 raise repo.LookupError(_("'%s' not found in manifest") % path)
+        if '_manifestdelta' in self.__dict__ or path in self.files():
+            if path in self._manifestdelta:
+                return self._manifestdelta[path]
         node, flag = self._repo.manifest.find(self._changeset[0], path)
         if not node:
             raise repo.LookupError(_("'%s' not found in manifest") % path)