changeset 18084:ee3b5fb648c7

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.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 17 Dec 2012 18:09:41 +0100
parents 717c692fa449
children 4c53f015564f
files mercurial/context.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)