D7237: repoview: move changelog.tiprev() override to filteredchangelog

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Nov 5 22:38:00 EST 2019


Closed by commit rHG2ef8acf6c7cf: repoview: move changelog.tiprev() override to filteredchangelog (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7237?vs=17567&id=17587

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7237/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7237

AFFECTED FILES
  mercurial/changelog.py
  mercurial/repoview.py

CHANGE DETAILS

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -222,7 +222,12 @@
     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
 
diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -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



To: martinvonz, #hg-reviewers, indygreg
Cc: mercurial-devel


More information about the Mercurial-devel mailing list