hgext/mq.py
changeset 27831 62f3126ef678
parent 27830 1c5941542f24
child 27832 1e38b9d731c4
--- a/hgext/mq.py	Fri Jan 15 13:14:47 2016 -0800
+++ b/hgext/mq.py	Fri Jan 15 13:14:47 2016 -0800
@@ -2715,14 +2715,11 @@
         message = '\n'.join(message)
 
     diffopts = q.patchopts(q.diffopts(), *patches)
-    wlock = repo.wlock()
-    try:
+    with repo.wlock():
         q.refresh(repo, msg=message, git=diffopts.git, edit=opts.get('edit'),
                   editform='mq.qfold')
         q.delete(repo, patches, opts)
         q.savedirty()
-    finally:
-        wlock.release()
 
 @command("qgoto",
          [('', 'keep-changes', None,