changeset 1176:97a064e2075d stable

push: fix obsolete feature detection The obsolete feature detection didn't work with demandimport, breaking hgsubversion when running against 2.0-2.3.
author Dan Villiom Podlaski Christiansen <dan@cabo.dk>
date Tue, 22 Apr 2014 15:53:11 +0200
parents d6296f901fc7
children 8caf1226adec
files hgsubversion/wrappers.py tests/test_util.py
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -191,7 +191,10 @@ def push(repo, dest, force, revs):
     ui = repo.ui
     old_encoding = util.swap_out_encoding()
 
-    hasobsolete = obsolete and obsolete._enabled
+    try:
+        hasobsolete = obsolete._enabled
+    except:
+        hasobsolete = False
 
     temporary_commits = []
     try:
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -29,6 +29,7 @@ from mercurial import extensions
 
 try:
     from mercurial import obsolete
+    obsolete._enabled
 except ImportError:
     obsolete = None