mercurial/manifest.py
changeset 30290 1a0c1ad57833
parent 30221 f2c5b9d48b29
child 30291 dc21ea3323c4
equal deleted inserted replaced
30289:1f92056c4066 30290:1a0c1ad57833
  1260         # We'll separate this into it's own cache once oldmanifest is no longer
  1260         # We'll separate this into it's own cache once oldmanifest is no longer
  1261         # used
  1261         # used
  1262         self._mancache = self._oldmanifest._mancache
  1262         self._mancache = self._oldmanifest._mancache
  1263 
  1263 
  1264     def __getitem__(self, node):
  1264     def __getitem__(self, node):
  1265         """Retrieves the manifest instance for the given node. Throws a KeyError
  1265         """Retrieves the manifest instance for the given node. Throws a
  1266         if not found.
  1266         LookupError if not found.
  1267         """
  1267         """
  1268         if node in self._mancache:
  1268         if node in self._mancache:
  1269             cachemf = self._mancache[node]
  1269             cachemf = self._mancache[node]
  1270             # The old manifest may put non-ctx manifests in the cache, so skip
  1270             # The old manifest may put non-ctx manifests in the cache, so skip
  1271             # those since they don't implement the full api.
  1271             # those since they don't implement the full api.
  1272             if (isinstance(cachemf, manifestctx) or
  1272             if (isinstance(cachemf, manifestctx) or
  1273                 isinstance(cachemf, treemanifestctx)):
  1273                 isinstance(cachemf, treemanifestctx)):
  1274                 return cachemf
  1274                 return cachemf
  1275 
  1275 
       
  1276         if node not in self._revlog.nodemap:
       
  1277             raise LookupError(node, self._revlog.indexfile,
       
  1278                               _('no node'))
  1276         if self._treeinmem:
  1279         if self._treeinmem:
  1277             m = treemanifestctx(self._repo, '', node)
  1280             m = treemanifestctx(self._repo, '', node)
  1278         else:
  1281         else:
  1279             m = manifestctx(self._repo, node)
  1282             m = manifestctx(self._repo, node)
  1280         if node != revlog.nullid:
  1283         if node != revlog.nullid: