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

Side by Side Diff: gclient.py

Issue 229653002: Make git_cache.py import-able. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 8 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 | gclient_scm.py » ('j') | gclient_scm.py » ('J')
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 (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 """Meta checkout manager supporting both Subversion and GIT.""" 6 """Meta checkout manager supporting both Subversion and GIT."""
7 # Files 7 # Files
8 # .gclient : Current client configuration, written by 'config' command. 8 # .gclient : Current client configuration, written by 'config' command.
9 # Format is a Python script defining 'solutions', a list whose 9 # Format is a Python script defining 'solutions', a list whose
10 # entries each are maps binding the strings "name" and "url" 10 # entries each are maps binding the strings "name" and "url"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 import sys 90 import sys
91 import time 91 import time
92 import urllib 92 import urllib
93 import urlparse 93 import urlparse
94 94
95 import breakpad # pylint: disable=W0611 95 import breakpad # pylint: disable=W0611
96 96
97 import fix_encoding 97 import fix_encoding
98 import gclient_scm 98 import gclient_scm
99 import gclient_utils 99 import gclient_utils
100 import git_cache
100 from third_party.repo.progress import Progress 101 from third_party.repo.progress import Progress
101 import subcommand 102 import subcommand
102 import subprocess2 103 import subprocess2
103 from third_party import colorama 104 from third_party import colorama
104 105
105 106
106 class GClientKeywords(object): 107 class GClientKeywords(object):
107 class FromImpl(object): 108 class FromImpl(object):
108 """Used to implement the From() syntax.""" 109 """Used to implement the From() syntax."""
109 110
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 gclient_utils.SyntaxErrorToError('.gclient', e) 1088 gclient_utils.SyntaxErrorToError('.gclient', e)
1088 1089
1089 # Append any target OS that is not already being enforced to the tuple. 1090 # Append any target OS that is not already being enforced to the tuple.
1090 target_os = config_dict.get('target_os', []) 1091 target_os = config_dict.get('target_os', [])
1091 if config_dict.get('target_os_only', False): 1092 if config_dict.get('target_os_only', False):
1092 self._enforced_os = tuple(set(target_os)) 1093 self._enforced_os = tuple(set(target_os))
1093 else: 1094 else:
1094 self._enforced_os = tuple(set(self._enforced_os).union(target_os)) 1095 self._enforced_os = tuple(set(self._enforced_os).union(target_os))
1095 1096
1096 gclient_scm.GitWrapper.cache_dir = config_dict.get('cache_dir') 1097 gclient_scm.GitWrapper.cache_dir = config_dict.get('cache_dir')
1098 git_cache.Mirror.SetCachePath(config_dict.get('cache_dir'))
1097 1099
1098 if not target_os and config_dict.get('target_os_only', False): 1100 if not target_os and config_dict.get('target_os_only', False):
1099 raise gclient_utils.Error('Can\'t use target_os_only if target_os is ' 1101 raise gclient_utils.Error('Can\'t use target_os_only if target_os is '
1100 'not specified') 1102 'not specified')
1101 1103
1102 deps_to_add = [] 1104 deps_to_add = []
1103 for s in config_dict.get('solutions', []): 1105 for s in config_dict.get('solutions', []):
1104 try: 1106 try:
1105 deps_to_add.append(Dependency( 1107 deps_to_add.append(Dependency(
1106 self, s['name'], s['url'], 1108 self, s['name'], s['url'],
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1964 print >> sys.stderr, 'Error: %s' % str(e) 1966 print >> sys.stderr, 'Error: %s' % str(e)
1965 return 1 1967 return 1
1966 finally: 1968 finally:
1967 gclient_utils.PrintWarnings() 1969 gclient_utils.PrintWarnings()
1968 1970
1969 1971
1970 if '__main__' == __name__: 1972 if '__main__' == __name__:
1971 sys.exit(Main(sys.argv[1:])) 1973 sys.exit(Main(sys.argv[1:]))
1972 1974
1973 # vim: ts=2:sw=2:tw=80:et: 1975 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | gclient_scm.py » ('j') | gclient_scm.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698