Refactor ChangeInserter's setDraft to match PatchSetInserter's

The `setDraft` method in ChangeInserter can only set the status to
draft; it cannot toggle it.

Change it to be able to toggle the status between draft and new,
making it consistent with the way the method of the same name works
in PatchSetInserter.

Change-Id: Iead2e62701c6b5c90a33efcda35b2e144fd67ccf
This commit is contained in:
David Pursehouse
2013-07-10 18:42:44 +09:00
parent cbaa90875a
commit 51f09a3077
2 changed files with 5 additions and 7 deletions

View File

@@ -107,9 +107,9 @@ public class ChangeInserter {
return this;
}
public ChangeInserter setDraft() {
change.setStatus(Change.Status.DRAFT);
patchSet.setDraft(true);
public ChangeInserter setDraft(boolean draft) {
change.setStatus(draft ? Change.Status.DRAFT : Change.Status.NEW);
patchSet.setDraft(draft);
return this;
}