Patchwork D6204: branchmap: dynamically resolve type of branchcache class

login
register
mail settings
Submitter phabricator
Date April 5, 2019, 1:31 p.m.
Message ID <differential-rev-PHID-DREV-3kqyd2i4htmwk2pi3zvl-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39501/
State Superseded
Headers show

Comments

phabricator - April 5, 2019, 1:31 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is required to support subclassing.
  Thanks to Yuya for suggesting this in https://phab.mercurial-scm.org/D6151.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/branchmap.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -305,7 +305,7 @@ 
 
     def copy(self):
         """return an deep copy of the branchcache object"""
-        return branchcache(
+        return type(self)(
             self._entries, self.tipnode, self.tiprev, self.filteredhash,
             self._closednodes)