| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 keys if key in self.spec) | 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. | |
| 113 self.run_git('config', '--global', 'core.deltaBaseCacheLimit', '1G') | |
| 114 | |
| 115 # Configure and do the gclient checkout. | 112 # Configure and do the gclient checkout. |
| 116 self.run_gclient('config', '--spec', self.spec['gclient_spec']) | 113 self.run_gclient('config', '--spec', self.spec['gclient_spec']) |
| 117 if self.options.nohooks: | 114 if self.options.nohooks: |
| 118 self.run_gclient('sync', '--nohooks') | 115 self.run_gclient('sync', '--nohooks') |
| 119 else: | 116 else: |
| 120 self.run_gclient('sync') | 117 self.run_gclient('sync') |
| 121 | 118 |
| 122 # Configure git. | 119 # Configure git. |
| 123 wd = os.path.join(self.base, self.root) | 120 wd = os.path.join(self.base, self.root) |
| 124 if self.options.dry_run: | 121 if self.options.dry_run: |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 287 |
| 291 | 288 |
| 292 def main(): | 289 def main(): |
| 293 options, recipe, props = handle_args(sys.argv) | 290 options, recipe, props = handle_args(sys.argv) |
| 294 spec, root = run_recipe_fetch(recipe, props) | 291 spec, root = run_recipe_fetch(recipe, props) |
| 295 return run(options, spec, root) | 292 return run(options, spec, root) |
| 296 | 293 |
| 297 | 294 |
| 298 if __name__ == '__main__': | 295 if __name__ == '__main__': |
| 299 sys.exit(main()) | 296 sys.exit(main()) |
| OLD | NEW |