# HG changeset patch # User Azhagu Selvan SP # Date 2011-02-23 19:44:15 # Node ID 69418d4525d166793bc63789b2bd64fcc3d84401 # Parent b14ed1692b2784655d0fb190faabf02dda111df3 convert/svn: abort operation when python bindings are not available Subversion python bindings check was not present in svn_sink source class which made it fail while using svn as destination repository. Added a more maintainble svn bindings check for svn_source and svn_sink classes. diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -36,7 +36,7 @@ try: category=DeprecationWarning) except ImportError: - pass + svn = None class SvnPathNotFound(Exception): pass @@ -209,11 +209,8 @@ class svn_source(converter_source): issvnurl(ui, url)): raise NoRepo(_("%s does not look like a Subversion repository") % url) - - try: - SubversionException - except NameError: - raise MissingTool(_('Subversion python bindings could not be loaded')) + if svn is None: + raise MissingTool(_('Could not load Subversion python bindings')) try: version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR @@ -960,6 +957,9 @@ class svn_sink(converter_sink, commandli return self.join('hg-authormap') def __init__(self, ui, path): + + if svn is None: + raise MissingTool(_('Could not load Subversion python bindings')) converter_sink.__init__(self, ui, path) commandline.__init__(self, ui, 'svn') self.delete = []