From 0081c0ff173c3af29933cbc6965d4a2d83b09576 Mon Sep 17 00:00:00 2001 From: Robert Iannucci Date: Sun, 29 Sep 2019 08:30:54 +0000 Subject: [PATCH] [git-cache] Add option to update_bootstrap to skip the populate step. This will allow us to separate the 'populate' and 'upload' phases in the git cache updater recipe, which will allow us to do all the 'populate' steps in parallel, but then limit the parallelism of the `pack/gc/upload` operations. R=tandrii@chromium.org Change-Id: I8b8a9155f86350be37ed5a67c592ff1fec4d42ff Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1830857 Auto-Submit: Robbie Iannucci Commit-Queue: Andrii Shyshkalov Reviewed-by: Andrii Shyshkalov --- git_cache.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/git_cache.py b/git_cache.py index 6b8cd7f67..8d050c36c 100755 --- a/git_cache.py +++ b/git_cache.py @@ -700,14 +700,21 @@ def CMDupdate_bootstrap(parser, args): print('Sorry, update bootstrap will not work on Windows.', file=sys.stderr) return 1 + parser.add_option('--skip-populate', action='store_true', + help='Skips "populate" step if mirror already exists.') parser.add_option('--gc-aggressive', action='store_true', help='Run aggressive repacking of the repo.') parser.add_option('--prune', action='store_true', help='Prune all other cached bundles of the same repo.') - # First, we need to ensure the cache is populated. populate_args = args[:] - CMDpopulate(parser, populate_args) + options, args = parser.parse_args(args) + url = args[0] + mirror = Mirror(url) + if not options.skip_populate or not mirror.exists(): + CMDpopulate(parser, populate_args) + else: + print('Skipped populate step.') # Get the repo directory. options, args = parser.parse_args(args)