| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 def sync(self): | 56 def sync(self): |
| 57 pass | 57 pass |
| 58 | 58 |
| 59 | 59 |
| 60 class GclientCheckout(Checkout): | 60 class GclientCheckout(Checkout): |
| 61 | 61 |
| 62 def run_gclient(self, *cmd, **kwargs): | 62 def run_gclient(self, *cmd, **kwargs): |
| 63 print 'Running: gclient %s' % ' '.join(pipes.quote(x) for x in cmd) | 63 print 'Running: gclient %s' % ' '.join(pipes.quote(x) for x in cmd) |
| 64 if not self.dryrun: | 64 if not self.dryrun: |
| 65 return subprocess.check_call(('gclient',) + cmd, **kwargs) | 65 return subprocess.check_call( |
| 66 (sys.executable, os.path.join(SCRIPT_PATH, 'gclient.py')) + cmd, |
| 67 **kwargs) |
| 66 | 68 |
| 67 | 69 |
| 68 class GitCheckout(Checkout): | 70 class GitCheckout(Checkout): |
| 69 | 71 |
| 70 def run_git(self, *cmd, **kwargs): | 72 def run_git(self, *cmd, **kwargs): |
| 71 print 'Running: git %s' % ' '.join(pipes.quote(x) for x in cmd) | 73 print 'Running: git %s' % ' '.join(pipes.quote(x) for x in cmd) |
| 72 if not self.dryrun: | 74 if not self.dryrun: |
| 73 return subprocess.check_call(('git',) + cmd, **kwargs) | 75 return subprocess.check_call(('git',) + cmd, **kwargs) |
| 74 | 76 |
| 75 | 77 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 230 |
| 229 | 231 |
| 230 def main(): | 232 def main(): |
| 231 dryrun, recipe, props = handle_args(sys.argv) | 233 dryrun, recipe, props = handle_args(sys.argv) |
| 232 spec, root = run_recipe_fetch(recipe, props) | 234 spec, root = run_recipe_fetch(recipe, props) |
| 233 return run(dryrun, spec, root) | 235 return run(dryrun, spec, root) |
| 234 | 236 |
| 235 | 237 |
| 236 if __name__ == '__main__': | 238 if __name__ == '__main__': |
| 237 sys.exit(main()) | 239 sys.exit(main()) |
| OLD | NEW |