changeset 27854:55394c6fe74e

with: use context manager in update
author Bryan O'Sullivan <bryano@fb.com>
date Fri, 15 Jan 2016 13:14:49 -0800
parents 9b8a5c6ac176
children 5b675a5665ef
files mercurial/commands.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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