Commit 1917f7a0 authored by Stephen Martinis's avatar Stephen Martinis Committed by Commit Bot

Revert "Fetch the input commit ref when both ref and id are specified."

This reverts commit 72a245e4.

Reason for revert: crbug.com/1022617

Original change's description:
> Fetch the input commit ref when both ref and id are specified.
> 
> This causes --refs refs/head/master to be added to bot_update calls when
> the input build message contains a commit id and the refs/head/master
> ref. This is an effective no-op.
> 
> When bot_update clones a git repository, it results in HEAD referring to
> master in contrast to the non-clone case which results in a detached
> HEAD. This prevents fetching refs/heads/master, so detach the HEAD after
> cloning.
> 
> Bug: 922150
> Change-Id: I357a78305020218e9f5d350832a706b8f2b27967
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Recipe-Nontrivial-Roll: infra
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1900735
> Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>

TBR=ehmaldonado@chromium.org,gbeaty@chromium.org

Change-Id: Ibd6c6ed272b0c98f82be50cefa521aaee0444f11
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 922150, 1022617
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1904099Reviewed-by: 's avatarStephen Martinis <martiniss@chromium.org>
Commit-Queue: Stephen Martinis <martiniss@chromium.org>
parent a14152fd
......@@ -56,7 +56,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#500)(self, bot_update_step):**
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#498)(self, bot_update_step):**
Deapplies a patch, taking care of DEPS and solution revisions properly.
......@@ -87,7 +87,7 @@ Args:
step_test_data: a null function that returns test bot_update.py output.
Use test_api.output_json to generate test data.
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#477)(self, project_name, gclient_config=None):**
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#475)(self, project_name, gclient_config=None):**
Returns all property names used for storing the checked-out revision of
a given project.
......@@ -105,7 +105,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#36)(self):**
&mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#427)(self, bot_update_json, name):**
&mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#425)(self, bot_update_json, name):**
Set a fixed revision for a single dependency using project revision
properties.
......
......@@ -190,8 +190,6 @@ class BotUpdateApi(recipe_api.RecipeApi):
# e.g. they want to force refs/heads/master at the config level.
main_repo_path = self._get_commit_repo_path(in_commit, cfg)
revisions[main_repo_path] = revisions.get(main_repo_path) or in_commit_rev
if in_commit.id and in_commit.ref:
refs = [in_commit.ref] + refs
# Guarantee that first solution has a revision.
# TODO(machenbach): We should explicitly pass HEAD for ALL solutions
......
......@@ -16,8 +16,6 @@
"/path/to/tmp/json",
"--revision",
"src@2d72510e447ab60a9728aeea2362d8be2cbd7789",
"--refs",
"refs/heads/master",
"--disable-syntax-validation"
],
"env_suffixes": {
......
......@@ -16,8 +16,6 @@
"/path/to/tmp/json",
"--revision",
"src@2d72510e447ab60a9728aeea2362d8be2cbd7789",
"--refs",
"refs/heads/master",
"--disable-syntax-validation"
],
"env_suffixes": {
......
......@@ -16,8 +16,6 @@
"/path/to/tmp/json",
"--revision",
"src@2d72510e447ab60a9728aeea2362d8be2cbd7789",
"--refs",
"refs/heads/master",
"--with_branch_heads",
"--disable-syntax-validation"
],
......
......@@ -18,8 +18,6 @@
"got_revision@src",
"--revision",
"src@HEAD",
"--refs",
"refs/heads/master",
"--disable-syntax-validation"
],
"env_suffixes": {
......
......@@ -18,8 +18,6 @@
"got_revision@src",
"--revision",
"src@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"--refs",
"refs/heads/master",
"--disable-syntax-validation"
],
"env_suffixes": {
......
......@@ -16,8 +16,6 @@
"/path/to/tmp/json",
"--revision",
"src@2d72510e447ab60a9728aeea2362d8be2cbd7789",
"--refs",
"refs/heads/master",
"--disable-syntax-validation"
],
"env_suffixes": {
......
......@@ -16,8 +16,6 @@
"/path/to/tmp/json",
"--revision",
"src@2d72510e447ab60a9728aeea2362d8be2cbd7789",
"--refs",
"refs/heads/master",
"--disable-syntax-validation"
],
"env_suffixes": {
......
......@@ -724,8 +724,6 @@ def _git_checkout(sln, sln_dir, revisions, refs, no_fetch_tags, git_cache_dir,
if not path.isdir(sln_dir):
git('clone', '--no-checkout', '--local', '--shared', mirror_dir,
sln_dir)
# Detach HEAD to be consistent with the non-clone case
git('checkout', 'master', '--detach')
_git_disable_gc(sln_dir)
else:
_git_disable_gc(sln_dir)
......
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