##// END OF EJS Templates
exchange: use context manager for locks and transaction in unbundle()...
Martin von Zweigbergk -
r35596:86f9aabe default
parent child Browse files
Show More
@@ -1345,11 +1345,8 b' def pull(repo, remote, heads=None, force'
1345 " %s") % (', '.join(sorted(missing)))
1345 " %s") % (', '.join(sorted(missing)))
1346 raise error.Abort(msg)
1346 raise error.Abort(msg)
1347
1347
1348 wlock = lock = None
1348 pullop.trmanager = transactionmanager(repo, 'pull', remote.url())
1349 try:
1349 with repo.wlock(), repo.lock(), pullop.trmanager:
1350 wlock = pullop.repo.wlock()
1351 lock = pullop.repo.lock()
1352 pullop.trmanager = transactionmanager(repo, 'pull', remote.url())
1353 # This should ideally be in _pullbundle2(). However, it needs to run
1350 # This should ideally be in _pullbundle2(). However, it needs to run
1354 # before discovery to avoid extra work.
1351 # before discovery to avoid extra work.
1355 _maybeapplyclonebundle(pullop)
1352 _maybeapplyclonebundle(pullop)
@@ -1361,9 +1358,6 b' def pull(repo, remote, heads=None, force'
1361 _pullphase(pullop)
1358 _pullphase(pullop)
1362 _pullbookmarks(pullop)
1359 _pullbookmarks(pullop)
1363 _pullobsolete(pullop)
1360 _pullobsolete(pullop)
1364 pullop.trmanager.close()
1365 finally:
1366 lockmod.release(pullop.trmanager, lock, wlock)
1367
1361
1368 # storing remotenames
1362 # storing remotenames
1369 if repo.ui.configbool('experimental', 'remotenames'):
1363 if repo.ui.configbool('experimental', 'remotenames'):
General Comments 0
You need to be logged in to leave comments. Login now