Use whole --message argument on patchset upload

The logic for handling --title, --message, and the
commit message of the most recent commit was accidentally
doing this differently from how Rietveld had done them.

Bug: 728391
Change-Id: I70a46ccb470d790103f5d6bb745902595be28eee
Reviewed-on: https://chromium-review.googlesource.com/527339
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
changes/39/527339/3
Aaron Gable 8 years ago committed by Commit Bot
parent fd238086f1
commit 7303dcb9b3

@ -2871,20 +2871,19 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
'%s' % (self.GetIssue(), self.GetIssueURL()))
if not title:
if options.message:
# For compatibility with Rietveld, if -m|--message is given on
# command line, title should be the first line of that message,
# which shouldn't be confused with CL description.
default_title = options.message.strip().split()[0]
# When uploading a subsequent patchset, -m|--message is taken
# as the patchset title if --title was not provided.
title = options.message.strip()
else:
default_title = RunGit(
['show', '-s', '--format=%s', 'HEAD']).strip()
if options.force:
title = default_title
else:
title = ask_for_data(
'Title for patchset [%s]: ' % default_title) or default_title
if title == default_title:
automatic_title = True
if options.force:
title = default_title
else:
title = ask_for_data(
'Title for patchset [%s]: ' % default_title) or default_title
if title == default_title:
automatic_title = True
change_id = self._GetChangeDetail()['change_id']
while True:
footer_change_ids = git_footers.get_footer_change_id(message)

Loading…
Cancel
Save