Skip to content
Snippets Groups Projects
Commit 4ff0e234 authored by Bryan O'Sullivan's avatar Bryan O'Sullivan
Browse files

with: use context manager for transaction in pushphase

parent 60ea60fe
Branches
Tags
No related merge requests found
......@@ -409,6 +409,5 @@
newphase = abs(int(newphasestr)) # let's avoid negative index surprise
oldphase = abs(int(oldphasestr)) # let's avoid negative index surprise
if currentphase == oldphase and newphase < oldphase:
try:
tr = repo.transaction('pushkey-phase')
with repo.transaction('pushkey-phase') as tr:
advanceboundary(repo, tr, newphase, [bin(nhex)])
......@@ -414,7 +413,4 @@
advanceboundary(repo, tr, newphase, [bin(nhex)])
tr.close()
finally:
tr.release()
return 1
elif currentphase == newphase:
# raced, but got correct result
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment