repoview: move changelog.strip() override to filteredchangelog
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 05 Nov 2019 14:17:58 -0800
changeset 43448 c31fa28d1843
parent 43447 476754edac1f
child 43449 c45195f9af0a
repoview: move changelog.strip() override to filteredchangelog Differential Revision: https://phab.mercurial-scm.org/D7242
mercurial/changelog.py
mercurial/repoview.py
--- a/mercurial/changelog.py	Tue Nov 05 14:16:46 2019 -0800
+++ b/mercurial/changelog.py	Tue Nov 05 14:17:58 2019 -0800
@@ -404,12 +404,6 @@
         self.filteredrevs = frozenset()
         self._copiesstorage = opener.options.get(b'copies-storage')
 
-    def strip(self, *args, **kwargs):
-        # XXX make something better than assert
-        # We can't expect proper strip behavior if we are filtered.
-        assert not self.filteredrevs
-        super(changelog, self).strip(*args, **kwargs)
-
     def rev(self, node):
         """filtered version of revlog.rev"""
         r = super(changelog, self).rev(node)
--- a/mercurial/repoview.py	Tue Nov 05 14:16:46 2019 -0800
+++ b/mercurial/repoview.py	Tue Nov 05 14:17:58 2019 -0800
@@ -288,6 +288,12 @@
                 revs = self._checknofilteredinrevs(revs)
             return super(filteredchangelog, self).headrevs(revs)
 
+        def strip(self, *args, **kwargs):
+            # XXX make something better than assert
+            # We can't expect proper strip behavior if we are filtered.
+            assert not self.filteredrevs
+            super(filteredchangelog, self).strip(*args, **kwargs)
+
     cl.__class__ = filteredchangelog
 
     return cl