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

Unified Diff: trychange.py

Issue 6612036: Reland 77470: Don't ignore first argument in TryChange (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: sync Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcl.py ('k') | 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 884e56c1bd7855d5a30a7604f267297812799286..fb5e935c3e99e6d2ab5a743b00a74725d1314ac2 100755
--- a/trychange.py
+++ b/trychange.py
@@ -330,10 +330,9 @@ def _SendChangeHTTP(options):
logging.info('Sending by HTTP')
logging.info(description)
logging.info(url)
+ logging.info(options.diff)
if options.dry_run:
- print options.diff
return
- logging.info(options.diff)
try:
logging.info('Opening connection...')
@@ -510,7 +509,8 @@ def TryChange(argv,
"optional if --issue is used, In that case, the "
"latest patchset will be used.")
group.add_option("--dry_run", action='store_true',
- help="Just prints the diff and quits")
+ help="Don't send the try job. This implies --verbose, so "
+ "it will print the diff.")
parser.add_option_group(group)
group = optparse.OptionGroup(parser, "Try job options")
@@ -611,24 +611,18 @@ def TryChange(argv,
options, args = parser.parse_args(argv)
- # Note that the args array includes the script name, so
- # a single argument results in len(args) == 2.
-
# If they've asked for help, give it to them
- if len(args) == 2 and args[1] == 'help':
+ if len(args) == 1 and args[0] == 'help':
parser.print_help()
return 0
# If they've said something confusing, don't spawn a try job until you
# understand what they want.
- if len(args) > 1:
- plural = ""
- if len(args) > 2:
- plural = "s"
- print >> sys.stderr, (
- 'Argument%s \"%s\" not understood' % (plural, ' '.join(args[1:])))
- parser.print_help()
- return 1
+ if args:
+ parser.error('Extra argument(s) "%s" not understood' % ' '.join(args))
+
+ if options.dry_run:
+ options.verbose += 1
LOG_FORMAT = '%(levelname)s %(filename)s(%(lineno)d): %(message)s'
if not swallow_exception:
« no previous file with comments | « gcl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698