changeset 4450:9b0cde5efbc9 stable

topicmap: add compatibility for branchcache that now uses self._entries
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 27 Mar 2019 20:52:30 +0800
parents 4a00de50bb3b
children a019067fea9e d46360b8c0dc
files hgext3rd/topic/topicmap.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/topicmap.py	Wed Mar 27 14:29:22 2019 +0530
+++ b/hgext3rd/topic/topicmap.py	Wed Mar 27 20:52:30 2019 +0800
@@ -9,6 +9,7 @@
     cmdutil,
     extensions,
     repoview,
+    util,
 )
 
 basefilter = set(['base', 'immutable'])
@@ -150,8 +151,13 @@
 
     def copy(self):
         """return an deep copy of the branchcache object"""
-        new = self.__class__(self, self.tipnode, self.tiprev, self.filteredhash,
-                             self._closednodes)
+        if util.safehasattr(self, '_entries'):
+            _entries = self._entries
+        else:
+            # hg <= 4.9 (624d6683c705, b137a6793c51)
+            _entries = self
+        new = self.__class__(_entries, self.tipnode, self.tiprev,
+                             self.filteredhash, self._closednodes)
         new.phaseshash = self.phaseshash
         return new