repoview: move changelog.tiprev() override to filteredchangelog
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 05 Nov 2019 14:07:08 -0800
changeset 43443 7bc8e49a7c35
parent 43442 625e7d1ffd1c
child 43444 c470e699cd00
repoview: move changelog.tiprev() override to filteredchangelog Differential Revision: https://phab.mercurial-scm.org/D7237
mercurial/changelog.py
mercurial/repoview.py
--- a/mercurial/changelog.py	Tue Nov 05 14:06:11 2019 -0800
+++ b/mercurial/changelog.py	Tue Nov 05 14:07:08 2019 -0800
@@ -405,12 +405,6 @@
         self.filteredrevs = frozenset()
         self._copiesstorage = opener.options.get(b'copies-storage')
 
-    def tiprev(self):
-        """filtered version of revlog.tiprev"""
-        for i in pycompat.xrange(len(self) - 1, -2, -1):
-            if i not in self.filteredrevs:
-                return i
-
     def __contains__(self, rev):
         """filtered version of revlog.__contains__"""
         return 0 <= rev < len(self) and rev not in self.filteredrevs
--- a/mercurial/repoview.py	Tue Nov 05 14:06:11 2019 -0800
+++ b/mercurial/repoview.py	Tue Nov 05 14:07:08 2019 -0800
@@ -223,7 +223,11 @@
     cl.filteredrevs = filteredrevs
 
     class filteredchangelog(cl.__class__):
-        pass
+        def tiprev(self):
+            """filtered version of revlog.tiprev"""
+            for i in pycompat.xrange(len(self) - 1, -2, -1):
+                if i not in self.filteredrevs:
+                    return i
 
     cl.__class__ = filteredchangelog