# HG changeset patch # User Pierre-Yves David # Date 2012-12-17 17:09:41 # Node ID ee3b5fb648c70f5595cca6cd396666dabcf803bb # Parent 717c692fa4496a2fe48232d1a7e5f96a4f6f17d2 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. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -25,8 +25,12 @@ class changectx(object): 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)