changeset 23014:f00813325c5a

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 15 Oct 2014 17:02:44 -0700
parents b50ed6b9b513
children 21c44c1aed87
files mercurial/changelog.py mercurial/error.py
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changelog.py	Wed Oct 15 16:14:50 2014 -0700
+++ b/mercurial/changelog.py	Wed Oct 15 17:02:44 2014 -0700
@@ -196,25 +196,25 @@
     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):
--- a/mercurial/error.py	Wed Oct 15 16:14:50 2014 -0700
+++ b/mercurial/error.py	Wed Oct 15 17:02:44 2014 -0700
@@ -16,6 +16,9 @@
 class RevlogError(Exception):
     pass
 
+class FilteredIndexError(IndexError):
+    pass
+
 class LookupError(RevlogError, KeyError):
     def __init__(self, name, index, message):
         self.name = name