changeset 43448:c31fa28d1843

repoview: move changelog.strip() override to filteredchangelog Differential Revision: https://phab.mercurial-scm.org/D7242
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 05 Nov 2019 14:17:58 -0800
parents 476754edac1f
children c45195f9af0a
files mercurial/changelog.py mercurial/repoview.py
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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