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

Unified Diff: gcl.py

Issue 10384150: When converting -m/--message to -t, make sure to handle the case --message=foo (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: Address review comments Created 8 years, 7 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 | « no previous file | git_cl.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
===================================================================
--- gcl.py (revision 136864)
+++ gcl.py (working copy)
@@ -825,9 +825,23 @@
if FilterFlag(args, "--send-mail"):
args.append("--send_mail")
- # Replace -m or --message with -t.
- args = map(lambda a: '-t' if (a == '-m' or a == '--message') else a, args)
-
+ # Replace -m with -t and --message with --title, but make sure to
+ # preserve anything after the -m/--message.
+ found_deprecated_arg = [False]
+ def replace_message(a):
+ if a.startswith('-m'):
+ found_deprecated_arg[0] = True
+ return '-t' + a[2:]
+ elif a.startswith('--message'):
+ found_deprecated_arg[0] = True
+ return '--title' + a[9:]
+ return a
+ args = map(replace_message, args)
+ if found_deprecated_arg[0]:
+ print >> sys.stderr, (
+ '\nWARNING: Use -t or --title to set the title of the patchset.\n'
+ 'In the near future, -m or --message will send a message instead.\n'
+ 'See http://goo.gl/JGg0Z for details.\n')
upload_arg = ["upload.py", "-y"]
upload_arg.append("--server=%s" % change_info.rietveld)
« no previous file with comments | « no previous file | git_cl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698