pullrequest.py 文件源码

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

项目:github-reviewboard-sync 作者: Apptimize-OSS 项目源码 文件源码
def _create_pull_request_helper(repo, remote_repo, branch, base, auth=None):
    """
    Creates a pull request to merge the branch into the base.
    Ignores the error if there is already a pull request open
    for the given branch->base

    :param Repo repo:
    :param Repository remote_repo:
    :param unicode branch:
    :param unicode base:
    """
    title, message = construct_message(repo, base, branch)
    try:
        _LOG.info('Creating pull request')
        return remote_repo.create_pull(title=title, head=branch, base=base,
                                       body='Autogenerated: \n\n{0}'.format(message))
    except GithubException as exc:
        if 'errors' in exc.data and len(exc.data['errors']) == 1 and \
            exc.data['errors'][0].get('message', '').startswith('A pull request already exists for'):
            _LOG.warning('A pull request already exists for "{0}".  Continuing.'.format(branch))
            return _get_pull_request(remote_repo, branch, base)
        else:
            raise exc
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号