with: use context manager in qfinish
authorBryan O'Sullivan <bryano@fb.com>
Fri, 15 Jan 2016 13:14:50 -0800
changeset 27847 71853c0ba592
parent 27846 63821023ea79
child 27848 9bda75a0c783
with: use context manager in qfinish
hgext/mq.py
--- a/hgext/mq.py	Fri Jan 15 13:14:50 2016 -0800
+++ b/hgext/mq.py	Fri Jan 15 13:14:50 2016 -0800
@@ -3199,12 +3199,9 @@
     # queue.finish may changes phases but leave the responsibility to lock the
     # repo to the caller to avoid deadlock with wlock. This command code is
     # responsibility for this locking.
-    lock = repo.lock()
-    try:
+    with repo.lock():
         q.finish(repo, revs)
         q.savedirty()
-    finally:
-        lock.release()
     return 0
 
 @command("qqueue",