comparison hgext3rd/topic/topicmap.py @ 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 49d442a2207f
children a019067fea9e d46360b8c0dc
comparison
equal deleted inserted replaced
4449:4a00de50bb3b 4450:9b0cde5efbc9
7 branchmap, 7 branchmap,
8 changegroup, 8 changegroup,
9 cmdutil, 9 cmdutil,
10 extensions, 10 extensions,
11 repoview, 11 repoview,
12 util,
12 ) 13 )
13 14
14 basefilter = set(['base', 'immutable']) 15 basefilter = set(['base', 'immutable'])
15 def topicfilter(name): 16 def topicfilter(name):
16 """return a "topic" version of a filter level""" 17 """return a "topic" version of a filter level"""
148 super(_topiccache, self).__init__(*args, **kwargs) 149 super(_topiccache, self).__init__(*args, **kwargs)
149 self.phaseshash = None 150 self.phaseshash = None
150 151
151 def copy(self): 152 def copy(self):
152 """return an deep copy of the branchcache object""" 153 """return an deep copy of the branchcache object"""
153 new = self.__class__(self, self.tipnode, self.tiprev, self.filteredhash, 154 if util.safehasattr(self, '_entries'):
154 self._closednodes) 155 _entries = self._entries
156 else:
157 # hg <= 4.9 (624d6683c705, b137a6793c51)
158 _entries = self
159 new = self.__class__(_entries, self.tipnode, self.tiprev,
160 self.filteredhash, self._closednodes)
155 new.phaseshash = self.phaseshash 161 new.phaseshash = self.phaseshash
156 return new 162 return new
157 163
158 def branchtip(self, branch, topic=''): 164 def branchtip(self, branch, topic=''):
159 '''Return the tipmost open head on branch head, otherwise return the 165 '''Return the tipmost open head on branch head, otherwise return the