mercurial/commands.py
changeset 27854 55394c6fe74e
parent 27808 0c48c566bab0
child 27855 5b675a5665ef
--- a/mercurial/commands.py	Fri Jan 15 13:14:49 2016 -0800
+++ b/mercurial/commands.py	Fri Jan 15 13:14:49 2016 -0800
@@ -6932,8 +6932,7 @@
     if rev is None or rev == '':
         rev = node
 
-    wlock = repo.wlock()
-    try:
+    with repo.wlock():
         cmdutil.clearunfinished(repo)
 
         if date:
@@ -6980,8 +6979,6 @@
                 ui.status(_("(leaving bookmark %s)\n") %
                           repo._activebookmark)
             bookmarks.deactivate(repo)
-    finally:
-        wlock.release()
 
     return ret