##// END OF EJS Templates
pushkey: wrap pushkey phase movement in a transaction...
Pierre-Yves David -
r22052:793f9276 default
parent child Browse files
Show More
@@ -331,13 +331,16 b' def listphases(repo):'
331 331 def pushphase(repo, nhex, oldphasestr, newphasestr):
332 332 """List phases root for serialization over pushkey"""
333 333 repo = repo.unfiltered()
334 tr = None
334 335 lock = repo.lock()
335 336 try:
336 337 currentphase = repo[nhex].phase()
337 338 newphase = abs(int(newphasestr)) # let's avoid negative index surprise
338 339 oldphase = abs(int(oldphasestr)) # let's avoid negative index surprise
339 340 if currentphase == oldphase and newphase < oldphase:
341 tr = repo.transaction('pushkey-phase')
340 342 advanceboundary(repo, newphase, [bin(nhex)])
343 tr.close()
341 344 return 1
342 345 elif currentphase == newphase:
343 346 # raced, but got correct result
@@ -345,6 +348,8 b' def pushphase(repo, nhex, oldphasestr, n'
345 348 else:
346 349 return 0
347 350 finally:
351 if tr:
352 tr.release()
348 353 lock.release()
349 354
350 355 def analyzeremotephases(repo, subset, roots):
General Comments 0
You need to be logged in to leave comments. Login now