Commit db02dd05 authored by Robert Iannucci's avatar Robert Iannucci Committed by Commit Bot

[git-cl] modify change description before committing.

Otherwise if update_reviewers needs to modify the commit message it won't
show in gerrit.

Bug:

Change-Id: Id81db48b7d15bd17cb924d1d046b31f2c48defa7
Reviewed-on: https://chromium-review.googlesource.com/482062
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
parent 30bbd184
......@@ -2896,12 +2896,16 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
assert len(change_ids) == 1
change_id = change_ids[0]
if options.reviewers or options.tbrs or options.add_owners_to:
change_desc.update_reviewers(options.reviewers, options.tbrs,
options.add_owners_to, change)
remote, upstream_branch = self.FetchUpstreamTuple(self.GetBranch())
parent = self._ComputeParent(remote, upstream_branch, custom_cl_base,
options.force, change_desc)
tree = RunGit(['rev-parse', 'HEAD:']).strip()
ref_to_push = RunGit(['commit-tree', tree, '-p', parent,
'-m', message]).strip()
'-m', change_desc.description]).strip()
else:
change_desc = ChangeDescription(
options.message or CreateDescriptionFromLog(git_diff_args))
......@@ -2912,6 +2916,9 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
DownloadGerritHook(False)
change_desc.set_description(
self._AddChangeIdToCommitMessage(options, git_diff_args))
if options.reviewers or options.tbrs or options.add_owners_to:
change_desc.update_reviewers(options.reviewers, options.tbrs,
options.add_owners_to, change)
ref_to_push = 'HEAD'
# For no-squash mode, we assume the remote called "origin" is the one we
# want. It is not worthwhile to support different workflows for
......@@ -2930,10 +2937,6 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
'single commit.')
confirm_or_exit(action='upload')
if options.reviewers or options.tbrs or options.add_owners_to:
change_desc.update_reviewers(options.reviewers, options.tbrs,
options.add_owners_to, change)
# Extra options that can be specified at push time. Doc:
# https://gerrit-review.googlesource.com/Documentation/user-upload.html
refspec_opts = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment