~akretion-team/anybox.recipe.openerp/git-shallow-clone

« back to all changes in this revision

Viewing changes to anybox/recipe/openerp/vcs/__init__.py

  • Committer: Raphaël Valyi
  • Date: 2014-07-12 21:38:50 UTC
  • mfrom: (508.1.29 git-merges)
  • Revision ID: rvalyi@gmail.com-20140712213850-u6v3avme4e4bae4z
merge git-shallow-clone

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from zc.buildout import UserError
1
2
from .base import UpdateError  # noqa
2
3
from .hg import HgRepo
3
4
from .bzr import BzrBranch
12
13
SUPPORTED['svn'] = SvnCheckout
13
14
 
14
15
 
15
 
def get_update(vcs_type, target_dir, url, revision, **options):
16
 
    """General entry point."""
 
16
def repo(vcs_type, target_dir, url, **options):
17
17
    cls = SUPPORTED.get(vcs_type)
18
18
    if cls is None:
19
 
        raise ValueError("Unsupported VCS type: %r" % vcs_type)
 
19
        raise UserError("Unsupported VCS type: %r" % vcs_type)
20
20
 
21
21
    # case of standalon addon (see launchpad #1012899)
22
22
    target_dir = cls.fix_target(target_dir)
23
 
    cls(target_dir, url, **options)(revision)
 
23
    return cls(target_dir, url, **options)
 
24
 
 
25
 
 
26
def get_update(vcs_type, target_dir, url, revision, **options):
 
27
    """General entry point."""
 
28
    return repo(vcs_type, target_dir, url, **options)(revision)