mercurial/commands.py
changeset 27808 0c48c566bab0
parent 27807 6ad5e134ef2e
child 27854 55394c6fe74e
--- a/mercurial/commands.py	Fri Jan 15 13:14:46 2016 -0800
+++ b/mercurial/commands.py	Fri Jan 15 13:14:46 2016 -0800
@@ -3869,12 +3869,8 @@
 
     Returns 0 on successful completion.
     '''
-    wlock = None
-    try:
-        wlock = repo.wlock()
+    with repo.wlock():
         return _dograft(ui, repo, *revs, **opts)
-    finally:
-        release(wlock)
 
 def _dograft(ui, repo, *revs, **opts):
     revs = list(revs)