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

Side by Side Diff: trychange.py

Issue 7860047: Fix check_output usage in trychange.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 """Client-side script to send a try job to the try server. It communicates to 6 """Client-side script to send a try job to the try server. It communicates to
7 the try server by either writting to a svn repository or by directly connecting 7 the try server by either writting to a svn repository or by directly connecting
8 to the server by HTTP. 8 to the server by HTTP.
9 """ 9 """
10 10
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 # Windows' svn.exe has no clue about cygwin paths. Hence force to use 394 # Windows' svn.exe has no clue about cygwin paths. Hence force to use
395 # the cygwin version in this particular context. 395 # the cygwin version in this particular context.
396 exe = "/usr/bin/svn" 396 exe = "/usr/bin/svn"
397 else: 397 else:
398 exe = "svn" 398 exe = "svn"
399 command = [exe, 'import', '-q', temp_dir, options.svn_repo, '--file', 399 command = [exe, 'import', '-q', temp_dir, options.svn_repo, '--file',
400 temp_file.name] 400 temp_file.name]
401 if scm.SVN.AssertVersion("1.5")[0]: 401 if scm.SVN.AssertVersion("1.5")[0]:
402 command.append('--no-ignore') 402 command.append('--no-ignore')
403 403
404 subprocess2.check_output(command, stdout=subprocess2.VOID) 404 subprocess2.check_output(
405 command, stdout=subprocess2.PIPE, stderr=subprocess2.STDOUT)
405 except subprocess2.CalledProcessError, e: 406 except subprocess2.CalledProcessError, e:
406 out = e.stdout 407 raise NoTryServerAccess(' '.join(e.cmd) + '\nOuput:\n' + e.stdout)
407 if e.stderr:
408 out += e.stderr
409 raise NoTryServerAccess(' '.join(e.command) + '\nOuput:\n' + out)
410 finally: 408 finally:
411 temp_file.close() 409 temp_file.close()
412 shutil.rmtree(temp_dir, True) 410 shutil.rmtree(temp_dir, True)
413 411
414 412
415 def PrintSuccess(options): 413 def PrintSuccess(options):
416 if not options.dry_run: 414 if not options.dry_run:
417 text = 'Patch \'%s\' sent to try server' % options.name 415 text = 'Patch \'%s\' sent to try server' % options.name
418 if options.bot: 416 if options.bot:
419 text += ': %s' % ', '.join(options.bot) 417 text += ': %s' % ', '.join(options.bot)
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 return 1 762 return 1
765 except (gclient_utils.Error, subprocess2.CalledProcessError), e: 763 except (gclient_utils.Error, subprocess2.CalledProcessError), e:
766 print >> sys.stderr, e 764 print >> sys.stderr, e
767 return 1 765 return 1
768 return 0 766 return 0
769 767
770 768
771 if __name__ == "__main__": 769 if __name__ == "__main__":
772 fix_encoding.fix_encoding() 770 fix_encoding.fix_encoding()
773 sys.exit(TryChange(None, [], False)) 771 sys.exit(TryChange(None, [], False))
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