Exemplo n.º 1
0
def list_reviews(args):
    "Lists tracked code reviews."

    g = GitRepo()
    cr_data_file = get_cr_data_file(g)
    safe_create_code_review_data_file(cr_data_file)

    crconf = CodeReviewConfiguration(cr_data_file)

    print(json.dumps([k for k in crconf.branches.keys()], indent=3, sort_keys=True))
Exemplo n.º 2
0
def checkout(args):
    "Checks out a tracked code review branch."

    g = GitRepo()
    cr_data_file = get_cr_data_file(g)

    safe_create_code_review_data_file(cr_data_file)
    crconf = CodeReviewConfiguration(cr_data_file)

    if args._branch_name in crconf.branches:
        try:
            g.checkout(args._branch_name)
            logger.info('checked out: ' + args._branch_name)
        except:
            logger.error('could not checkout branch: ' + args._branch_name)
    else:
        m = "no branch named {0} tracked. Please use another method to checkout this branch"
        logger.warning(m.format(args._branch_name))