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 ChangeMessage changeMessage;
|
||||||
private boolean copyLabels;
|
private boolean copyLabels;
|
||||||
private SshInfo sshInfo;
|
private SshInfo sshInfo;
|
||||||
|
private boolean draft;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public PatchSetInserter(ChangeHooks hooks,
|
public PatchSetInserter(ChangeHooks hooks,
|
||||||
@@ -163,6 +164,11 @@ public class PatchSetInserter {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PatchSetInserter setDraft(boolean draft) {
|
||||||
|
this.draft = draft;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Change insert() throws InvalidChangeOperationException, OrmException,
|
public Change insert() throws InvalidChangeOperationException, OrmException,
|
||||||
IOException {
|
IOException {
|
||||||
init();
|
init();
|
||||||
@@ -276,6 +282,7 @@ public class PatchSetInserter {
|
|||||||
patchSet.setUploader(change.getOwner());
|
patchSet.setUploader(change.getOwner());
|
||||||
patchSet.setRevision(new RevId(commit.name()));
|
patchSet.setRevision(new RevId(commit.name()));
|
||||||
}
|
}
|
||||||
|
patchSet.setDraft(draft);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validate() throws InvalidChangeOperationException {
|
private void validate() throws InvalidChangeOperationException {
|
||||||
|
|||||||
Reference in New Issue
Block a user