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

Remove bot_update assumption that HEAD is main

There is no need to override refs/heads/main to be HEAD. This may not
always be true, there is no benefits of doing so and it doesn't play
well with git_cache which will set HEAD to global default branch.

R=gavinmak@google.com

Bug: 1238084
Recipe-Manual-Change: build_limited
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: infra
Change-Id: I21ab3463baaf7f86562ab0c65c06c3ac0962a08c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3088295
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
parent 88382976
......@@ -58,7 +58,7 @@ Recipe module to ensure a checkout is consistent on a bot.
Wrapper for easy calling of bot_update.
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#531)(self, bot_update_step):**
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#527)(self, bot_update_step):**
Deapplies a patch, taking care of DEPS and solution revisions properly.
......@@ -95,7 +95,7 @@ Args:
bot_update module ONLY supports one change. Users may specify a change
via tryserver.set_change() and explicitly set this flag False.
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#508)(self, project_name, gclient_config=None):**
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#504)(self, project_name, gclient_config=None):**
Returns all property names used for storing the checked-out revision of
a given project.
......@@ -111,7 +111,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#47)(self):**
&mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#459)(self, bot_update_json, name):**
&mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#455)(self, bot_update_json, name):**
Sets a fixed revision for a single dependency using project revision
properties.
......
......@@ -450,11 +450,7 @@ class BotUpdateApi(recipe_api.RecipeApi):
if not patch_path or path != patch_path:
return 'HEAD'
target_ref = self.m.tryserver.gerrit_change_target_ref
if target_ref == 'refs/heads/main':
return 'HEAD'
return target_ref
return self.m.tryserver.gerrit_change_target_ref
def resolve_fixed_revision(self, bot_update_json, name):
"""Sets a fixed revision for a single dependency using project revision
......
......@@ -62,7 +62,9 @@
"--patch_ref",
"https://chromium.googlesource.com/chromium/src@refs/heads/main:refs/changes/56/123456/7",
"--revision",
"src@HEAD",
"src@refs/heads/main",
"--refs",
"refs/heads/main",
"--disable-syntax-validation"
],
"env": {
......
......@@ -64,7 +64,7 @@
"--revision",
"src@HEAD",
"--revision",
"src/third_party/angle@HEAD",
"src/third_party/angle@refs/heads/main",
"--disable-syntax-validation"
],
"env": {
......
......@@ -62,7 +62,9 @@
"--patch_ref",
"https://chromium.googlesource.com/chromium/src@refs/heads/main:refs/changes/56/123456/7",
"--revision",
"src@HEAD",
"src@refs/heads/main",
"--refs",
"refs/heads/main",
"--disable-syntax-validation"
],
"env": {
......
......@@ -62,7 +62,9 @@
"--patch_ref",
"https://chromium.googlesource.com/chromium/src@refs/heads/main:refs/changes/56/123456/7",
"--revision",
"src@HEAD",
"src@refs/heads/main",
"--refs",
"refs/heads/main",
"--disable-syntax-validation"
],
"env": {
......
......@@ -62,7 +62,9 @@
"--patch_ref",
"https://chromium.googlesource.com/chromium/src@refs/heads/main:refs/changes/56/123456/7",
"--revision",
"src@HEAD",
"src@refs/heads/main",
"--refs",
"refs/heads/main",
"--disable-syntax-validation"
],
"env": {
......
......@@ -64,7 +64,7 @@
"--revision",
"src@HEAD",
"--revision",
"src/third_party/angle@HEAD",
"src/third_party/angle@refs/heads/main",
"--disable-syntax-validation"
],
"env": {
......
......@@ -64,7 +64,7 @@
"--revision",
"src@HEAD",
"--revision",
"src/third_party/webrtc@HEAD",
"src/third_party/webrtc@refs/heads/main",
"--disable-syntax-validation"
],
"env": {
......
......@@ -64,7 +64,7 @@
"--revision",
"src@HEAD",
"--revision",
"src/v8@HEAD",
"src/v8@refs/heads/main",
"--disable-syntax-validation"
],
"env": {
......
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