changeset 18232:dd0b636b0b65

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.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 02 Jan 2013 01:40:42 +0100
parents c0c943ef4e55
children 59a9f18d4587
files mercurial/branchmap.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/branchmap.py	Wed Jan 02 01:40:06 2013 +0100
+++ b/mercurial/branchmap.py	Wed Jan 02 01:40:42 2013 +0100
@@ -117,6 +117,9 @@
         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: