changeset 567:04e973e65cea

svn_swig: better ImportError to suggest steps for users.
author Augie Fackler <durin42@gmail.com>
date Thu, 25 Feb 2010 20:27:00 -0600
parents 4a1a68713773
children 95eca255739e
files hgsubversion/svnwrap/svn_swig_wrapper.py
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svnwrap/svn_swig_wrapper.py
+++ b/hgsubversion/svnwrap/svn_swig_wrapper.py
@@ -22,10 +22,14 @@ from svn import ra
 from mercurial import util as hgutil
 
 def version():
-    return '%d.%d.%d' % (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_MICRO)
-
-if (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_MICRO) < (1, 5, 0): #pragma: no cover
-    raise ImportError, 'You must have Subversion 1.5.0 or newer and matching SWIG bindings.'
+    return '%d.%d.%d' % (core.SVN_VER_MAJOR, core.SVN_VER_MINOR,
+                         core.SVN_VER_MICRO)
+
+if (core.SVN_VER_MAJOR, core.SVN_VER_MINOR,
+    core.SVN_VER_MICRO) < (1, 5, 0): #pragma: no cover
+    raise ImportError, ('You must have Subversion 1.5.0 or newer and '
+                        'matching SWIG bindings. You appear to'
+                        ' have %s' % version())
 
 class SubversionRepoCanNotReplay(Exception):
     """Exception raised when the svn server is too old to have replay.