Merge "Allow PatchSetInserter to set draft status of patch set"
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user