# HG changeset patch # User Bryan O'Sullivan # Date 1452892489 28800 # Node ID 2b3a21052be978860ac7000688883589a08328fc # Parent 5b675a5665ef5db6b384c831b2a1ba5046668fc3 with: use context manager in resolve diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -5899,8 +5899,7 @@ fm.end() return 0 - wlock = repo.wlock() - try: + with repo.wlock(): ms = mergemod.mergestate.read(repo) if not (ms.active() or repo.dirstate.p2() != nullid): @@ -6017,9 +6016,6 @@ if not proceed: return 1 - finally: - wlock.release() - # Nudge users into finishing an unfinished operation unresolvedf = list(ms.unresolved()) driverresolvedf = list(ms.driverresolved())