Store subject and original subject in notedb
This adds a 'Subject' footer to the commit message of the refs/changes/XX/YYYY/meta notes branch when the change is created and whenever a new patch set with a different subject is added. The current subject is taken from most recent commit on the notes branch that contains a 'Subject' footer. The original subject is taken from the first commit on the notes branch. Tests which manually insert new changes must be adapted so that the initial commit to the notes branch contains the subject. In order to set the 'Subject' footer only when the subject was changed, we must compare the new subject to the old subject when a new patch set is inserted. To be able to access the old subject when a a new patch set is created, PatchSetInserter must ensure that the body of the commit was parsed. Otherwise the subject would not be available and trying to get it would fail with a NullPointerException. Change-Id: I71bfe88e16c3e0b41530f399441b16e2cd44f59e Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -2241,7 +2241,7 @@ public class ReceiveCommits {
|
||||
|
||||
Map<String, Short> approvals = new HashMap<>();
|
||||
ChangeUpdate update = updateFactory.create(changeCtl, createdOn);
|
||||
update.setSubject("Create patch set " + psId.get());
|
||||
update.setSubjectForCommit("Create patch set " + psId.get());
|
||||
update.setPatchSetId(psId);
|
||||
|
||||
if (magicBranch != null) {
|
||||
|
Reference in New Issue
Block a user