Bring draft status to PatchSetAttribute

Thereby, stream event consumers can differentiate between events that
are tied to a draft patch set and those that are not.

Change-Id: Idbdcfc979f2383de0708560bf2e148fcc51d612f
This commit is contained in:
Christian Aistleitner
2013-06-18 01:09:33 +02:00
parent abf646c761
commit ca50428bea
3 changed files with 4 additions and 0 deletions

View File

@@ -115,6 +115,8 @@ author:: Author of this patchset in <<account,account attribute>>.
createdOn:: Time in seconds since the UNIX epoch when this patchset
was created.
isDraft:: Whether or not the patch set is a draft patch set.
approvals:: The <<approval,approval attribute>> granted.
comments:: All comments for this patchset in <<patchsetcomment,patchsetComment attributes>>.

View File

@@ -24,6 +24,7 @@ public class PatchSetAttribute {
public AccountAttribute uploader;
public Long createdOn;
public AccountAttribute author;
public boolean isDraft;
public List<ApprovalAttribute> approvals;
public List<PatchSetCommentAttribute> comments;

View File

@@ -361,6 +361,7 @@ public class EventFactory {
p.ref = patchSet.getRefName();
p.uploader = asAccountAttribute(patchSet.getUploader());
p.createdOn = patchSet.getCreatedOn().getTime() / 1000L;
p.isDraft = patchSet.isDraft();
final PatchSet.Id pId = patchSet.getId();
try {
final ReviewDb db = schema.open();