OLD | NEW |
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 Loading... |
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 Loading... |
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()) |
OLD | NEW |