From ba883cb5ed14aac5d81d6105caabf505c3afe8c6 Mon Sep 17 00:00:00 2001 From: John Budorick Date: Wed, 15 Aug 2018 18:17:34 +0000 Subject: [PATCH] bot_update: only fetch explicit refs for the main solution. Bug: 865882 Change-Id: I27bfbeaf7395a05ce660e9e961550233461acb3d Reviewed-on: https://chromium-review.googlesource.com/1175857 Reviewed-by: Andrii Shyshkalov Reviewed-by: Edward Lesmes Commit-Queue: John Budorick --- recipes/README.recipes.md | 4 ++-- recipes/recipe_modules/bot_update/api.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/recipes/README.recipes.md b/recipes/README.recipes.md index b9c26aaf4..63ed57c2d 100644 --- a/recipes/README.recipes.md +++ b/recipes/README.recipes.md @@ -53,7 +53,7 @@ Wrapper for easy calling of bot_update. — **def [apply\_gerrit\_ref](/recipes/recipe_modules/bot_update/api.py#52)(self, root, gerrit_no_reset=False, gerrit_no_rebase_patch_ref=False, gerrit_repo=None, gerrit_ref=None, step_name='apply_gerrit', \*\*kwargs):** -— **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#408)(self, bot_update_step):** +— **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#413)(self, bot_update_step):** Deapplies a patch, taking care of DEPS and solution revisions properly. @@ -69,7 +69,7 @@ Args: manifest_name: The name of the manifest to upload to LogDog. This must be unique for the whole build. -— **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#385)(self, project_name, gclient_config=None):** +— **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#390)(self, project_name, gclient_config=None):** Returns all property names used for storing the checked-out revision of a given project. diff --git a/recipes/recipe_modules/bot_update/api.py b/recipes/recipe_modules/bot_update/api.py index ae2868adb..6675d1271 100644 --- a/recipes/recipe_modules/bot_update/api.py +++ b/recipes/recipe_modules/bot_update/api.py @@ -184,7 +184,12 @@ class BotUpdateApi(recipe_api.RecipeApi): fixed_revision = self._destination_branch(cfg, name) # If we're syncing to a ref, we want to make sure it exists before # trying to check it out. - if fixed_revision.startswith('refs/'): + if (fixed_revision.startswith('refs/') and + # TODO(crbug.com/874501): fetching additional refs is currently + # only supported for the root solution. We should investigate + # supporting it for other dependencies. + cfg.solutions and + cfg.solutions[0].name == name): # Handle the "ref:revision" syntax, e.g. # refs/branch-heads/4.2:deadbeef refs.append(fixed_revision.split(':')[0])