Commit 6fa9bb53 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

backout: use context manager for locks

Differential Revision: https://phab.mercurial-scm.org/D3744
parent eef4668be8a3
......@@ -560,13 +560,8 @@ def backout(ui, repo, node=None, rev=None, **opts):
Returns 0 on success, 1 if nothing to backout or there are unresolved
files.
'''
wlock = lock = None
try:
wlock = repo.wlock()
lock = repo.lock()
with repo.wlock(), repo.lock():
return _dobackout(ui, repo, node, rev, **opts)
finally:
release(lock, wlock)
def _dobackout(ui, repo, node=None, rev=None, **opts):
opts = pycompat.byteskwargs(opts)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment