Exemplo n.º 1
0
def vcs_unit_test():
    """
    Perform VCS unit tests.
    """
    repo = "http://www.google.com/"
    (x,y) = utils.split_vcs_url(repo)

    assert utils.split_vcs_url(repo) == (None, None)

    repo = "cVs+pserver://Foo.example.com/usr/cvs/foo"
    (vcs,url) = utils.split_vcs_url(repo)
    assert vcs == "cvs"
    assert url == "pserver://Foo.example.com/usr/cvs/foo"
Exemplo n.º 2
0
def vcs_unit_test():
    """
    Perform VCS unit tests.
    """
    repo = "http://www.google.com/"
    (x, y) = utils.split_vcs_url(repo)

    assert utils.split_vcs_url(repo) == (None, None)

    repo = "cVs+pserver://Foo.example.com/usr/cvs/foo"
    (vcs, url) = utils.split_vcs_url(repo)
    assert vcs == "cvs"
    assert url == "pserver://Foo.example.com/usr/cvs/foo"
Exemplo n.º 3
0
def absolute(builder, co_dir, co_name, repo_url, rev=None, branch=None):
    """
    Check out a multilevel repository from an absolute URL.

    <repo_url> must be of the form <vcs>+<url>, where <vcs> is one of the
    support version control systems (e.g., 'git', 'svn').

    <rev> may be a revision (specified as a string). "HEAD" (or its equivalent)
    is assumed by default.

    <branch> may be a branch. "master" (or its equivalent) is assumed by
    default.

    The repository <repo_url> will be checked out into src/<co_dir>. The
    checkout will be identified by the label checkout:<co_name>/checked_out.
    """

    vcs, base_url = split_vcs_url(repo_url)

    repo = Repository.from_url(vcs, base_url, revision=rev, branch=branch)

    # The version control handler wants to know the "leaf" separately
    # from the rest of the checkout path relative to src/
    co_dir_dir, co_dir_leaf = os.path.split(co_dir)

    co_label = Label(utils.LabelType.Checkout, co_name, domain=builder.default_domain)
    checkout_from_repo(builder, co_label, repo, co_dir=co_dir_dir, co_leaf=co_dir_leaf)
Exemplo n.º 4
0
def absolute(builder, co_dir, co_name, repo_url, rev=None, branch=None):
    """
    Check out a twolevel repository from an absolute URL.

    <repo_url> must be of the form <vcs>+<url>, where <vcs> is one of the
    support version control systems (e.g., 'git', 'svn').

    <rev> may be a revision (specified as a string). "HEAD" (or its equivalent)
    is assumed by default.

    <branch> may be a branch. "master" (or its equivalent) is assumed by
    default.

    The repository <repo_url>/<co_name> will be checked out into
    src/<co_dir>/<co_name>.
    """

    co_path = os.path.join(co_dir, co_name)

    vcs, base_url = split_vcs_url(repo_url)
    repo = Repository.from_url(vcs, base_url, revision=rev, branch=branch)
    co_label = Label(utils.LabelType.Checkout,
                     co_name,
                     domain=builder.default_domain)
    checkout_from_repo(builder, co_label, repo, co_dir=co_dir)
Exemplo n.º 5
0
def get_vcs_instance_from_string(repo_str):
    """Given a <vcs>+<url> string, return a VCS instance and <url>.
    """
    vcs, url_rest = split_vcs_url(repo_str)
    if not vcs:
        raise MuddleBug("Improperly formatted repository spec %s,"
                        " should be <vcs>+<url>" % repo_str)

    vcs_instance = get_vcs_instance(vcs)

    return vcs_instance, url_rest
Exemplo n.º 6
0
def get_vcs_instance_from_string(repo_str):
    """Given a <vcs>+<url> string, return a VCS instance and <url>.
    """
    vcs, url_rest = split_vcs_url(repo_str)
    if not vcs:
        raise MuddleBug("Improperly formatted repository spec %s,"
                        " should be <vcs>+<url>"%repo_str)

    vcs_instance = get_vcs_instance(vcs)

    return vcs_instance, url_rest
Exemplo n.º 7
0
def absolute(builder, co_name, repo_url, rev=None, branch=None):
    """
    Check out a repository from an absolute URL.

    <repo_url> must be of the form <vcs>+<url>, where <vcs> is one of the
    support version control systems (e.g., 'git', 'svn').

    <rev> may be a revision (specified as a string). "HEAD" (or its equivalent)
    is assumed by default.

    <branch> may be a branch. "master" (or its equivalent) is assumed by
    default.

    The repository <repo_url>/<co_name> will be checked out into src/<co_name>.
    """

    vcs, base_url = split_vcs_url(repo_url)
    repo = Repository.from_url(vcs, base_url, revision=rev, branch=branch)
    co_label = Label(utils.LabelType.Checkout, co_name, domain=builder.default_domain)
    checkout_from_repo(builder, co_label, repo)