changeset 1107:0f16e11b2c2b stable

layouts: fix crash when importing hgext_hgsubversion This change was introduced in 4a92eb1484ba and fixed importing issues for mercurial < 2.8. Unfortunately, this broke imports for newer versions of mercurial that have hgsubversion installed in sys.path. We now wrap the import in a try-block to catch this ImportError.
author Sean Farley <sean.michael.farley@gmail.com>
date Thu, 06 Feb 2014 14:30:05 -0600
parents 5cb6c95e0283
children 1a56b6d39abb bab98093051b
files hgsubversion/layouts/standard.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/layouts/standard.py
+++ b/hgsubversion/layouts/standard.py
@@ -57,7 +57,12 @@ class StandardLayout(base.BaseLayout):
 
     def taglocations(self, meta_data_dir):
         # import late to avoid trouble when running the test suite
-        from hgext_hgsubversion import util
+        try:
+            # newer versions of mercurial >= 2.8 will import this because the
+            # hgext_ logic is already being done in core
+            from hgsubversion import util
+        except ImportError:
+            from hgext_hgsubversion import util
 
         if self._tag_locations is None: