clfilter: ensure context raise RepoLookupError when the revision is filtered
Currently the code path of `changectx(filteredrepo, rev)` call
`filteredrepo.changelog.node(rev)`. When `rev` is filtered this raise an
unhandled `IndexError`. This case now raise a `RepoLookupError` as other
error case do.
--- a/mercurial/context.py Mon Dec 17 15:08:37 2012 -0800
+++ b/mercurial/context.py Mon Dec 17 18:09:41 2012 +0100
@@ -25,8 +25,12 @@
self._repo = repo
if isinstance(changeid, int):
+ try:
+ self._node = repo.changelog.node(changeid)
+ except IndexError:
+ raise error.RepoLookupError(
+ _("unknown revision '%s'") % changeid)
self._rev = changeid
- self._node = repo.changelog.node(changeid)
return
if isinstance(changeid, long):
changeid = str(changeid)