# HG changeset patch # User Pierre-Yves David # Date 2013-01-02 00:40:42 # Node ID dd0b636b0b658546f9318d857a0f91e8f6587033 # Parent c0c943ef4e5530c73c9c2302b552e4ce3cb4cd93 branchmap: add a copy method If we want branchcache of different filter to collaborate, they need a simple way to copy each other. This will ensure that each filtered have no side effect on other filter level cache. diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py --- a/mercurial/branchmap.py +++ b/mercurial/branchmap.py @@ -117,6 +117,9 @@ class branchcache(dict): except IndexError: return False + def copy(self): + """return an deep copy of the branchcache object""" + return branchcache(self, self.tipnode, self.tiprev, self.filteredhash) def write(self, repo): try: