changeset 8284:b595758f0792

utils: don't raise HgsubversionImportError from is_valid_repo_uri - just report that the URL isn't supported
author Mads Kiilerich <mads@kiilerich.com>
date Fri, 06 Mar 2020 19:06:09 +0100
parents 5b8678cf4e00
children eb795f7a7a18
files kallithea/lib/utils.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/utils.py	Fri Mar 06 19:02:26 2020 +0100
+++ b/kallithea/lib/utils.py	Fri Mar 06 19:06:09 2020 +0100
@@ -36,10 +36,9 @@
 import beaker.cache
 import mercurial.config
 import mercurial.ui
-from tg.i18n import ugettext as _
 
 import kallithea.config.conf
-from kallithea.lib.exceptions import HgsubversionImportError, InvalidCloneUriException
+from kallithea.lib.exceptions import InvalidCloneUriException
 from kallithea.lib.utils2 import ascii_bytes, aslist, get_current_authuser, safe_bytes, safe_str
 from kallithea.lib.vcs.backends.git.repository import GitRepository
 from kallithea.lib.vcs.backends.hg.repository import MercurialRepository
@@ -236,8 +235,7 @@
             try:
                 from hgsubversion.svnrepo import svnremoterepo
             except ImportError:
-                raise HgsubversionImportError(_('Unable to activate hgsubversion support. '
-                                                'The "hgsubversion" library is missing'))
+                raise InvalidCloneUriException('URI type %s not supported - hgsubversion is not available' % (url,))
             svnremoterepo(ui, url).svn.uuid
         elif url.startswith('git+http'):
             raise InvalidCloneUriException('URI type %s not implemented' % (url,))