Skip to content
Snippets Groups Projects
Commit ef904bd8 authored by Siddharth Agarwal's avatar Siddharth Agarwal
Browse files

exchangepull: fixup for introduction of transaction manager upstream

Mercurial rev 52db731b964d introduced a transaction manager upstream. This
means that the closetransaction and releasetransaction methods on the pull
operation have gone away.
parent edcdb762
No related branches found
No related tags found
No related merge requests found
......@@ -219,5 +219,7 @@
@util.transform_notgit
def exchangepull(orig, repo, remote, heads=None, force=False, bookmarks=()):
if isinstance(remote, gitrepo.gitrepo):
# transaction manager is present in Mercurial >= 3.3
trmanager = getattr(exchange, 'transactionmanager')
pullop = exchange.pulloperation(repo, remote, heads, force,
bookmarks=bookmarks)
......@@ -222,5 +224,7 @@
pullop = exchange.pulloperation(repo, remote, heads, force,
bookmarks=bookmarks)
if trmanager:
pullop.trmanager = trmanager(repo, 'pull', remote.url())
lock = repo.lock()
try:
pullop.cgresult = repo.githandler.fetch(remote.path, heads)
......@@ -224,6 +228,9 @@
lock = repo.lock()
try:
pullop.cgresult = repo.githandler.fetch(remote.path, heads)
pullop.closetransaction()
if trmanager:
pullop.trmanager.close()
else:
pullop.closetransaction()
return pullop
finally:
......@@ -228,6 +235,9 @@
return pullop
finally:
pullop.releasetransaction()
if trmanager:
pullop.trmanager.release()
else:
pullop.releasetransaction()
lock.release()
else:
return orig(repo, remote, heads, force, bookmarks=bookmarks)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment