| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 cmd_prefix = (sys.executable, os.path.join(SCRIPT_PATH, 'gclient.py')) | 72 cmd_prefix = (sys.executable, os.path.join(SCRIPT_PATH, 'gclient.py')) |
| 73 else: | 73 else: |
| 74 cmd_prefix = ('gclient',) | 74 cmd_prefix = ('gclient',) |
| 75 return self.run(cmd_prefix + cmd, **kwargs) | 75 return self.run(cmd_prefix + cmd, **kwargs) |
| 76 | 76 |
| 77 | 77 |
| 78 class GitCheckout(Checkout): | 78 class GitCheckout(Checkout): |
| 79 | 79 |
| 80 def run_git(self, *cmd, **kwargs): | 80 def run_git(self, *cmd, **kwargs): |
| 81 if sys.platform == 'win32' and not spawn.find_executable('git'): | 81 if sys.platform == 'win32' and not spawn.find_executable('git'): |
| 82 git_path = os.path.join(SCRIPT_PATH, 'git-1.8.0_bin', 'bin', 'git.exe') | 82 git_path = os.path.join(SCRIPT_PATH, 'git.bat') |
| 83 else: | 83 else: |
| 84 git_path = 'git' | 84 git_path = 'git' |
| 85 return self.run((git_path,) + cmd, **kwargs) | 85 return self.run((git_path,) + cmd, **kwargs) |
| 86 | 86 |
| 87 | 87 |
| 88 class SvnCheckout(Checkout): | 88 class SvnCheckout(Checkout): |
| 89 | 89 |
| 90 def run_svn(self, *cmd, **kwargs): | 90 def run_svn(self, *cmd, **kwargs): |
| 91 if sys.platform == 'win32' and not spawn.find_executable('svn'): | 91 if sys.platform == 'win32' and not spawn.find_executable('svn'): |
| 92 svn_path = os.path.join(SCRIPT_PATH, 'svn_bin', 'svn.exe') | 92 svn_path = os.path.join(SCRIPT_PATH, 'svn_bin', 'svn.exe') |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 290 |
| 291 | 291 |
| 292 def main(): | 292 def main(): |
| 293 options, recipe, props = handle_args(sys.argv) | 293 options, recipe, props = handle_args(sys.argv) |
| 294 spec, root = run_recipe_fetch(recipe, props) | 294 spec, root = run_recipe_fetch(recipe, props) |
| 295 return run(options, spec, root) | 295 return run(options, spec, root) |
| 296 | 296 |
| 297 | 297 |
| 298 if __name__ == '__main__': | 298 if __name__ == '__main__': |
| 299 sys.exit(main()) | 299 sys.exit(main()) |
| OLD | NEW |