changeset 848:05eb0874fa30

init: add a try/except to retain compatibility with Mercurial 3.2 Without the try/except, hg-git crashes with Mercurial 3.2. Oops.
author Siddharth Agarwal <sid0@fb.com>
date Wed, 10 Dec 2014 10:59:39 -0800
parents 82b457515ddb
children d40de32ec5b1
files hggit/__init__.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/__init__.py
+++ b/hggit/__init__.py
@@ -220,7 +220,10 @@
 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')
+        try:
+            trmanager = getattr(exchange, 'transactionmanager')
+        except AttributeError:
+            trmanager = None
         pullop = exchange.pulloperation(repo, remote, heads, force,
                                         bookmarks=bookmarks)
         if trmanager: