From 06101933267d1eadc3daa6b5d2ea736a9f7181a6 Mon Sep 17 00:00:00 2001 From: Dale Curtis Date: Mon, 30 Mar 2020 23:01:43 +0000 Subject: [PATCH] Don't delete dormant branches, even if empty. 1) The current behavior feels contrary to the documentation; which says "If true, will cause rebase-update to skip all processing on the branch." 2) The new behavior allows a workflow where 'master' is empty and marked dormant, but kept up to date as the parent for all other branches. Change-Id: Ic7440706a69753f796846dd84ecbf8bcf172ba4c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2128675 Auto-Submit: Dale Curtis Commit-Queue: Edward Lesmes Reviewed-by: Edward Lesmes --- git_rebase_update.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git_rebase_update.py b/git_rebase_update.py index a559d072a..b02ad73c2 100755 --- a/git_rebase_update.py +++ b/git_rebase_update.py @@ -92,6 +92,9 @@ def remove_empty_branches(branch_tree): reparents = {} downstreams = collections.defaultdict(list) for branch, parent in git.topo_iter(branch_tree, top_down=False): + if git.is_dormant(branch): + continue + downstreams[parent].append(branch) # If branch and parent have the same tree, then branch has to be marked