Patchwork D7235: repoview: extract a function for wrapping changelog

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

Comments

phabricator - Nov. 6, 2019, 3:37 a.m.
Closed by commit rHG53bc486e2e01: repoview: extract a function for wrapping changelog (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/D7235?vs=17565&id=17585

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

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

AFFECTED FILES
  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
@@ -217,6 +217,10 @@ 
         repo.filteredrevcache[filtername] = func(repo.unfiltered())
     return repo.filteredrevcache[filtername]
 
+def wrapchangelog(unfichangelog, filteredrevs):
+    cl = copy.copy(unfichangelog)
+    cl.filteredrevs = filteredrevs
+    return cl
 
 class repoview(object):
     """Provide a read/write view of a repo through a filtered changelog
@@ -286,8 +290,7 @@ 
             cl = None
         # could have been made None by the previous if
         if cl is None:
-            cl = copy.copy(unfichangelog)
-            cl.filteredrevs = revs
+            cl = wrapchangelog(unfichangelog, revs)
             object.__setattr__(self, r'_clcache', cl)
             object.__setattr__(self, r'_clcachekey', newkey)
         return cl