# HG changeset patch # User Martin von Zweigbergk # Date 2017-06-16 05:57:20 # Node ID 58a6f64a7018c658c9be5bfc52c4d297658f7b87 # Parent 76bb53f8d374d20f38a566d3810e7f56e8c0895c exchange: use context manager for bundle1 unbundling The lazy locking is not used for bundle1, so using a regular context manager is clearer. diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -1733,8 +1733,8 @@ def unbundle(repo, cg, heads, source, ur # push can proceed if not util.safehasattr(cg, 'params'): # legacy case: bundle1 (changegroup 01) - lockandtr[1] = repo.lock() - r = cg.apply(repo, source, url) + with repo.lock(): + r = cg.apply(repo, source, url) else: r = None try: