comparison hgsubversion/layouts/standard.py @ 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 4a92eb1484ba
children eaefb3413b87
comparison
equal deleted inserted replaced
1106:5cb6c95e0283 1107:0f16e11b2c2b
55 55
56 return '%s/%s' % (subdir or '', branchpath) 56 return '%s/%s' % (subdir or '', branchpath)
57 57
58 def taglocations(self, meta_data_dir): 58 def taglocations(self, meta_data_dir):
59 # import late to avoid trouble when running the test suite 59 # import late to avoid trouble when running the test suite
60 from hgext_hgsubversion import util 60 try:
61 # newer versions of mercurial >= 2.8 will import this because the
62 # hgext_ logic is already being done in core
63 from hgsubversion import util
64 except ImportError:
65 from hgext_hgsubversion import util
61 66
62 if self._tag_locations is None: 67 if self._tag_locations is None:
63 68
64 tag_locations_file = os.path.join(meta_data_dir, 'tag_locations') 69 tag_locations_file = os.path.join(meta_data_dir, 'tag_locations')
65 70