Commit 5623aeeb authored by Takuto Ikuta's avatar Takuto Ikuta Committed by Commit Bot

Introduce GIT_TRACE for chromium/src in bot_update step

This CL is tested on
https://ci.chromium.org/swarming/task/3d5fde091e610010?server=chromium-swarm.appspot.com

api.py change is for auto roller

Bug: 840592
Change-Id: Ib6195dc1f4539c8f02fe0696dc140b4cf0973baf
Reviewed-on: https://chromium-review.googlesource.com/1049987
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
parent 04065d39
......@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Recipe module to ensure a checkout is consistent on a bot."""
from recipe_engine import recipe_api
......
......@@ -150,7 +150,7 @@ def call(*args, **kwargs): # pragma: no cover
kwargs['stdin'] = subprocess.PIPE
out = cStringIO.StringIO()
new_env = kwargs.get('env', {})
env = copy.copy(os.environ)
env = os.environ.copy()
env.update(new_env)
kwargs['env'] = env
......@@ -672,11 +672,16 @@ def _git_checkout(sln, sln_dir, revisions, shallow, refs, git_cache_dir,
for ref in refs:
populate_cmd.extend(['--ref', ref])
env = {}
if url == CHROMIUM_SRC_URL or url + '.git' == CHROMIUM_SRC_URL:
# This is for performance investigation of `git fetch` in chromium/src.
env = {'GIT_TRACE': 'true'}
# Step 1: populate/refresh cache, if necessary.
pin = get_target_pin(name, url, revisions)
if not pin:
# Refresh only once.
git(*populate_cmd)
git(*populate_cmd, env=env)
elif _has_in_git_cache(pin, git_cache_dir, url):
# No need to fetch at all, because we already have needed revision.
pass
......@@ -690,7 +695,7 @@ def _git_checkout(sln, sln_dir, revisions, shallow, refs, git_cache_dir,
# TODO(tandrii): propagate the pin to git server per recommendation of
# maintainers of *.googlesource.com (workaround git server replication
# lag).
git(*populate_cmd)
git(*populate_cmd, env=env)
if _has_in_git_cache(pin, git_cache_dir, url):
break
overrun = time.time() - soft_deadline
......
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