changeset 7447:4fd92687f331

convert: improve reporting of invalid svn bindings
author Patrick Mezard <pmezard@gmail.com>
date Sun, 30 Nov 2008 22:51:42 +0100
parents 2d2e0be762be
children 7900d240c3d8
files hgext/convert/subversion.py
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/subversion.py	Sun Nov 30 22:01:26 2008 +0100
+++ b/hgext/convert/subversion.py	Sun Nov 30 22:51:42 2008 +0100
@@ -32,8 +32,8 @@
 
 from cStringIO import StringIO
 
-from common import NoRepo, commit, converter_source, encodeargs, decodeargs
-from common import commandline, converter_sink, mapfile
+from common import NoRepo, MissingTool, commit, encodeargs, decodeargs
+from common import commandline, converter_source, converter_sink, mapfile
 
 try:
     from svn.core import SubversionException, Pool
@@ -155,7 +155,16 @@
         try:
             SubversionException
         except NameError:
-            raise NoRepo('Subversion python bindings could not be loaded')
+            raise MissingTool(_('Subversion python bindings could not be loaded'))
+
+        try:
+            version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR
+            if version < (1, 4):
+                raise MissingTool(_('Subversion python bindings %d.%d found, '
+                                    '1.4 or later required') % version)
+        except AttributeError:
+            raise MissingTool(_('Subversion python bindings are too old, 1.4 '
+                                'or later required'))
 
         self.encoding = locale.getpreferredencoding()
         self.lastrevs = {}