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

Side by Side Diff: trychange.py

Issue 1272003: e.stderr may be None (Closed)
Patch Set: Created 10 years, 9 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
« 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/python 1 #!/usr/bin/python
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2009 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 """Client-side script to send a try job to the try server. It communicates to 5 """Client-side script to send a try job to the try server. It communicates to
6 the try server by either writting to a svn repository or by directly connecting 6 the try server by either writting to a svn repository or by directly connecting
7 to the server by HTTP. 7 to the server by HTTP.
8 """ 8 """
9 9
10 import datetime 10 import datetime
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 gclient_utils.FileWrite(full_path, options.diff, 'wb') 365 gclient_utils.FileWrite(full_path, options.diff, 'wb')
366 else: 366 else:
367 # Add the file to the repo. 367 # Add the file to the repo.
368 gclient_utils.FileWrite(full_path, options.diff, 'wb') 368 gclient_utils.FileWrite(full_path, options.diff, 'wb')
369 gclient_utils.CheckCall(["svn", "add", full_path], print_error=False) 369 gclient_utils.CheckCall(["svn", "add", full_path], print_error=False)
370 temp_file.write(description) 370 temp_file.write(description)
371 temp_file.flush() 371 temp_file.flush()
372 gclient_utils.CheckCall(["svn", "commit", full_path, '--file', 372 gclient_utils.CheckCall(["svn", "commit", full_path, '--file',
373 temp_file.name], print_error=False) 373 temp_file.name], print_error=False)
374 except gclient_utils.CheckCallError, e: 374 except gclient_utils.CheckCallError, e:
375 raise NoTryServerAccess(' '.join(e.command) + '\nOuput:\n' + 375 out = e.stdout
376 e.stdout + e.stderr) 376 if e.stderr:
377 out += e.stderr
378 raise NoTryServerAccess(' '.join(e.command) + '\nOuput:\n' + out)
377 finally: 379 finally:
378 temp_file.close() 380 temp_file.close()
379 shutil.rmtree(temp_dir, True) 381 shutil.rmtree(temp_dir, True)
380 382
381 383
382 def PrintSuccess(options): 384 def PrintSuccess(options):
383 if not options.dry_run: 385 if not options.dry_run:
384 text = 'Patch \'%s\' sent to try server' % options.name 386 text = 'Patch \'%s\' sent to try server' % options.name
385 if options.bot: 387 if options.bot:
386 text += ': %s' % ', '.join(options.bot) 388 text += ': %s' % ', '.join(options.bot)
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 except (InvalidScript, NoTryServerAccess), e: 702 except (InvalidScript, NoTryServerAccess), e:
701 if swallow_exception: 703 if swallow_exception:
702 return 1 704 return 1
703 print e 705 print e
704 return 1 706 return 1
705 return 0 707 return 0
706 708
707 709
708 if __name__ == "__main__": 710 if __name__ == "__main__":
709 sys.exit(TryChange(None, [], False)) 711 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