mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Limit the rebase-update call after reparent-branch
Previously, `git reparent-branch` would call `git rebase-update --no-fetch` effectively rebasing all branches. Limit the branches to update to the one being moved and its dependants. Change-Id: Ifb9f5b0ab4afe18f9c642ca47d683d9f3745bede Reviewed-on: https://chromium-review.googlesource.com/c/1476393 Commit-Queue: Robbie Iannucci <iannucci@chromium.org> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
This commit is contained in:
committed by
Commit Bot
parent
3acdefa9aa
commit
9f273d01c0
@@ -12,6 +12,7 @@ import subprocess2
|
||||
|
||||
from git_common import upstream, current_branch, run, tags, set_branch_config
|
||||
from git_common import get_or_create_merge_base, root, manual_merge_base
|
||||
from git_common import get_branch_tree, topo_iter
|
||||
|
||||
import git_rebase_update
|
||||
|
||||
@@ -81,8 +82,13 @@ def main(args):
|
||||
|
||||
manual_merge_base(branch, mbase, new_parent)
|
||||
|
||||
# TODO(iannucci): ONLY rebase-update the branch which moved (and dependants)
|
||||
return git_rebase_update.main(['--no-fetch'])
|
||||
# ONLY rebase-update the branch which moved (and dependants)
|
||||
_, branch_tree = get_branch_tree()
|
||||
branches = [branch]
|
||||
for branch, parent in topo_iter(branch_tree):
|
||||
if parent in branches:
|
||||
branches.append(branch)
|
||||
return git_rebase_update.main(['--no-fetch'] + branches)
|
||||
|
||||
|
||||
if __name__ == '__main__': # pragma: no cover
|
||||
|
||||
Reference in New Issue
Block a user