with: use context manager in qfinish

This commit is contained in:
Bryan O'Sullivan 2016-01-15 13:14:50 -08:00
parent b5f5cce8ca
commit 2231de2286

View File

@ -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",