Exemple #1
0
def pull_subs(path):

    subs = fsquery.makecontentlist(path, True, False, False, True, False, None)
    subs = filter_sub_files(subs)

    report = []
    anyfailed = False

    for s in subs:

        rs = git_repo_query.get_remotes(s)
        bs = git_repo_query.get_branches(s)

        af, r = git_pull.do_pull(s, rs, bs)
        anyfailed |= af
        report += r

    print(os.linesep)
    for rp in report:
        print(rp)
    print(os.linesep)

    if anyfailed:
        print("%sErrors detected, see above.%s" % (terminal_colors.TTY_RED, terminal_colors.TTY_WHITE))
    else:
        print("%sAll succeeded.%s" % (terminal_colors.TTY_GREEN, terminal_colors.TTY_WHITE))
Exemple #2
0
def apply_filters(repo, options):

    """ apply_filters
    on success, returns filtered remotes and branches
    on failure, raises gvbexcept with detail msg
    """

    remotes = git_repo_query.get_remotes(repo)
    if remotes is None:
        raise gvbexcept("No remotes detected")

    remotes = filter_remotes(remotes, options)
    if remotes is None:
        raise gvbexcept("Failed filtering remotes")

    branches = git_repo_query.get_branches(repo)
    if branches is None:
        raise gvbexcept("No branches detected")

    branches = filter_branches(branches, options)
    if branches is None:
        raise gvbexcept("Failed filtering branches")

    return remotes, branches