Add merge feature into /changes REST endpoint

Allow user to create a merge in Gerrit via POST /changes REST API.
By adding a "merge" attribute which could be a SHA1, a branch name or a
tag name, etc. in the post JSON, gerrit will create a merge commit
instead of an empty commit. If there are conflicts, the response will
be rejected with a MergeConfictException which contains conflict
message.

Add dry run end point into GET
/projects/{project}/branches/{branch}/mergeable with query parameters
source (required) and strategy (optional) and return a
MergeableInfo entity.

Change-Id: I8f45f324704b3ff3eb20cb57c6e3bd75f2bf60ef
diff --git a/Documentation/rest-api-changes.txt b/Documentation/rest-api-changes.txt
index ca5d460..9eb33fb 100644
--- a/Documentation/rest-api-changes.txt
+++ b/Documentation/rest-api-changes.txt
@@ -3057,7 +3057,8 @@
   )]}'
   {
     submit_type: "MERGE_IF_NECESSARY",
-    mergeable: true,
+    strategy: "recursive",
+    mergeable: true
   }
 ----
 
@@ -4248,6 +4249,8 @@
 change operation.
 |`new_branch`         |optional, default to `false`|
 Allow creating a new branch when set to `true`.
+|`merge`              |optional|
+The detail of a merge commit as a link:#merge-input[MergeInput] entity.
 |==================================
 
 [[change-message-info]]
@@ -4733,12 +4736,33 @@
 Submit type used for this change, can be `MERGE_IF_NECESSARY`,
 `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
 `CHERRY_PICK`.
+|`merge_strategy`     |optional|
+The strategy of the merge, can be `recursive`, `resolve`,
+`simple-two-way-in-core`, `ours` or `theirs`.
 |`mergeable`     ||
 `true` if this change is cleanly mergeable, `false` otherwise
+|`conflicts`|optional|
+A list of paths with conflicts
 |`mergeable_into`|optional|
 A list of other branch names where this change could merge cleanly
 |============================
 
+[[merge-input]]
+=== MergeInput
+The `MergeInput` entity contains information about the merge
+
+[options="header",cols="1,^1,5"]
+|============================
+|Field Name      ||Description
+|`source`   ||
+The source to merge from, e.g. a complete or abbreviated commit SHA-1,
+a complete reference name, a short reference name under refs/heads, refs/tags,
+or refs/remotes namespace, etc.
+|`strategy`     |optional|
+The strategy of the merge, can be `recursive`, `resolve`,
+`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
+|============================
+
 [[move-input]]
 === MoveInput
 The `MoveInput` entity contains information for moving a change to a new branch.