Commit 17cd53de authored by Edward Lesmes's avatar Edward Lesmes Committed by LUCI CQ

Revert "Return HEAD when ref is refs/heads/main"

This reverts commit cbdf0c1e.

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 <sokcevic@google.com>
> Reviewed-by: Dirk Pranke <dpranke@google.com>

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/+/2529700Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent edd94d2b
...@@ -58,7 +58,7 @@ Recipe module to ensure a checkout is consistent on a bot. ...@@ -58,7 +58,7 @@ Recipe module to ensure a checkout is consistent on a bot.
Wrapper for easy calling of bot_update. Wrapper for easy calling of bot_update.
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#525)(self, bot_update_step):** &mdash; **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. Deapplies a patch, taking care of DEPS and solution revisions properly.
...@@ -91,7 +91,7 @@ Args: ...@@ -91,7 +91,7 @@ Args:
* enforce_fetch: Enforce a new fetch to refresh the git cache, even if the * 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. solution revision passed in already exists in the current git cache.
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#502)(self, project_name, gclient_config=None):** &mdash; **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 Returns all property names used for storing the checked-out revision of
a given project. a given project.
...@@ -109,7 +109,7 @@ Returns (list of str): All properties that'll hold the checked-out revision ...@@ -109,7 +109,7 @@ Returns (list of str): All properties that'll hold the checked-out revision
&emsp; **@property**<br>&mdash; **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#44)(self):** &emsp; **@property**<br>&mdash; **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#44)(self):**
&mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#453)(self, bot_update_json, name):** &mdash; **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 Sets a fixed revision for a single dependency using project revision
properties. properties.
......
...@@ -424,7 +424,7 @@ class BotUpdateApi(recipe_api.RecipeApi): ...@@ -424,7 +424,7 @@ class BotUpdateApi(recipe_api.RecipeApi):
If there's no Gerrit CL associated with the run, returns 'HEAD'. If there's no Gerrit CL associated with the run, returns 'HEAD'.
Otherwise this queries Gerrit for the correct destination ref, which 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: Args:
* cfg: The used gclient config. * cfg: The used gclient config.
...@@ -434,8 +434,7 @@ class BotUpdateApi(recipe_api.RecipeApi): ...@@ -434,8 +434,7 @@ class BotUpdateApi(recipe_api.RecipeApi):
Returns: Returns:
A destination ref as understood by bot_update.py if available A destination ref as understood by bot_update.py if available
and if different from refs/heads/master or refs/heads/main, returns and if different from refs/heads/master, returns 'HEAD' otherwise.
'HEAD' otherwise.
""" """
# Ignore project paths other than the one belonging to the current CL. # Ignore project paths other than the one belonging to the current CL.
patch_path = self.m.gclient.get_gerrit_patch_root(gclient_config=cfg) patch_path = self.m.gclient.get_gerrit_patch_root(gclient_config=cfg)
...@@ -445,7 +444,7 @@ class BotUpdateApi(recipe_api.RecipeApi): ...@@ -445,7 +444,7 @@ class BotUpdateApi(recipe_api.RecipeApi):
return 'HEAD' return 'HEAD'
target_ref = self.m.tryserver.gerrit_change_target_ref 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 'HEAD'
return target_ref return target_ref
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment