exchange: use context manager for bundle1 unbundling
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 15 Jun 2017 22:57:20 -0700
changeset 32845 58a6f64a7018
parent 32844 76bb53f8d374
child 32846 7c11869cf23a
exchange: use context manager for bundle1 unbundling The lazy locking is not used for bundle1, so using a regular context manager is clearer.
mercurial/exchange.py
--- a/mercurial/exchange.py	Thu Jun 15 14:47:18 2017 -0700
+++ b/mercurial/exchange.py	Thu Jun 15 22:57:20 2017 -0700
@@ -1733,8 +1733,8 @@
         # 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: