# HG changeset patch # User Brendan Cully # Date 1159903707 25200 # Node ID 1539f788e913de76a3b8074d996ea47a4a92ff8e # Parent a184cd0c2db9fc470d0ed5c505fbefc64ee092c2 Make changectx.filenode raise repo.LookupError on failure diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -73,8 +73,14 @@ class changectx(object): def filenode(self, path): if hasattr(self, "_manifest"): - return self._manifest[path] + try: + return self._manifest[path] + except KeyError: + raise repo.LookupError(_("'%s' not found in manifest") % path) node, flag = self._repo.manifest.find(self._changeset[0], path) + if not node: + raise repo.LookupError(_("'%s' not found in manifest") % path) + return node def filectx(self, path, fileid=None):