예제 #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
    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
    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
    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
    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)])