コード例 #1
0
def main(args):
    name = args.upstream

    code_username = ''
    if not args.origin:
        code_username = get_code_username()
        if not code_username:
            log_error('origin not specified')
            return 1
        repo_name = name.split('/')[-1]
        args.origin = '%s/%s' % (code_username, repo_name)

    if not args.dir:
        args.dir = name.rsplit('/')[-1]
        print_log("Destination dir is not specified, will use {}".format(
            args.dir))

    check_call([
        'git',
        'clone',
        repo_git_url(args.origin,
                     login_user=code_username,
                     provider=args.provider),
        args.dir,
    ])
    with cd(args.dir):
        merge_config()
        check_call(['git', 'remote', 'add', 'upstream', repo_git_url(name)])
コード例 #2
0
ファイル: provider_code.py プロジェクト: joest67/codecli
    def send_pullreq(self, head_repo, head_ref, base_repo, base_ref):

        url = (('http://code.dapps.douban.com/%s/newpull/new?' % head_repo) +
               urllib.urlencode(dict(head_ref=head_ref, base_ref=base_ref,
                                     base_repo=base_repo)))
        utils.print_log("goto " + url)
        utils.browser_open(url)
コード例 #3
0
    def send_pullreq(self, head_repo, head_ref, base_repo, base_ref):
        head_user, _ = head_repo.split("/")
        base_user, _ = base_repo.split("/")

        url = "https://github.com/%s/compare/%s:%s...%s:%s?expand=1" % (
            head_repo, base_user, base_ref, head_user, head_ref)

        utils.print_log("goto " + url)
        utils.browser_open(url)
コード例 #4
0
ファイル: provider_code.py プロジェクト: sunyi00/codecli
    def send_pullreq(self, head_repo, head_ref, base_repo, base_ref):

        url = ('http://code.dapps.douban.com/%s/newpull/new?' %
               head_repo) + urlencode(
                   dict(head_ref=head_ref,
                        base_ref=base_ref,
                        base_repo=base_repo))
        utils.print_log("goto " + url)
        utils.browser_open(url)
コード例 #5
0
ファイル: provider_github.py プロジェクト: hongqn/codecli
    def send_pullreq(self, head_repo, head_ref, base_repo, base_ref):
        head_user, _ = head_repo.split("/")
        base_user, _ = base_repo.split("/")

        url = "https://github.com/%s/compare/%s:%s...%s:%s?expand=1" % (
            head_repo, base_user, base_ref, head_user, head_ref)

        utils.print_log("goto " + url)
        utils.browser_open(url)
コード例 #6
0
ファイル: pullreq.py プロジェクト: kirk91/codecli
def submit_new_pullreq(remote='upstream', remote_branch=None, no_merge=False):
    branch = get_current_branch_name()
    if branch == 'master':
        print_log('Pull request should never be from master')
        return 1

    if not no_merge:
        rebase = not branch_is_published_already(branch)
        merge_with_base(branch, rebase=rebase, remote=remote,
                        remote_branch=remote_branch)
    push_to_my_fork(branch)
    send_pullreq(branch, remote=remote, remote_branch=remote_branch)
コード例 #7
0
ファイル: provider_gitein.py プロジェクト: sunyi00/codecli
    def send_pullreq(self, head_repo, head_ref, base_repo, base_ref):
        head_user, _ = head_repo.split("/")
        base_user, _ = base_repo.split("/")

        url = "https://git.ein.plus/%s/-/merge_requests/new?" % head_repo + urlencode(
            {
                'merge_request[source_branch]': head_ref,
                'merge_request[source_project]': head_user,
                'merge_request[target_branch]': base_ref,
                'merge_request[target_project]': base_user,
            })

        utils.print_log("goto " + url)
        utils.browser_open(url)
コード例 #8
0
ファイル: pullreq.py プロジェクト: CCv5/codecli
def submit_new_pullreq(remote='upstream', remote_branch=None, no_merge=False):
    branch = get_current_branch_name()
    if branch == 'master':
        print_log('Pull request should never be from master')
        return 1

    if not no_merge:
        rebase = not branch_is_published_already(branch)
        merge_with_base(branch,
                        rebase=rebase,
                        remote=remote,
                        remote_branch=remote_branch)
    push_to_my_fork(branch)
    send_pullreq(branch, remote=remote, remote_branch=remote_branch)
コード例 #9
0
ファイル: fork.py プロジェクト: wooparadog/codecli
def main(args):
    name = args.upstream

    code_username = ''
    if not args.origin:
        code_username = get_code_username()
        if not code_username:
            log_error('origin not specified')
            return 1
        args.origin = '%s/%s' % (code_username, name)

    if not args.dir:
        args.dir = name.rsplit('/')[-1]
        print_log("Destination dir is not specified, will use {}".format(args.dir))

    check_call(['git', 'clone', repo_git_url(args.origin, login_user=code_username), args.dir])
    with cd(args.dir):
        merge_config()
        check_call(['git', 'remote', 'add', 'upstream', repo_git_url(name)])