Patchwork D7236: repoview: wrap changelog class when filtering

login
register
mail settings
Submitter phabricator
Date Nov. 6, 2019, 12:59 a.m.
Message ID <differential-rev-PHID-DREV-ceadf47ci35qfikqgllm-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42762/
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.

REVISION SUMMARY
  The class doesn't yet do anything. I'll move the filter-aware
  overrides from the changelog class over one by one to this class in
  coming patches. That will leave the changelog class simpler and will
  centralize more of the filtering logic to repoview. I could not
  measure any performance difference.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  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
@@ -220,6 +220,12 @@ 
 def wrapchangelog(unfichangelog, filteredrevs):
     cl = copy.copy(unfichangelog)
     cl.filteredrevs = filteredrevs
+
+    class filteredchangelog(cl.__class__):
+        pass
+
+    cl.__class__ = filteredchangelog
+
     return cl
 
 class repoview(object):