From 2231de2286a57e0a374b625b4c761664d58e33ff Mon Sep 17 00:00:00 2001 From: Bryan O'Sullivan Date: Fri, 15 Jan 2016 13:14:50 -0800 Subject: [PATCH] with: use context manager in qfinish --- hgext/mq.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hgext/mq.py b/hgext/mq.py index 98c704b31a..e6fcbae5a0 100644 --- a/hgext/mq.py +++ b/hgext/mq.py @@ -3199,12 +3199,9 @@ def finish(ui, repo, *revrange, **opts): # queue.finish may changes phases but leave the responsibility to lock the # repo to the caller to avoid deadlock with wlock. This command code is # responsibility for this locking. - lock = repo.lock() - try: + with repo.lock(): q.finish(repo, revs) q.savedirty() - finally: - lock.release() return 0 @command("qqueue",