def checkout(repo, reset=False):
    config = get_config(repo)
    depstats = []
    status = -1

    # Notify the deployment system we started
    _check_in('deploy.checkout', repo)

    tag = _get_tag(config)
    if not tag:
        return {'status': status, 'repo': repo, 'dependencies': depstats}

    status = _checkout_location(config, config['location'], tag, reset)

    if status != 0:
        return {'status': status, 'repo': repo, 'tag': tag,
                'dependencies': depstats}

    # Call a set of salt modules, but map the args beforehand.
    # TODO (ryan-lane): Currently if the module calls fail no error is
    #                   returned and this will silently continue on fail.
    #                   We should modify the config hash to allow for failure
    #                   options.
    for call, args in config['checkout_module_calls'].items():
        mapped_args = _map_args(repo, args)
        __salt__[call](*mapped_args)
    return {'status': status, 'repo': repo, 'tag': tag,
            'dependencies': depstats}
Checkout the current deployment tag. Assumes a fetch has been run.
dataset/ETHPy150Open trebuchet-deploy/trebuchet/modules/deploy.py/checkout