mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
with: use context manager in bisect save_state
This commit is contained in:
parent
ff05835c28
commit
9e950df349
@ -153,14 +153,11 @@ def load_state(repo):
|
||||
|
||||
def save_state(repo, state):
|
||||
f = repo.vfs("bisect.state", "w", atomictemp=True)
|
||||
wlock = repo.wlock()
|
||||
try:
|
||||
with repo.wlock():
|
||||
for kind in sorted(state):
|
||||
for node in state[kind]:
|
||||
f.write("%s %s\n" % (kind, hex(node)))
|
||||
f.close()
|
||||
finally:
|
||||
wlock.release()
|
||||
|
||||
def get(repo, status):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user