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

Unified Diff: git_cl.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 | « gcl.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
===================================================================
--- git_cl.py (revision 136864)
+++ git_cl.py (working copy)
@@ -966,12 +966,19 @@
change_desc = None
if cl.GetIssue():
- if options.message:
- upload_args.extend(['--message', options.message])
+ if options.title:
+ upload_args.extend(['--title', options.title])
+ elif options.message:
+ # TODO(rogerta): for now, the -m option will also set the --title option
+ # for upload.py. Soon this will be changed to set the --message option.
+ # Will wait until people are used to typing -t instead of -m.
+ upload_args.extend(['--title', options.message])
upload_args.extend(['--issue', cl.GetIssue()])
print ("This branch is associated with issue %s. "
"Adding patch to that issue." % cl.GetIssue())
else:
+ if options.title:
+ upload_args.extend(['--title', options.title])
message = options.message or CreateDescriptionFromLog(args)
change_desc = ChangeDescription(message, options.reviewers)
if not options.force:
@@ -1043,7 +1050,8 @@
help='bypass upload presubmit hook')
parser.add_option('-f', action='store_true', dest='force',
help="force yes to questions (don't prompt)")
- parser.add_option('-m', dest='message', help='message for patch')
+ parser.add_option('-m', dest='message', help='message for patchset')
+ parser.add_option('-t', dest='title', help='title for patchset')
parser.add_option('-r', '--reviewers',
help='reviewer email addresses')
parser.add_option('--cc',
@@ -1064,6 +1072,14 @@
help='target branch to upload')
(options, args) = parser.parse_args(args)
+ # Print warning if the user used the -m/--message argument. This will soon
+ # change to -t/--title.
+ if options.message:
+ 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')
+
# Make sure index is up-to-date before running diff-index.
RunGit(['update-index', '--refresh', '-q'], error_ok=True)
if RunGit(['diff-index', 'HEAD']):
« 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