D6204: branchmap: dynamically resolve type of branchcache class

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Fri Apr 5 13:31:22 UTC 2019


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

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)
 



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


More information about the Mercurial-devel mailing list