Add option to gclient to ignore cache locks

BUG=261741

Review URL: https://codereview.chromium.org/349643004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@279150 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient.py b/gclient.py
index c910684..6a7b0e4 100755
--- a/gclient.py
+++ b/gclient.py
@@ -1761,6 +1761,8 @@
   parser.add_option('--shallow', action='store_true',
                     help='GIT ONLY - Do a shallow clone into the cache dir. '
                          'Requires Git 1.9+')
+  parser.add_option('--ignore_locks', action='store_true',
+                    help='GIT ONLY - Ignore cache locks.')
   (options, args) = parser.parse_args(args)
   client = GClient.LoadCurrentConfig(options)
 
diff --git a/gclient_scm.py b/gclient_scm.py
index ece6413..5045f70 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -798,7 +798,8 @@
         depth = 10000
     else:
       depth = None
-    mirror.populate(verbose=options.verbose, bootstrap=True, depth=depth)
+    mirror.populate(verbose=options.verbose, bootstrap=True, depth=depth,
+                    ignore_lock=options.ignore_locks)
     mirror.unlock()
 
   def _Clone(self, revision, url, options):