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

Side by Side Diff: fetch.py

Issue 1183703003: Fix dry_run run() return type to match check_output(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years, 6 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 def init(self): 56 def init(self):
57 pass 57 pass
58 58
59 def sync(self): 59 def sync(self):
60 pass 60 pass
61 61
62 def run(self, cmd, **kwargs): 62 def run(self, cmd, **kwargs):
63 print 'Running: %s' % (' '.join(pipes.quote(x) for x in cmd)) 63 print 'Running: %s' % (' '.join(pipes.quote(x) for x in cmd))
64 if self.options.dry_run: 64 if self.options.dry_run:
65 return 0 65 return ''
66 return subprocess.check_output(cmd, **kwargs) 66 return subprocess.check_output(cmd, **kwargs)
67 67
68 68
69 class GclientCheckout(Checkout): 69 class GclientCheckout(Checkout):
70 70
71 def run_gclient(self, *cmd, **kwargs): 71 def run_gclient(self, *cmd, **kwargs):
72 if not spawn.find_executable('gclient'): 72 if not spawn.find_executable('gclient'):
73 cmd_prefix = (sys.executable, os.path.join(SCRIPT_PATH, 'gclient.py')) 73 cmd_prefix = (sys.executable, os.path.join(SCRIPT_PATH, 'gclient.py'))
74 else: 74 else:
75 cmd_prefix = ('gclient',) 75 cmd_prefix = ('gclient',)
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 spec, root = run_recipe_fetch(recipe, props) 336 spec, root = run_recipe_fetch(recipe, props)
337 return run(options, spec, root) 337 return run(options, spec, root)
338 338
339 339
340 if __name__ == '__main__': 340 if __name__ == '__main__':
341 try: 341 try:
342 sys.exit(main()) 342 sys.exit(main())
343 except KeyboardInterrupt: 343 except KeyboardInterrupt:
344 sys.stderr.write('interrupted\n') 344 sys.stderr.write('interrupted\n')
345 sys.exit(1) 345 sys.exit(1)
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