changeset 3337:b02e60097bbe

changectx: search manifest delta for filenode
author Brendan Cully <brendan@kublai.com>
date Wed, 11 Oct 2006 13:56:35 -0700
parents e44eadc92ec4
children 04fa31a43b93
files mercurial/context.py
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)