repoview: add a FilteredLookupError class
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 16 Oct 2014 02:05:06 -0700
changeset 23015 21c44c1aed87
parent 23014 f00813325c5a
child 23016 2bd51e61c65e
repoview: add a FilteredLookupError class This exception is a more precise LookupError that will allow us to issue a special message when we end up accessing a filtered revision.
mercurial/changelog.py
mercurial/error.py
--- a/mercurial/changelog.py	Wed Oct 15 17:02:44 2014 -0700
+++ b/mercurial/changelog.py	Thu Oct 16 02:05:06 2014 -0700
@@ -190,7 +190,8 @@
         """filtered version of revlog.rev"""
         r = super(changelog, self).rev(node)
         if r in self.filteredrevs:
-            raise error.LookupError(hex(node), self.indexfile, _('no node'))
+            raise error.FilteredLookupError(hex(node), self.indexfile,
+                                            _('filtered node'))
         return r
 
     def node(self, rev):
--- a/mercurial/error.py	Wed Oct 15 17:02:44 2014 -0700
+++ b/mercurial/error.py	Thu Oct 16 02:05:06 2014 -0700
@@ -30,6 +30,9 @@
     def __str__(self):
         return RevlogError.__str__(self)
 
+class FilteredLookupError(LookupError):
+    pass
+
 class ManifestLookupError(LookupError):
     pass