[git_cache] Add option to break locks on populate.

R=ehmaldonado@chromium.org, tandrii@chromium.org

Change-Id: Icd7b0afc98e6d9365f74e8a6eb232700c6362d17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1842832
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
This commit is contained in:
Robert Iannucci
2019-10-05 08:12:03 +00:00
committed by Commit Bot
parent d696f20129
commit 09315982bc

View File

@@ -745,6 +745,9 @@ def CMDpopulate(parser, args):
parser.add_option('--ignore_locks', '--ignore-locks',
action='store_true',
help='Don\'t try to lock repository')
parser.add_option('--break-locks',
action='store_true',
help='Break any existing lock instead of just ignoring it')
parser.add_option('--reset-fetch-config', action='store_true', default=False,
help='Reset the fetch config before populating the cache.')
@@ -754,6 +757,8 @@ def CMDpopulate(parser, args):
url = args[0]
mirror = Mirror(url, refs=options.ref)
if options.break_locks:
mirror.unlock()
kwargs = {
'verbose': options.verbose,
'shallow': options.shallow,