changeset 709:2c278d71b73d

subvertpy wrapper: check against Subversion version compiled against. The previously used method for checking the Subversion version, subvertpy.wc.version(), reported back the version of the runtime library used. This is not what we're interested in; we want to know what version it was compiled against. These functions were not available in Subvertpy 0.7.3, necessitating the earlier bump of the version requirement to 0.7.4.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Wed, 29 Sep 2010 18:04:26 +0200
parents f28c6d5d73fd
children db56e65906f4
files hgsubversion/svnwrap/subvertpy_wrapper.py
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svnwrap/subvertpy_wrapper.py
+++ b/hgsubversion/svnwrap/subvertpy_wrapper.py
@@ -25,6 +25,8 @@ 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)
@@ -38,17 +40,17 @@ if subvertpy.__version__ < subvertpy_req
                       % (_versionstr(subvertpy_required),
                          _versionstr(subvertpy.__version__)))
 
-if subvertpy.wc.version()[:3] < subversion_required:
+if subversion_version[:3] < subversion_required:
     raise ImportError('Subversion %s or later required, '
                       'but Subvertpy is using %s'
                       % (_versionstr(subversion_required),
-                         _versionstr(subvertpy.wc.version()[:3])))
+                         _versionstr(subversion_version[:3])))
 
 
 def version():
-    svnvers = _versionstr(subvertpy.wc.version()[:3])
-    if subvertpy.wc.version()[3]:
-        svnvers += '-' + subvertpy.wc.version()[3]
+    svnvers = _versionstr(subversion_version[:3])
+    if subversion_version[3]:
+        svnvers += '-' + subversion_version[3]
     return (svnvers, 'Subvertpy ' + _versionstr(subvertpy.__version__))
 
 # exported values