Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: git_cache.py

Issue 183643002: Remove --update-shallow from git-cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """A git command for managing a local cache of git repositories.""" 6 """A git command for managing a local cache of git repositories."""
7 7
8 import errno 8 import errno
9 import logging 9 import logging
10 import optparse 10 import optparse
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 dir=options.cache_dir) 211 dir=options.cache_dir)
212 RunGit(['init', '--bare'], cwd=tempdir) 212 RunGit(['init', '--bare'], cwd=tempdir)
213 _config(tempdir) 213 _config(tempdir)
214 fetch_cmd = ['fetch'] + v + d + ['--tags', 'origin'] 214 fetch_cmd = ['fetch'] + v + d + ['--tags', 'origin']
215 RunGit(fetch_cmd, filter_fn=filter_fn, cwd=tempdir, retry=True) 215 RunGit(fetch_cmd, filter_fn=filter_fn, cwd=tempdir, retry=True)
216 os.rename(tempdir, repo_dir) 216 os.rename(tempdir, repo_dir)
217 else: 217 else:
218 _config(repo_dir) 218 _config(repo_dir)
219 if options.depth and os.path.exists(os.path.join(repo_dir, 'shallow')): 219 if options.depth and os.path.exists(os.path.join(repo_dir, 'shallow')):
220 logging.warn('Shallow fetch requested, but repo cache already exists.') 220 logging.warn('Shallow fetch requested, but repo cache already exists.')
221 fetch_cmd = ['fetch'] + v + ['--update-shallow', '--tags', 'origin'] 221 fetch_cmd = ['fetch'] + v + ['--tags', 'origin']
222 RunGit(fetch_cmd, filter_fn=filter_fn, cwd=repo_dir, retry=True) 222 RunGit(fetch_cmd, filter_fn=filter_fn, cwd=repo_dir, retry=True)
223 223
224 224
225 @subcommand.usage('[url of repo to unlock, or -a|--all]') 225 @subcommand.usage('[url of repo to unlock, or -a|--all]')
226 def CMDunlock(parser, args): 226 def CMDunlock(parser, args):
227 """Unlock one or all repos if their lock files are still around.""" 227 """Unlock one or all repos if their lock files are still around."""
228 parser.add_option('--force', '-f', action='store_true', 228 parser.add_option('--force', '-f', action='store_true',
229 help='Actually perform the action') 229 help='Actually perform the action')
230 parser.add_option('--all', '-a', action='store_true', 230 parser.add_option('--all', '-a', action='store_true',
231 help='Unlock all repository caches') 231 help='Unlock all repository caches')
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 return options, args 294 return options, args
295 295
296 296
297 def main(argv): 297 def main(argv):
298 dispatcher = subcommand.CommandDispatcher(__name__) 298 dispatcher = subcommand.CommandDispatcher(__name__)
299 return dispatcher.execute(OptionParser(), argv) 299 return dispatcher.execute(OptionParser(), argv)
300 300
301 301
302 if __name__ == '__main__': 302 if __name__ == '__main__':
303 sys.exit(main(sys.argv[1:])) 303 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698