From 09315982bc3a35d9f02ac1892270953d6cbec795 Mon Sep 17 00:00:00 2001 From: Robert Iannucci Date: Sat, 5 Oct 2019 08:12:03 +0000 Subject: [PATCH] [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 Commit-Queue: Andrii Shyshkalov Reviewed-by: Andrii Shyshkalov --- git_cache.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git_cache.py b/git_cache.py index 4d3892df9..17b8cdee3 100755 --- a/git_cache.py +++ b/git_cache.py @@ -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,