with: use context manager in resolve
authorBryan O'Sullivan <bryano@fb.com>
Fri, 15 Jan 2016 13:14:49 -0800
changeset 27856 2b3a21052be9
parent 27855 5b675a5665ef
child 27857 b0b98e0a12f8
with: use context manager in resolve
mercurial/commands.py
--- a/mercurial/commands.py	Fri Jan 15 13:14:49 2016 -0800
+++ b/mercurial/commands.py	Fri Jan 15 13:14:49 2016 -0800
@@ -5899,8 +5899,7 @@
         fm.end()
         return 0
 
-    wlock = repo.wlock()
-    try:
+    with repo.wlock():
         ms = mergemod.mergestate.read(repo)
 
         if not (ms.active() or repo.dirstate.p2() != nullid):
@@ -6017,9 +6016,6 @@
                 if not proceed:
                     return 1
 
-    finally:
-        wlock.release()
-
     # Nudge users into finishing an unfinished operation
     unresolvedf = list(ms.unresolved())
     driverresolvedf = list(ms.driverresolved())