Commit 09315982 authored by Robert Iannucci's avatar Robert Iannucci Committed by Commit Bot

[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: 's avatarAndrii Shyshkalov <tandrii@google.com>
parent d696f201
......@@ -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,
......
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