Commit cbdf0c1e authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

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: 's avatarDirk Pranke <dpranke@google.com>
parent e7a31f42
...@@ -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#524)(self, bot_update_step):** &mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#525)(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#501)(self, project_name, gclient_config=None):** &mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#502)(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#452)(self, bot_update_json, name):** &mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#453)(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. might differ from refs/heads/master or refs/heads/main.
Args: Args:
* cfg: The used gclient config. * cfg: The used gclient config.
...@@ -434,7 +434,8 @@ class BotUpdateApi(recipe_api.RecipeApi): ...@@ -434,7 +434,8 @@ 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, returns 'HEAD' otherwise. and if different from refs/heads/master or refs/heads/main, returns
'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)
...@@ -444,7 +445,7 @@ class BotUpdateApi(recipe_api.RecipeApi): ...@@ -444,7 +445,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/master', 'refs/heads/master']: if target_ref in ['refs/heads/main', '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