Merge "Allow PatchSetInserter to set draft status of patch set"

This commit is contained in:
Edwin Kempin
2013-07-10 05:45:22 +00:00
committed by Gerrit Code Review

View File

@@ -92,6 +92,7 @@ public class PatchSetInserter {
private ChangeMessage changeMessage;
private boolean copyLabels;
private SshInfo sshInfo;
private boolean draft;
@Inject
public PatchSetInserter(ChangeHooks hooks,
@@ -163,6 +164,11 @@ public class PatchSetInserter {
return this;
}
public PatchSetInserter setDraft(boolean draft) {
this.draft = draft;
return this;
}
public Change insert() throws InvalidChangeOperationException, OrmException,
IOException {
init();
@@ -276,6 +282,7 @@ public class PatchSetInserter {
patchSet.setUploader(change.getOwner());
patchSet.setRevision(new RevId(commit.name()));
}
patchSet.setDraft(draft);
}
private void validate() throws InvalidChangeOperationException {