hgext/mq.py
changeset 27830 1c5941542f24
parent 27829 bab359a3cf49
child 27831 62f3126ef678
--- a/hgext/mq.py	Fri Jan 15 13:14:47 2016 -0800
+++ b/hgext/mq.py	Fri Jan 15 13:14:47 2016 -0800
@@ -2627,13 +2627,10 @@
     q = repo.mq
     message = cmdutil.logmessage(ui, opts)
     setupheaderopts(ui, opts)
-    wlock = repo.wlock()
-    try:
+    with repo.wlock():
         ret = q.refresh(repo, pats, msg=message, **opts)
         q.savedirty()
         return ret
-    finally:
-        wlock.release()
 
 @command("^qdiff",
          commands.diffopts + commands.diffopts2 + commands.walkopts,