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)