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])
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)
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)
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])
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])
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])