SubmitInput: Remove deprecated waitForMerge field

The waitForMerge field was deprecated in Gerrit 2.12, is not
used any more. Remove it.

Update the documentation to mention the on_behalf_of field in
the SubmitInput, instead of wait_for_merge.

Change-Id: I6de626312ca03654a37b52553202f2af9dfbf787
This commit is contained in:
David Pursehouse
2016-03-10 15:27:47 +09:00
parent 4ea3568ff3
commit a8f48f85cf
4 changed files with 3 additions and 26 deletions

View File

@@ -1050,8 +1050,7 @@ the error message is contained in the response body.
Submits a change. Submits a change.
The request body only needs to include a link:#submit-input[ The request body only needs to include a link:#submit-input[
SubmitInput] entity if the request should wait for the merge to SubmitInput] entity if submitting on behalf of another user.
complete.
.Request .Request
---- ----
@@ -1059,7 +1058,7 @@ complete.
Content-Type: application/json; charset=UTF-8 Content-Type: application/json; charset=UTF-8
{ {
"wait_for_merge": true "on_behalf_of": 1001439
} }
---- ----
@@ -4780,10 +4779,6 @@ after submitting.
|Field Name ||Description |Field Name ||Description
|`status` || |`status` ||
The status of the change after submitting is `MERGED`. The status of the change after submitting is `MERGED`.
+
As `wait_for_merge` in the link:#submit-input[SubmitInput] is deprecated and
the request always waits for the merge to be completed, you can expect
`MERGED` to be returned here.
|`on_behalf_of`|optional| |`on_behalf_of`|optional|
The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on
whose behalf the action should be done. To use this option the caller must whose behalf the action should be done. To use this option the caller must
@@ -4808,8 +4803,6 @@ format link:rest-api-accounts.html#account-id[accepted by the accounts REST
API]. Using this option requires API]. Using this option requires
link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)] link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
permission on the branch. permission on the branch.
|`wait_for_merge`|Deprecated, always `true`|
Whether the request should wait for the merge to complete.
|=========================== |===========================
[[submit-record]] [[submit-record]]

View File

@@ -15,7 +15,5 @@
package com.google.gerrit.extensions.api.changes; package com.google.gerrit.extensions.api.changes;
public class SubmitInput { public class SubmitInput {
@Deprecated
public boolean waitForMerge;
public String onBehalfOf; public String onBehalfOf;
} }

View File

@@ -192,8 +192,7 @@ public class ChangeApi {
/** Submit a specific revision of a change. */ /** Submit a specific revision of a change. */
public static void submit(int id, String commit, AsyncCallback<SubmitInfo> cb) { public static void submit(int id, String commit, AsyncCallback<SubmitInfo> cb) {
SubmitInput in = SubmitInput.create(); JavaScriptObject in = JavaScriptObject.createObject();
in.waitForMerge(true);
call(id, commit, "submit").post(in, cb); call(id, commit, "submit").post(in, cb);
} }
@@ -287,17 +286,6 @@ public class ChangeApi {
} }
} }
private static class SubmitInput extends JavaScriptObject {
final native void waitForMerge(boolean b) /*-{ this.wait_for_merge=b; }-*/;
static SubmitInput create() {
return (SubmitInput) createObject();
}
protected SubmitInput() {
}
}
private static RestApi call(int id, String action) { private static RestApi call(int id, String action) {
return change(id).view(action); return change(id).view(action);
} }

View File

@@ -118,10 +118,8 @@ public class Submit implements RestModifyView<RevisionResource, SubmitInput>,
public static class TestSubmitInput extends SubmitInput { public static class TestSubmitInput extends SubmitInput {
public final boolean failAfterRefUpdates; public final boolean failAfterRefUpdates;
@SuppressWarnings("deprecation")
public TestSubmitInput(SubmitInput base, boolean failAfterRefUpdates) { public TestSubmitInput(SubmitInput base, boolean failAfterRefUpdates) {
this.onBehalfOf = base.onBehalfOf; this.onBehalfOf = base.onBehalfOf;
this.waitForMerge = base.waitForMerge;
this.failAfterRefUpdates = failAfterRefUpdates; this.failAfterRefUpdates = failAfterRefUpdates;
} }
} }