From 98d92d63e2af073d4703c9a6333162a8d7a083e2 Mon Sep 17 00:00:00 2001 From: "iannucci@chromium.org" Date: Wed, 20 Aug 2014 23:53:59 +0000 Subject: [PATCH] Make sync_chromium use the git-cache when on the bots. This should help bootstrapping speed, as well as allow better clobbering support. R=agable@chromium.org TBR=agable@chromium.org, kjellander@webrtc.org, szager@chromium.org BUG=2863, chromium:339647 Review URL: https://webrtc-codereview.appspot.com/17179004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6943 4adac7df-926f-26a2-2b94-8c16560cd09d --- sync_chromium.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sync_chromium.py b/sync_chromium.py index e5ec7c79b..5bd7245cb 100755 --- a/sync_chromium.py +++ b/sync_chromium.py @@ -53,11 +53,29 @@ def main(): env['GYP_CHROMIUM_NO_ACTION'] = '1' gclient_cmd = 'gclient.bat' if sys.platform.startswith('win') else 'gclient' args = [ - gclient_cmd, 'sync', '--no-history', '--force', '--revision', - 'src@'+opts.target_revision] + gclient_cmd, 'sync', '--force', '--revision', 'src@'+opts.target_revision + ] + if os.environ.get('CHROME_HEADLESS') == '1': args.append('-vvv') + if sys.platform.startswith('win'): + cache_path = os.path.join(os.path.splitdrive(ROOT_DIR)[0], + 'b', 'git-cache') + else: + cache_path = '/b/git-cache' + + with open(os.path.join(opts.chromium_dir, '.gclient'), 'rb') as spec: + spec = spec.read().splitlines() + spec[-1] = 'cache_dir = %r' % (cache_path,) + args.append('--spec') + args.append('\n'.join(spec)) + args.append('--delete_unversioned_trees') + args.append('--reset') + args.append('--upstream') + else: + args.append('--no-history') + target_os_list = get_target_os_list() if target_os_list: args += ['--deps=' + target_os_list]