changeset 32845:58a6f64a7018

exchange: use context manager for bundle1 unbundling The lazy locking is not used for bundle1, so using a regular context manager is clearer.
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 15 Jun 2017 22:57:20 -0700
parents 76bb53f8d374
children 7c11869cf23a
files mercurial/exchange.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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: