# HG changeset patch # User Pierre-Yves David # Date 2014-10-16 00:02:44 # Node ID f00813325c5ad971fb351e5b5ae9db43f7e7b3e3 # Parent b50ed6b9b5133e129776af8c7ab7fd5d854e41f2 repoview: add a FilteredIndexError class This exception is a more precise IndexError that will allow us to issue a special message when we end up accessing a filtered revision. diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -196,25 +196,25 @@ class changelog(revlog.revlog): def node(self, rev): """filtered version of revlog.node""" if rev in self.filteredrevs: - raise IndexError(rev) + raise error.FilteredIndexError(rev) return super(changelog, self).node(rev) def linkrev(self, rev): """filtered version of revlog.linkrev""" if rev in self.filteredrevs: - raise IndexError(rev) + raise error.FilteredIndexError(rev) return super(changelog, self).linkrev(rev) def parentrevs(self, rev): """filtered version of revlog.parentrevs""" if rev in self.filteredrevs: - raise IndexError(rev) + raise error.FilteredIndexError(rev) return super(changelog, self).parentrevs(rev) def flags(self, rev): """filtered version of revlog.flags""" if rev in self.filteredrevs: - raise IndexError(rev) + raise error.FilteredIndexError(rev) return super(changelog, self).flags(rev) def delayupdate(self): diff --git a/mercurial/error.py b/mercurial/error.py --- a/mercurial/error.py +++ b/mercurial/error.py @@ -16,6 +16,9 @@ imports. class RevlogError(Exception): pass +class FilteredIndexError(IndexError): + pass + class LookupError(RevlogError, KeyError): def __init__(self, name, index, message): self.name = name