Exemplo n.º 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))
Exemplo n.º 2
0
def visitor_pull(repos, options):

    ORIGINAL_COLOR = terminal_colors.get_standard_color() 

    report = []
    all_passed = True
    for rp in repos:

        try:
            remotes, branches = git_visitor_base.apply_filters(rp, options)
        except git_visitor_base.gvbexcept as gvbex:
            all_passed = False
            report.append("%s%s: %s.%s" % (terminal_colors.TTY_RED, rp, gvbex.message, ORIGINAL_COLOR)) 
            continue

        op_piece, report_piece = git_pull.do_pull(rp, remotes, branches)
        all_passed = all_passed and (not op_piece)
        for ri in report_piece:
            report.append(ri)

    git_visitor_base.print_report(all_passed, report)
    return all_passed