comparison hgext3rd/serverminitopic.py @ 5193:a4d081923c81

compat: update hg-X.Y compat comments and test them
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 10 Mar 2020 19:05:08 +0700
parents 515d425c0a05
children 2c5e4339538a
comparison
equal deleted inserted replaced
5192:f5b366a31740 5193:a4d081923c81
156 def copy(self): 156 def copy(self):
157 """return an deep copy of the branchcache object""" 157 """return an deep copy of the branchcache object"""
158 if util.safehasattr(self, '_entries'): 158 if util.safehasattr(self, '_entries'):
159 _entries = self._entries 159 _entries = self._entries
160 else: 160 else:
161 # hg <= 4.9 (624d6683c705, b137a6793c51) 161 # hg <= 4.9 (624d6683c705+b137a6793c51)
162 _entries = self 162 _entries = self
163 new = self.__class__(_entries, self.tipnode, self.tiprev, 163 new = self.__class__(_entries, self.tipnode, self.tiprev,
164 self.filteredhash, self._closednodes) 164 self.filteredhash, self._closednodes)
165 new.phaseshash = self.phaseshash 165 new.phaseshash = self.phaseshash
166 return new 166 return new
230 assert issubclass(current, new), (current, new, targetclass) 230 assert issubclass(current, new), (current, new, targetclass)
231 231
232 def uisetup(ui): 232 def uisetup(ui):
233 wrapclass(branchmap, 'branchcache', _topiccache) 233 wrapclass(branchmap, 'branchcache', _topiccache)
234 try: 234 try:
235 # Mercurial 4.8 and older 235 # hg <= 4.9 (3461814417f3)
236 extensions.wrapfunction(branchmap, 'read', wrapread) 236 extensions.wrapfunction(branchmap, 'read', wrapread)
237 except AttributeError: 237 except AttributeError:
238 # Mercurial 4.9; branchcache.fromfile now takes care of this 238 # Mercurial 5.0; branchcache.fromfile now takes care of this
239 # which is alredy defined on _topiccache 239 # which is alredy defined on _topiccache
240 pass 240 pass
241 extensions.wrapfunction(wireprotov1server, '_capabilities', wireprotocaps) 241 extensions.wrapfunction(wireprotov1server, '_capabilities', wireprotocaps)
242 extensions.wrapfunction(context.changectx, 'branch', topicbranch) 242 extensions.wrapfunction(context.changectx, 'branch', topicbranch)