Changeset - 13879d044762
[Not reviewed]
default
0 1 0
domruf - 9 years ago 2017-05-10 20:13:24
dominikruf@gmail.com
validators: wrap hgsubversion import with try/except block like in settings.py

Found by pylint.
1 file changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/model/validators.py
Show inline comments
 
@@ -34,7 +34,7 @@ from kallithea.lib import ipaddr
 
from kallithea.lib.utils import repo_name_slug
 
from kallithea.lib.utils2 import str2bool, aslist
 
from kallithea.model.db import RepoGroup, Repository, UserGroup, User
 
from kallithea.lib.exceptions import LdapImportError
 
from kallithea.lib.exceptions import LdapImportError, HgsubversionImportError
 
from kallithea.config.routing import ADMIN_PREFIX
 
from kallithea.lib.auth import HasRepoGroupPermissionLevel, HasPermissionAny
 

	
 
@@ -420,7 +420,11 @@ def ValidCloneUri():
 
                # or does it pass basic auth
 
                MercurialRepository._check_url(url, ui)
 
            elif url.startswith('svn+http'):
 
                from hgsubversion.svnrepo import svnremoterepo
 
                try:
 
                    from hgsubversion.svnrepo import svnremoterepo
 
                except ImportError:
 
                    raise HgsubversionImportError(_('Unable to activate hgsubversion support. '
 
                          'The "hgsubversion" library is missing'))
 
                svnremoterepo(ui, url).svn.uuid
 
            elif url.startswith('git+http'):
 
                raise NotImplementedError()
0 comments (0 inline, 0 general)