mercurial/hbisect.py
changeset 27853 9b8a5c6ac176
parent 27525 cba62f996780
child 30065 ee21ed7fc7a2
equal deleted inserted replaced
27852:a33c1c9e769c 27853:9b8a5c6ac176
   151     return state
   151     return state
   152 
   152 
   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     """
   167     Return a list of revision(s) that match the given status:
   164     Return a list of revision(s) that match the given status:
   168 
   165