Append vote information to every review event

Currently stream events do not contain vote information when
a user adds a review without making any changes to her votes.
This change makes Gerrit append the label information on reviews
that do not contain vote transistions.

Bug: Issue 3220
Change-Id: I8bee727b8ba52ceef9c696cc7943712fca0be5cf
This commit is contained in:
Khai Do
2015-02-27 14:31:47 -08:00
parent 8496ecfa73
commit b63d629917

View File

@@ -448,10 +448,9 @@ public class PostReview implements RestModifyView<RevisionResource, ReviewInput>
if (ent.getValue() == null || ent.getValue() == 0) {
// User requested delete of this label.
if (c != null) {
if (c.getValue() != 0) {
addLabelDelta(normName, (short) 0);
}
del.add(c);
addLabelDelta(normName, (short) 0);
categories.put(normName, (short) 0);
update.putApproval(ent.getKey(), (short) 0);
}
} else if (c != null && c.getValue() != ent.getValue()) {
@@ -463,6 +462,9 @@ public class PostReview implements RestModifyView<RevisionResource, ReviewInput>
update.putApproval(ent.getKey(), ent.getValue());
} else if (c != null && c.getValue() == ent.getValue()) {
current.put(normName, c);
addLabelDelta(normName, c.getValue());
categories.put(normName, c.getValue());
update.putApproval(ent.getKey(), ent.getValue());
} else if (c == null) {
c = new PatchSetApproval(new PatchSetApproval.Key(
rsrc.getPatchSet().getId(),