From ea9e93f28c8d432445acc8208a6b885ffc5a803c Mon Sep 17 00:00:00 2001 From: rmistry Date: Tue, 13 Sep 2016 04:27:27 -0700 Subject: [PATCH] Skip apply_gerrit rebase when there is a rebase failure. Not doing so causes a failure in the 'git checkout $base_rev' step as visible here: https://build.chromium.org/p/client.skia.fyi/builders/Infra-PerCommit-Trybot/builds/4995 This causes the checkout to remain in the "rebase in progress" state. BUG=chromium:645955 BUG=skia:5749 Committed: https://chromium.googlesource.com/chromium/tools/depot_tools/+/9736fe8938e67337bb45dccf79ae8699b9625fa6 Review-Url: https://codereview.chromium.org/2328313002 --- recipe_modules/bot_update/resources/bot_update.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/recipe_modules/bot_update/resources/bot_update.py b/recipe_modules/bot_update/resources/bot_update.py index 044f0838f..f4a307b25 100755 --- a/recipe_modules/bot_update/resources/bot_update.py +++ b/recipe_modules/bot_update/resources/bot_update.py @@ -604,7 +604,12 @@ def apply_gerrit_ref(gerrit_repo, gerrit_ref, root, gerrit_reset, try: ok = False git('checkout', '-b', temp_branch_name, cwd=root) - git('rebase', base_rev, cwd=root) + try: + git('rebase', base_rev, cwd=root) + except SubprocessFailed: + # Abort the rebase since there were failures. + git('rebase', '--abort', cwd=root) + raise # Get off of the temporary branch since it can't be deleted otherwise. cur_rev = git('rev-parse', 'HEAD', cwd=root).strip()