##// END OF EJS Templates
with: use context manager in bisect save_state
Bryan O'Sullivan -
r27853:9b8a5c6a default
parent child Browse files
Show More
@@ -153,14 +153,11 b' def load_state(repo):'
153
153
154 def save_state(repo, state):
154 def save_state(repo, state):
155 f = repo.vfs("bisect.state", "w", atomictemp=True)
155 f = repo.vfs("bisect.state", "w", atomictemp=True)
156 wlock = repo.wlock()
156 with repo.wlock():
157 try:
158 for kind in sorted(state):
157 for kind in sorted(state):
159 for node in state[kind]:
158 for node in state[kind]:
160 f.write("%s %s\n" % (kind, hex(node)))
159 f.write("%s %s\n" % (kind, hex(node)))
161 f.close()
160 f.close()
162 finally:
163 wlock.release()
164
161
165 def get(repo, status):
162 def get(repo, status):
166 """
163 """
General Comments 0
You need to be logged in to leave comments. Login now