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

Side by Side Diff: fetch.py

Issue 13878009: Control the order of gclient spec keys in fetch (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 7 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
« 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 (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 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 """ 6 """
7 Tool to perform checkouts in one easy command line! 7 Tool to perform checkouts in one easy command line!
8 8
9 Usage: 9 Usage:
10 fetch <recipe> [--property=value [--property2=value2 ...]] 10 fetch <recipe> [--property=value [--property2=value2 ...]]
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return self.run((svn_path,) + cmd, **kwargs) 95 return self.run((svn_path,) + cmd, **kwargs)
96 96
97 97
98 class GclientGitCheckout(GclientCheckout, GitCheckout): 98 class GclientGitCheckout(GclientCheckout, GitCheckout):
99 99
100 def __init__(self, dryrun, spec, root): 100 def __init__(self, dryrun, spec, root):
101 super(GclientGitCheckout, self).__init__(dryrun, spec, root) 101 super(GclientGitCheckout, self).__init__(dryrun, spec, root)
102 assert 'solutions' in self.spec 102 assert 'solutions' in self.spec
103 keys = ['solutions', 'target_os', 'target_os_only'] 103 keys = ['solutions', 'target_os', 'target_os_only']
104 gclient_spec = '\n'.join('%s = %s' % (key, self.spec[key]) 104 gclient_spec = '\n'.join('%s = %s' % (key, self.spec[key])
105 for key in self.spec if key in keys) 105 for key in keys if key in self.spec)
106 self.spec['gclient_spec'] = gclient_spec 106 self.spec['gclient_spec'] = gclient_spec
107 107
108 def exists(self): 108 def exists(self):
109 return os.path.exists(os.path.join(os.getcwd(), self.root)) 109 return os.path.exists(os.path.join(os.getcwd(), self.root))
110 110
111 def init(self): 111 def init(self):
112 # TODO(dpranke): Work around issues w/ delta compression on big repos. 112 # TODO(dpranke): Work around issues w/ delta compression on big repos.
113 self.run_git('config', '--global', 'core.deltaBaseCacheLimit', '1G') 113 self.run_git('config', '--global', 'core.deltaBaseCacheLimit', '1G')
114 114
115 # Configure and do the gclient checkout. 115 # Configure and do the gclient checkout.
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 270
271 def main(): 271 def main():
272 dryrun, recipe, props = handle_args(sys.argv) 272 dryrun, recipe, props = handle_args(sys.argv)
273 spec, root = run_recipe_fetch(recipe, props) 273 spec, root = run_recipe_fetch(recipe, props)
274 return run(dryrun, spec, root) 274 return run(dryrun, spec, root)
275 275
276 276
277 if __name__ == '__main__': 277 if __name__ == '__main__':
278 sys.exit(main()) 278 sys.exit(main())
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