Added support for changing parent revision during rebase
It is a common use-case of configuration managers (CMs) to restructure
a sequence of patches towards a target branch.
This patch allows restructuring of patches from the UI and REST API
using the rebase action.
It is now possible to:
- Introduce a new dependency towards another change.
- Remove dependency towards another change.
There is a non-obvious limitation regarding the parent revisions: It has
to be a valid patch set towards the same target branch.
Change-Id: I882b16a929b2ce0c66b1a6d9b64947220bb46d0b
diff --git a/Documentation/rest-api-changes.txt b/Documentation/rest-api-changes.txt
index f508a83..49ebb49 100644
--- a/Documentation/rest-api-changes.txt
+++ b/Documentation/rest-api-changes.txt
@@ -852,9 +852,17 @@
Rebases a change.
+Optionally, the parent revision can be changed to another patch set through the
+link:#rebase-input[RebaseInput] entity.
+
.Request
----
POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
+ Content-Type: application/json;charset=UTF-8
+
+ {
+ "base" : "1234",
+ }
----
As response a link:#change-info[ChangeInfo] entity is returned that
@@ -2200,9 +2208,17 @@
Rebases a revision.
+Optionally, the parent revision can be changed to another patch set through the
+link:#rebase-input[RebaseInput] entity.
+
.Request
----
POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
+ Content-Type: application/json;charset=UTF-8
+
+ {
+ "base" : "1234",
+ }
----
As response a link:#change-info[ChangeInfo] entity is returned that
@@ -3877,6 +3893,21 @@
outcome of the fix.
|===========================
+[[rebase-input]]
+=== RebaseInput
+The `RebaseInput` entity contains information for changing parent when rebasing.
+
+[options="header",width="50%",cols="1,^1,5"]
+|===========================
+|Field Name ||Description
+|`base` |optional|
+The new parent revision. This can be a ref or a SHA1 to a concrete patchset. +
+Alternatively, a change number can be specified, in which case the current
+patch set is inferred. +
+Empty string is used for rebasing directly on top of the target branch,
+which effectively breaks dependency towards a parent change.
+|===========================
+
[[related-change-and-commit-info]]
=== RelatedChangeAndCommitInfo