예제 #1
0
def run(args):
    allcomps = MepoState.read_state()
    verify.valid_components(args.comp_name, allcomps)
    comps2dev = [x for x in allcomps if x.name in args.comp_name]
    for comp in comps2dev:
        git = GitRepository(comp.remote, comp.local)
        if comp.develop is None:
            raise Exception("'develop' branch not specified for {}".format(
                comp.name))
        if not args.quiet:
            print("Checking out development branch %s in %s" %
                  (colors.YELLOW + comp.develop + colors.RESET,
                   colors.RESET + comp.name + colors.RESET))
        git.checkout(comp.develop)
        output = git.pull()
예제 #2
0
파일: pull.py 프로젝트: weiyuan-jiang/mepo
def run(args):
    allcomps = MepoState.read_state()
    verify.valid_components(args.comp_name, allcomps)
    comps2pull = [x for x in allcomps if x.name in args.comp_name]
    for comp in comps2pull:
        git = GitRepository(comp.remote, comp.local)
        name, tYpe, is_detached = MepoVersion(*git.get_version())
        if is_detached:
            raise Exception('{} has detached head! Cannot pull.'.format(
                comp.name))
        else:
            print("Pulling branch %s in %s " %
                  (colors.YELLOW + name + colors.RESET,
                   colors.RESET + comp.name + colors.RESET))
            output = git.pull()
            if not args.quiet: print(output)