changeset 718:db0eb6237420

wrapper: fail properly with unsupported versions of Subvertpy (fixes #212) Calling subvertpy.wc.api_version() will raise an AttributeError with versions of Subvertpy prior to 0.7.4. This AttributeError completely breaks hgsubversion, as our infrastructure assumes that only ImportErrors are raised during imports. Delaying the call to api_version() until after the Subvertpy version check should make things work again.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Sun, 03 Oct 2010 17:53:20 +0200
parents ae5968ffe6fe
children ae52a3b30cfb
files hgsubversion/svnwrap/subvertpy_wrapper.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svnwrap/subvertpy_wrapper.py
+++ b/hgsubversion/svnwrap/subvertpy_wrapper.py
@@ -24,8 +24,6 @@ try:
     from subvertpy import properties
     from subvertpy import ra
     import subvertpy
-
-    subversion_version = subvertpy.wc.api_version()
 except ImportError:
     raise ImportError('Subvertpy %d.%d.%d or later required, but not found'
                       % subvertpy_required)
@@ -39,6 +37,8 @@ if subvertpy.__version__ < subvertpy_req
                       % (_versionstr(subvertpy_required),
                          _versionstr(subvertpy.__version__)))
 
+subversion_version = subvertpy.wc.api_version()
+
 if subversion_version[:3] < subversion_required:
     raise ImportError('Subversion %s or later required, '
                       'but Subvertpy is using %s'