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

Side by Side Diff: gclient_scm.py

Issue 278043005: Pass shallow flag through gclient to git_cache.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 7 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 | « gclient.py ('k') | 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 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Gclient-specific SCM-specific operations.""" 5 """Gclient-specific SCM-specific operations."""
6 6
7 from __future__ import print_function 7 from __future__ import print_function
8 8
9 import errno 9 import errno
10 import logging 10 import logging
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 } 758 }
759 # TODO(hinoka): This currently just fails because lkcr/lkgr are branches 759 # TODO(hinoka): This currently just fails because lkcr/lkgr are branches
760 # not tags. This also adds 20 seconds to every bot_update 760 # not tags. This also adds 20 seconds to every bot_update
761 # run, so I'm commenting this out until lkcr/lkgr become 761 # run, so I'm commenting this out until lkcr/lkgr become
762 # tags. (2014/4/24) 762 # tags. (2014/4/24)
763 # if url == CHROMIUM_SRC_URL or url + '.git' == CHROMIUM_SRC_URL: 763 # if url == CHROMIUM_SRC_URL or url + '.git' == CHROMIUM_SRC_URL:
764 # mirror_kwargs['refs'].extend(['refs/tags/lkgr', 'refs/tags/lkcr']) 764 # mirror_kwargs['refs'].extend(['refs/tags/lkgr', 'refs/tags/lkcr'])
765 if hasattr(options, 'with_branch_heads') and options.with_branch_heads: 765 if hasattr(options, 'with_branch_heads') and options.with_branch_heads:
766 mirror_kwargs['refs'].append('refs/branch-heads/*') 766 mirror_kwargs['refs'].append('refs/branch-heads/*')
767 mirror = git_cache.Mirror(url, **mirror_kwargs) 767 mirror = git_cache.Mirror(url, **mirror_kwargs)
768 mirror.populate(verbose=options.verbose, bootstrap=True) 768 if options.shallow:
769 # HACK(hinoka): These repositories should be super shallow.
770 if 'flash' in url:
771 depth = 10
772 else:
773 depth = 10000
774 else:
775 depth = None
776 mirror.populate(verbose=options.verbose, bootstrap=True, depth=depth)
769 mirror.unlock() 777 mirror.unlock()
770 return mirror.mirror_path if mirror.exists() else None 778 return mirror.mirror_path if mirror.exists() else None
771 779
772 def _Clone(self, revision, url, options): 780 def _Clone(self, revision, url, options):
773 """Clone a git repository from the given URL. 781 """Clone a git repository from the given URL.
774 782
775 Once we've cloned the repo, we checkout a working branch if the specified 783 Once we've cloned the repo, we checkout a working branch if the specified
776 revision is a branch head. If it is a tag or a specific commit, then we 784 revision is a branch head. If it is a tag or a specific commit, then we
777 leave HEAD detached as it makes future updates simpler -- in this case the 785 leave HEAD detached as it makes future updates simpler -- in this case the
778 user should first create a new branch or switch to an existing branch before 786 user should first create a new branch or switch to an existing branch before
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 new_command.append('--force') 1483 new_command.append('--force')
1476 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1484 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1477 new_command.extend(('--accept', 'theirs-conflict')) 1485 new_command.extend(('--accept', 'theirs-conflict'))
1478 elif options.manually_grab_svn_rev: 1486 elif options.manually_grab_svn_rev:
1479 new_command.append('--force') 1487 new_command.append('--force')
1480 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1488 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1481 new_command.extend(('--accept', 'postpone')) 1489 new_command.extend(('--accept', 'postpone'))
1482 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1490 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1483 new_command.extend(('--accept', 'postpone')) 1491 new_command.extend(('--accept', 'postpone'))
1484 return new_command 1492 return new_command
OLDNEW
« no previous file with comments | « gclient.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698