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

Side by Side Diff: fetch.py

Issue 173393002: Don't hardcode git directory path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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())
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