Add --rebase option to review command
Feature: issue 2824 Change-Id: Ibb5bc553fea1ad9dd43a69145f27645dc33c5e52
This commit is contained in:
@@ -105,6 +105,9 @@ public class ReviewCommand extends SshCommand {
|
||||
@Option(name = "--restore", usage = "restore the specified abandoned change(s)")
|
||||
private boolean restoreChange;
|
||||
|
||||
@Option(name = "--rebase", usage = "rebase the specified change(s)")
|
||||
private boolean rebaseChange;
|
||||
|
||||
@Option(name = "--submit", aliases = "-s", usage = "submit the specified patch set(s)")
|
||||
private boolean submitChange;
|
||||
|
||||
@@ -154,6 +157,9 @@ public class ReviewCommand extends SshCommand {
|
||||
if (deleteDraftPatchSet) {
|
||||
throw error("abandon and delete actions are mutually exclusive");
|
||||
}
|
||||
if (rebaseChange) {
|
||||
throw error("abandon and rebase actions are mutually exclusive");
|
||||
}
|
||||
}
|
||||
if (publishPatchSet) {
|
||||
if (restoreChange) {
|
||||
@@ -185,6 +191,17 @@ public class ReviewCommand extends SshCommand {
|
||||
if (changeComment != null) {
|
||||
throw error("json and message are mutually exclusive");
|
||||
}
|
||||
if (rebaseChange) {
|
||||
throw error("json and rebase actions are mutually exclusive");
|
||||
}
|
||||
}
|
||||
if (rebaseChange) {
|
||||
if (deleteDraftPatchSet) {
|
||||
throw error("rebase and delete actions are mutually exclusive");
|
||||
}
|
||||
if (submitChange) {
|
||||
throw error("rebase and submit actions are mutually exclusive");
|
||||
}
|
||||
}
|
||||
if (deleteDraftPatchSet && submitChange) {
|
||||
throw error("delete and submit actions are mutually exclusive");
|
||||
@@ -285,6 +302,10 @@ public class ReviewCommand extends SshCommand {
|
||||
applyReview(patchSet, review);
|
||||
}
|
||||
|
||||
if (rebaseChange){
|
||||
revisionApi(patchSet).rebase();
|
||||
}
|
||||
|
||||
if (submitChange) {
|
||||
revisionApi(patchSet).submit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user