Patchwork D7242: repoview: move changelog.strip() override to filteredchangelog

login
register
mail settings
Submitter phabricator
Date Nov. 6, 2019, 3:39 a.m.
Message ID <99d284cbb0c3d6af7e8138a4e642c46f@localhost.localdomain>
Download mbox | patch
Permalink /patch/42788/
State Not Applicable
Headers show

Comments

phabricator - Nov. 6, 2019, 3:39 a.m.
Closed by commit rHGa7ec09043cb8: repoview: move changelog.strip() 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/D7242?vs=17572&id=17592

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

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

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

CHANGE DETAILS




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

Patch

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