Don't enforce branch limit on rebase-update if only rebasing current

Bug: 1421399
Change-Id: I29ebcef2a88256aac6153556af75158679f44296
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4311855
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
changes/55/4311855/4
Gavin Mak 2 years ago committed by LUCI CQ
parent 6eccb0e24c
commit 2cbe95c7c8

@ -502,7 +502,7 @@ def freeze():
return ' '.join(ret) or None
def get_branch_tree():
def get_branch_tree(use_limit=False):
"""Get the dictionary of {branch: parent}, compatible with topo_iter.
Returns a tuple of (skipped, <branch_tree dict>) where skipped is a set of
@ -511,7 +511,7 @@ def get_branch_tree():
skipped = set()
branch_tree = {}
for branch in branches():
for branch in branches(use_limit=use_limit):
parent = upstream(branch)
if not parent:
skipped.add(branch)

@ -268,7 +268,7 @@ def main(args=None):
if opts.current:
branches_to_rebase.add(git.current_branch())
skipped, branch_tree = git.get_branch_tree()
skipped, branch_tree = git.get_branch_tree(use_limit=not opts.current)
if branches_to_rebase:
skipped = set(skipped).intersection(branches_to_rebase)
for branch in skipped:
@ -321,7 +321,7 @@ def main(args=None):
remove_empty_branches(branch_tree)
# return_branch may not be there any more.
if return_branch in git.branches():
if return_branch in git.branches(use_limit=False):
git.run('checkout', return_branch)
git.thaw()
else:

Loading…
Cancel
Save