From 17cd53de67f982f123bfa6458780c31705221e60 Mon Sep 17 00:00:00 2001 From: Edward Lesmes Date: Tue, 10 Nov 2020 18:51:03 +0000 Subject: [PATCH] Revert "Return HEAD when ref is refs/heads/main" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cbdf0c1e41173a75fbb78a42eb08f8509f0a47de. Reason for revert: Broke tint bots From log: https://logs.chromium.org/logs/tint/buildbucket/cr-buildbucket.appspot.com/8864003131025797600/+/steps/bot_update/0/stdout Bot page: https://ci.chromium.org/p/tint/builders/try/linux-clang-rel-x64/b8864003131025797600? Original change's description: > Return HEAD when ref is refs/heads/main > > R=​ehmaldonado@chromium.org > > Change-Id: I67b40cf48f0f9880e0f055a83d768bbefd704892 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2528118 > Commit-Queue: Josip Sokcevic > Reviewed-by: Dirk Pranke TBR=dpranke@google.com,ehmaldonado@chromium.org,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com Bug: 1147494 Change-Id: Ieb21e15161ccc267f5d453a0196b1f0a2b43f366 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2529700 Reviewed-by: Edward Lesmes Commit-Queue: Edward Lesmes --- recipes/README.recipes.md | 6 +++--- recipes/recipe_modules/bot_update/api.py | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/recipes/README.recipes.md b/recipes/README.recipes.md index c39ff4d6ca..c2a5d542b2 100644 --- a/recipes/README.recipes.md +++ b/recipes/README.recipes.md @@ -58,7 +58,7 @@ Recipe module to ensure a checkout is consistent on a bot. Wrapper for easy calling of bot_update. -— **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#525)(self, bot_update_step):** +— **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#524)(self, bot_update_step):** Deapplies a patch, taking care of DEPS and solution revisions properly. @@ -91,7 +91,7 @@ Args: * enforce_fetch: Enforce a new fetch to refresh the git cache, even if the solution revision passed in already exists in the current git cache. -— **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#502)(self, project_name, gclient_config=None):** +— **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#501)(self, project_name, gclient_config=None):** Returns all property names used for storing the checked-out revision of a given project. @@ -109,7 +109,7 @@ Returns (list of str): All properties that'll hold the checked-out revision   **@property**
— **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#44)(self):** -— **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#453)(self, bot_update_json, name):** +— **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#452)(self, bot_update_json, name):** Sets a fixed revision for a single dependency using project revision properties. diff --git a/recipes/recipe_modules/bot_update/api.py b/recipes/recipe_modules/bot_update/api.py index d3d34a65ff..86c95cdad0 100644 --- a/recipes/recipe_modules/bot_update/api.py +++ b/recipes/recipe_modules/bot_update/api.py @@ -424,7 +424,7 @@ class BotUpdateApi(recipe_api.RecipeApi): If there's no Gerrit CL associated with the run, returns 'HEAD'. Otherwise this queries Gerrit for the correct destination ref, which - might differ from refs/heads/master or refs/heads/main. + might differ from refs/heads/master. Args: * cfg: The used gclient config. @@ -434,8 +434,7 @@ class BotUpdateApi(recipe_api.RecipeApi): Returns: A destination ref as understood by bot_update.py if available - and if different from refs/heads/master or refs/heads/main, returns - 'HEAD' otherwise. + and if different from refs/heads/master, returns 'HEAD' otherwise. """ # Ignore project paths other than the one belonging to the current CL. patch_path = self.m.gclient.get_gerrit_patch_root(gclient_config=cfg) @@ -445,7 +444,7 @@ class BotUpdateApi(recipe_api.RecipeApi): return 'HEAD' target_ref = self.m.tryserver.gerrit_change_target_ref - if target_ref in ['refs/heads/main', 'refs/heads/master']: + if target_ref in ['refs/heads/master', 'refs/heads/master']: return 'HEAD' return target_ref