repo.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:github-reviewboard-sync 作者: Apptimize-OSS 项目源码 文件源码
def push_repo(repo, branch, remote='origin', remote_branch=None):
    """
    Pushes the repo up to the remote.  It will set
    the upstream to the remote branch.

    :param Repo repo: The repo you wish to push
    :param unicode branch: The branch being pushed
    :param unicode remote: The remote to use (e.g. ``'origin'``
    :param unicode remote_branch: The remote branch.  Defaults
        to the `branch` parameter
    :return: None
    :raises: PushFailedException
    """
    remote_branch = remote_branch or branch
    _checkout_branch(repo, branch)
    _LOG.info("Pushing all commits to remote '{0}'".format(remote))
    remote = _get_remote(repo, remote)
    try:
        remote.push(remote_branch, set_upstream=True)
    except GitCommandError as e:
        _LOG.error(str(e))
        raise PushFailedException('Uh oh, it seems like something went'
                                  ' wrong with the push. "{0}"'.format(str(e)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号