Mercurial > kallithea
comparison rhodecode/model/validators.py @ 3483:994dfdd0c920
disallow cloning from different URI's that http[s]/svn/git/hg
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 06 Mar 2013 15:04:09 +0100 |
parents | 45755867deda |
children | 0cef54d34605 |
comparison
equal
deleted
inserted
replaced
3472:702da441f5c4 | 3483:994dfdd0c920 |
---|---|
414 elif url.startswith('svn+http'): | 414 elif url.startswith('svn+http'): |
415 from hgsubversion.svnrepo import svnremoterepo | 415 from hgsubversion.svnrepo import svnremoterepo |
416 svnremoterepo(ui, url).capabilities | 416 svnremoterepo(ui, url).capabilities |
417 elif url.startswith('git+http'): | 417 elif url.startswith('git+http'): |
418 raise NotImplementedError() | 418 raise NotImplementedError() |
419 else: | |
420 raise Exception('clone from URI %s not allowed' % (url)) | |
419 | 421 |
420 elif repo_type == 'git': | 422 elif repo_type == 'git': |
421 from rhodecode.lib.vcs.backends.git.repository import GitRepository | 423 from rhodecode.lib.vcs.backends.git.repository import GitRepository |
422 if url.startswith('http'): | 424 if url.startswith('http'): |
423 ## initially check if it's at least the proper URL | 425 ## initially check if it's at least the proper URL |
425 GitRepository._check_url(url) | 427 GitRepository._check_url(url) |
426 elif url.startswith('svn+http'): | 428 elif url.startswith('svn+http'): |
427 raise NotImplementedError() | 429 raise NotImplementedError() |
428 elif url.startswith('hg+http'): | 430 elif url.startswith('hg+http'): |
429 raise NotImplementedError() | 431 raise NotImplementedError() |
432 else: | |
433 raise Exception('clone from URI %s not allowed' % (url)) | |
430 | 434 |
431 class _validator(formencode.validators.FancyValidator): | 435 class _validator(formencode.validators.FancyValidator): |
432 messages = { | 436 messages = { |
433 'clone_uri': _(u'invalid clone url'), | 437 'clone_uri': _(u'invalid clone url'), |
434 'invalid_clone_uri': _(u'Invalid clone url, provide a ' | 438 'invalid_clone_uri': _(u'Invalid clone url, provide a ' |