comparison tests/testlib/persistent-nodemap-race-ext.py @ 52668:5cc8deb96b48

pyupgrade: modernize calls to superclass methods This is the `legacy` fixer in `pyupgrade`, with the loop yielding the offset of `yield` statements commented out.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 05 Jan 2025 22:23:31 -0500
parents 805d4a462abb
children
comparison
equal deleted inserted replaced
52667:73ab542565e0 52668:5cc8deb96b48
217 testing.write_file(FILE_RIGHT_CL_NODEMAP_READ) 217 testing.write_file(FILE_RIGHT_CL_NODEMAP_READ)
218 print('nodemap-race: right side reading of changelog is done') 218 print('nodemap-race: right side reading of changelog is done')
219 print_nodemap_details(cl) 219 print_nodemap_details(cl)
220 testing.wait_file(FILE_LEFT_CL_NODEMAP_WRITE) 220 testing.wait_file(FILE_LEFT_CL_NODEMAP_WRITE)
221 print('nodemap-race: right side ready to wait for the lock') 221 print('nodemap-race: right side ready to wait for the lock')
222 ret = super(RacedRepo, self).lock(wait=wait) 222 ret = super().lock(wait=wait)
223 if newlock and _role(self) == LEFT: 223 if newlock and _role(self) == LEFT:
224 print('nodemap-race: left side locked and ready to commit') 224 print('nodemap-race: left side locked and ready to commit')
225 testing.write_file(FILE_LEFT_LOCKED) 225 testing.write_file(FILE_LEFT_LOCKED)
226 testing.wait_file(FILE_RIGHT_READY_TO_LOCK) 226 testing.wait_file(FILE_RIGHT_READY_TO_LOCK)
227 cl = self.unfiltered().changelog 227 cl = self.unfiltered().changelog
232 print_nodemap_details(cl) 232 print_nodemap_details(cl)
233 return ret 233 return ret
234 234
235 def transaction(self, *args, **kwargs): 235 def transaction(self, *args, **kwargs):
236 # duck punch the role on the transaction to help other pieces of code 236 # duck punch the role on the transaction to help other pieces of code
237 tr = super(RacedRepo, self).transaction(*args, **kwargs) 237 tr = super().transaction(*args, **kwargs)
238 tr._race_role = _role(self) 238 tr._race_role = _role(self)
239 return tr 239 return tr
240 240
241 localrepo.localrepository = RacedRepo 241 localrepo.localrepository = RacedRepo
242 242
259 @util.propertycache 259 @util.propertycache
260 def changelog(self): 260 def changelog(self):
261 print('reader ready to read the changelog, waiting for right') 261 print('reader ready to read the changelog, waiting for right')
262 testing.write_file(FILE_READER_READY) 262 testing.write_file(FILE_READER_READY)
263 testing.wait_file(FILE_RIGHT_CL_NODEMAP_PRE_WRITE) 263 testing.wait_file(FILE_RIGHT_CL_NODEMAP_PRE_WRITE)
264 return super(ReaderRepo, self).changelog 264 return super().changelog
265 265
266 repo.__class__ = ReaderRepo 266 repo.__class__ = ReaderRepo
267 267
268 268
269 @command(b'check-nodemap-race') 269 @command(b'check-nodemap-race')