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
diff --git a/Documentation/rest-api-changes.txt b/Documentation/rest-api-changes.txt
index 446c3c6..5603d36 100644
--- a/Documentation/rest-api-changes.txt
+++ b/Documentation/rest-api-changes.txt
@@ -1050,8 +1050,7 @@
Submits a change.
The request body only needs to include a link:#submit-input[
-SubmitInput] entity if the request should wait for the merge to
-complete.
+SubmitInput] entity if submitting on behalf of another user.
.Request
----
@@ -1059,7 +1058,7 @@
Content-Type: application/json; charset=UTF-8
{
- "wait_for_merge": true
+ "on_behalf_of": 1001439
}
----
@@ -4780,10 +4779,6 @@
|Field Name ||Description
|`status` ||
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|
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
@@ -4808,8 +4803,6 @@
API]. Using this option requires
link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
permission on the branch.
-|`wait_for_merge`|Deprecated, always `true`|
-Whether the request should wait for the merge to complete.
|===========================
[[submit-record]]
diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/api/changes/SubmitInput.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/api/changes/SubmitInput.java
index 4e08f8d..4d368f6 100644
--- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/api/changes/SubmitInput.java
+++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/api/changes/SubmitInput.java
@@ -15,7 +15,5 @@
package com.google.gerrit.extensions.api.changes;
public class SubmitInput {
- @Deprecated
- public boolean waitForMerge;
public String onBehalfOf;
}
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeApi.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeApi.java
index 8314e3e..bff3f47 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeApi.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeApi.java
@@ -192,8 +192,7 @@
/** Submit a specific revision of a change. */
public static void submit(int id, String commit, AsyncCallback<SubmitInfo> cb) {
- SubmitInput in = SubmitInput.create();
- in.waitForMerge(true);
+ JavaScriptObject in = JavaScriptObject.createObject();
call(id, commit, "submit").post(in, cb);
}
@@ -287,17 +286,6 @@
}
}
- 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) {
return change(id).view(action);
}
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/Submit.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/Submit.java
index a263096..fb69f87 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/change/Submit.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/Submit.java
@@ -118,10 +118,8 @@
public static class TestSubmitInput extends SubmitInput {
public final boolean failAfterRefUpdates;
- @SuppressWarnings("deprecation")
public TestSubmitInput(SubmitInput base, boolean failAfterRefUpdates) {
this.onBehalfOf = base.onBehalfOf;
- this.waitForMerge = base.waitForMerge;
this.failAfterRefUpdates = failAfterRefUpdates;
}
}