Store topic of a change in Notedb

This adds a 'Topic' footer to  the commit messages of the
refs/changes/XX/YYYY/meta notes branch when the topic changes.

Similar as for hashtags we cannot rebuild the history for topic
changes since the database only stores the current topic.

Change-Id: I5ca2c1ed6326ba03dfbee21f1a7d2328b73ad322
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2015-10-21 18:16:14 +02:00
parent 232c18da1b
commit aa0a3f93a0
9 changed files with 105 additions and 2 deletions

View File

@@ -116,6 +116,7 @@ public class PutTopic implements RestModifyView<ChangeResource, Input>,
oldTopicName, newTopicName);
}
change.setTopic(Strings.emptyToNull(newTopicName));
ctx.getChangeUpdate().setTopic(change.getTopic());
ChangeUtil.updated(change);
ctx.getDb().changes().update(Collections.singleton(change));