Patchwork D7240: repoview: move changelog.revs() override to filteredchangelog

login
register
mail settings
Submitter phabricator
Date Nov. 6, 2019, 12:59 a.m.
Message ID <differential-rev-PHID-DREV-jalnzvvhmh5zmdyvec57-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42766/
State Superseded
Headers show

Comments

phabricator - Nov. 6, 2019, 12:59 a.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

CHANGE DETAILS




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

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -246,6 +246,12 @@ 
 
             return filterediter()
 
+        def revs(self, start=0, stop=None):
+            """filtered version of revlog.revs"""
+            for i in super(filteredchangelog, self).revs(start, stop):
+                if i not in self.filteredrevs:
+                    yield i
+
     cl.__class__ = filteredchangelog
 
     return cl
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 revs(self, start=0, stop=None):
-        """filtered version of revlog.revs"""
-        for i in super(changelog, self).revs(start, stop):
-            if i not in self.filteredrevs:
-                yield i
-
     def _checknofilteredinrevs(self, revs):
         """raise the appropriate error if 'revs' contains a filtered revision