Esempio n. 1
0
def rebase_pq(repo, branch):
    if is_pq_branch(branch):
        base = pq_branch_base(branch)
    else:
        switch_to_pq_branch(repo, branch)
        base = branch
    GitCommand("rebase")([base])
Esempio n. 2
0
def switch_pq(repo, current):
    """Switch to patch-queue branch if on base branch and vice versa"""
    if is_pq_branch(current):
        base = pq_branch_base(current)
        gbp.log.info("Switching to %s" % base)
        repo.checkout(base)
    else:
        switch_to_pq_branch(repo, current)
Esempio n. 3
0
def switch_pq(repo, current):
    """Switch to patch-queue branch if on base branch and vice versa"""
    if is_pq_branch(current):
        base = pq_branch_base(current)
        gbp.log.info("Switching to %s" % base)
        repo.checkout(base)
    else:
        switch_to_pq_branch(repo, current)
Esempio n. 4
0
def switch_pq(repo, branch, options):
    """Switch to patch-queue branch if on base branch and vice versa"""
    if is_pq_branch(branch):
        base = pq_branch_base(branch)
        gbp.log.info("Switching to %s" % base)
        repo.checkout(base)
    else:
        maybe_import_pq(repo, branch, options)
        switch_to_pq_branch(repo, branch)
Esempio n. 5
0
def switch_pq(repo, branch, options):
    """Switch to patch-queue branch if on base branch and vice versa"""
    if is_pq_branch(branch):
        base = pq_branch_base(branch)
        gbp.log.info("Switching to %s" % base)
        repo.checkout(base)
    else:
        maybe_import_pq(repo, branch, options)
        switch_to_pq_branch(repo, branch)
Esempio n. 6
0
def rebase_pq(repo, branch, options):
    maybe_import_pq(repo, branch, options)
    # Make sure we're on the pq branch
    switch_to_pq_branch(repo, branch)
    if pq_on_upstream_tag(options.pq_from):
        base = find_upstream_commit(repo, branch, options.upstream_tag)
    else:
        base = pq_branch_base(repo.branch)

    GitCommand("rebase", cwd=repo.path)([base])
Esempio n. 7
0
def rebase_pq(repo, branch, options):
    maybe_import_pq(repo, branch, options)
    # Make sure we're on the pq branch
    switch_to_pq_branch(repo, branch)
    if pq_on_upstream_tag(options.pq_from):
        base = find_upstream_commit(repo, branch, options.upstream_tag)
    else:
        base = pq_branch_base(repo.branch)

    GitCommand("rebase", cwd=repo.path)([base])
Esempio n. 8
0
def rebase_pq(repo, options):
    """Rebase pq branch on the correct upstream version (from spec file)."""
    current = repo.get_branch()
    if is_pq_branch(current):
        base = pq_branch_base(current)
        spec = parse_spec(options, repo, base)
    else:
        base = current
        spec = parse_spec(options, repo)
    upstream_commit = find_upstream_commit(repo, spec, options.upstream_tag)

    switch_to_pq_branch(repo, base)
    GitCommand("rebase")([upstream_commit])
Esempio n. 9
0
def rebase_pq(repo, options):
    """Rebase pq branch on the correct upstream version (from spec file)."""
    current = repo.get_branch()
    if is_pq_branch(current):
        base = pq_branch_base(current)
        spec = parse_spec(options, repo, base)
    else:
        base = current
        spec = parse_spec(options, repo)
    upstream_commit = find_upstream_commit(repo, spec, options.upstream_tag)

    switch_to_pq_branch(repo, base)
    GitCommand("rebase")([upstream_commit])
Esempio n. 10
0
def rebase_pq(repo, branch, pq_from, upstream_tag):

    if is_pq_branch(branch):
        base = pq_branch_base(branch)
    else:
        switch_to_pq_branch(repo, branch)
        base = branch

    if pq_on_upstream_tag(pq_from):
        _from = find_upstream_commit(repo, base, upstream_tag)
    else:
        _from = base

    GitCommand("rebase", cwd=repo.path)([_from])
Esempio n. 11
0
def rebase_pq(repo, branch, pq_from, upstream_tag):

    if is_pq_branch(branch):
        base = pq_branch_base(branch)
    else:
        switch_to_pq_branch(repo, branch)
        base = branch

    if pq_on_upstream_tag(pq_from):
        _from = find_upstream_commit(repo, base, upstream_tag)
    else:
        _from = base

    GitCommand("rebase", cwd=repo.path)([_from])