changeset 1280:c791efb7082a

Merge with stable.
author Augie Fackler <raf@durin42.com>
date Wed, 10 Dec 2014 22:47:18 -0500
parents 2ae577a4cd56 (current diff) b5520673f6f2 (diff)
children e74fad41077b
files hgsubversion/wrappers.py
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -521,13 +521,23 @@ def pull(repo, source, heads=[], force=F
 def exchangepull(orig, repo, remote, heads=None, force=False, bookmarks=()):
     capable = getattr(remote, 'capable', lambda x: False)
     if capable('subversion'):
+        # transaction manager is present in Mercurial >= 3.3
+        try:
+            trmanager = getattr(exchange, 'transactionmanager')
+        except AttributeError:
+            trmanager = None
         pullop = exchange.pulloperation(repo, remote, heads, force,
                                         bookmarks=bookmarks)
+        if trmanager:
+            pullop.trmanager = trmanager(repo, 'pull', remote.url())
         try:
             pullop.cgresult = pull(repo, remote, heads, force)
             return pullop
         finally:
-            pullop.releasetransaction()
+            if trmanager:
+                pullop.trmanager.release()
+            else:
+                pullop.releasetransaction()
     else:
         return orig(repo, remote, heads, force, bookmarks=bookmarks)