comparison rhodecode/model/validators.py @ 3941:3208aaefc9ca beta

Moved all Mercurial imports into hgcompat from vcs
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 03 Jun 2013 23:54:52 +0200
parents 8ddf35e02d05
children 5293d4bbb1ea
comparison
equal deleted inserted replaced
3940:3a608d72a86f 3941:3208aaefc9ca
404 from rhodecode.lib.utils import make_ui 404 from rhodecode.lib.utils import make_ui
405 405
406 def url_handler(repo_type, url, ui=None): 406 def url_handler(repo_type, url, ui=None):
407 if repo_type == 'hg': 407 if repo_type == 'hg':
408 from rhodecode.lib.vcs.backends.hg.repository import MercurialRepository 408 from rhodecode.lib.vcs.backends.hg.repository import MercurialRepository
409 from mercurial.httppeer import httppeer 409 from rhodecode.lib.vcs.utils.hgcompat import httppeer
410 if url.startswith('http'): 410 if url.startswith('http'):
411 ## initially check if it's at least the proper URL 411 ## initially check if it's at least the proper URL
412 ## or does it pass basic auth 412 ## or does it pass basic auth
413 MercurialRepository._check_url(url) 413 MercurialRepository._check_url(url)
414 httppeer(ui, url)._capabilities() 414 httppeer(ui, url)._capabilities()
416 from hgsubversion.svnrepo import svnremoterepo 416 from hgsubversion.svnrepo import svnremoterepo
417 svnremoterepo(ui, url).capabilities 417 svnremoterepo(ui, url).capabilities
418 elif url.startswith('git+http'): 418 elif url.startswith('git+http'):
419 raise NotImplementedError() 419 raise NotImplementedError()
420 else: 420 else:
421 raise Exception('clone from URI %s not allowed' % (url)) 421 raise Exception('clone from URI %s not allowed' % (url,))
422 422
423 elif repo_type == 'git': 423 elif repo_type == 'git':
424 from rhodecode.lib.vcs.backends.git.repository import GitRepository 424 from rhodecode.lib.vcs.backends.git.repository import GitRepository
425 if url.startswith('http'): 425 if url.startswith('http'):
426 ## initially check if it's at least the proper URL 426 ## initially check if it's at least the proper URL