Selaa lähdekoodia

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>
Gavin Mak 2 vuotta sitten
vanhempi
commit
2cbe95c7c8
2 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 2 2
      git_common.py
  2. 2 2
      git_rebase_update.py

+ 2 - 2
git_common.py

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

+ 2 - 2
git_rebase_update.py

@@ -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: