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

Unified Diff: trychange.py

Issue 423002: Small cleanup (Closed)
Patch Set: Created 11 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trychange.py
diff --git a/trychange.py b/trychange.py
index 65e935a08a9b55c8c3ad62f3b075fa6bd0d03616..ea21e292879bc9e8eae61d1151dcc7acd1c65ecd 100755
--- a/trychange.py
+++ b/trychange.py
@@ -52,9 +52,7 @@ Examples:
Running only on a 'mac' slave with revision 123 and clobber first; specify
manually the 3 source files to use for the try job:
%prog --bot mac --revision 123 --clobber -f src/a.cc -f src/a.h
- -f include/b.h
-
-"""
+ -f include/b.h"""
class InvalidScript(Exception):
def __str__(self):
@@ -507,6 +505,8 @@ def TryChange(argv,
options.send_patch = _SendChangeHTTP
elif options.svn_repo:
options.send_patch = _SendChangeSVN
+ else:
+ parser.error('Please specify an access method.')
if len(args) == 1 and args[0] == 'help':
parser.print_help()
@@ -514,8 +514,7 @@ def TryChange(argv,
not options.diff and not options.url):
# TODO(maruel): It should just try the modified files showing up in a
# svn status.
- print "Nothing to try, changelist is empty."
- return 1
+ parser.error('Nothing to try, changelist is empty.')
try:
# Convert options.diff into the content of the diff.
@@ -536,8 +535,7 @@ def TryChange(argv,
# Get try slaves from PRESUBMIT.py files if not specified.
if not options.bot:
if options.url:
- print('You need to specify which bots to use.')
- return 1
+ parser.error('You need to specify which bots to use.')
root_presubmit = gcl.GetCachedFile('PRESUBMIT.py', use_root=True)
options.bot = presubmit_support.DoGetTrySlaves(options.scm.GetFileNames(),
options.scm.GetLocalRoot(),
« 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