Mercurial > hg > mercurial-crew-with-dirclash
diff mercurial/context.py @ 3242:1539f788e913
Make changectx.filenode raise repo.LookupError on failure
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Tue, 03 Oct 2006 12:28:27 -0700 |
parents | a184cd0c2db9 |
children | 45f0c49f0449 |
line wrap: on
line diff
--- 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):