Merge "Add --rebase option to review command"
This commit is contained in:
commit
13eec766ab
Documentation
gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands
@ -13,6 +13,7 @@ gerrit review - Apply reviews to one or more patch sets
|
|||||||
[--notify <NOTIFYHANDLING> | -n <NOTIFYHANDLING>]
|
[--notify <NOTIFYHANDLING> | -n <NOTIFYHANDLING>]
|
||||||
[--submit | -s]
|
[--submit | -s]
|
||||||
[--abandon | --restore]
|
[--abandon | --restore]
|
||||||
|
[--rebase]
|
||||||
[--publish]
|
[--publish]
|
||||||
[--json | -j]
|
[--json | -j]
|
||||||
[--delete]
|
[--delete]
|
||||||
@ -64,7 +65,7 @@ branch.
|
|||||||
link:rest-api-changes.html#review-input[ReviewInput] entity for the
|
link:rest-api-changes.html#review-input[ReviewInput] entity for the
|
||||||
format.
|
format.
|
||||||
(option is mutually exclusive with --submit, --restore, --publish, --delete,
|
(option is mutually exclusive with --submit, --restore, --publish, --delete,
|
||||||
--abandon and --message)
|
--abandon, --message and --rebase)
|
||||||
|
|
||||||
--notify::
|
--notify::
|
||||||
-n::
|
-n::
|
||||||
@ -85,17 +86,22 @@ branch.
|
|||||||
|
|
||||||
--abandon::
|
--abandon::
|
||||||
Abandon the specified change(s).
|
Abandon the specified change(s).
|
||||||
(option is mutually exclusive with --submit, --restore, --publish, --delete
|
(option is mutually exclusive with --submit, --restore, --publish, --delete,
|
||||||
and --json)
|
--rebase and --json)
|
||||||
|
|
||||||
--restore::
|
--restore::
|
||||||
Restore the specified abandoned change(s).
|
Restore the specified abandoned change(s).
|
||||||
(option is mutually exclusive with --abandon and --json)
|
(option is mutually exclusive with --abandon and --json)
|
||||||
|
|
||||||
|
--rebase::
|
||||||
|
Rebase the specified change(s).
|
||||||
|
(option is mutually exclusive with --abandon, --submit, --delete and --json)
|
||||||
|
|
||||||
--submit::
|
--submit::
|
||||||
-s::
|
-s::
|
||||||
Submit the specified patch set(s) for merging.
|
Submit the specified patch set(s) for merging.
|
||||||
(option is mutually exclusive with --abandon, --publish --delete and --json)
|
(option is mutually exclusive with --abandon, --publish --delete, --rebase
|
||||||
|
and --json)
|
||||||
|
|
||||||
--publish::
|
--publish::
|
||||||
Publish the specified draft patch set(s).
|
Publish the specified draft patch set(s).
|
||||||
@ -104,8 +110,8 @@ branch.
|
|||||||
|
|
||||||
--delete::
|
--delete::
|
||||||
Delete the specified draft patch set(s).
|
Delete the specified draft patch set(s).
|
||||||
(option is mutually exclusive with --submit, --restore, --abandon, --publish
|
(option is mutually exclusive with --submit, --restore, --abandon, --publish,
|
||||||
and --json)
|
--rebase and --json)
|
||||||
|
|
||||||
--code-review::
|
--code-review::
|
||||||
--verified::
|
--verified::
|
||||||
|
@ -105,6 +105,9 @@ public class ReviewCommand extends SshCommand {
|
|||||||
@Option(name = "--restore", usage = "restore the specified abandoned change(s)")
|
@Option(name = "--restore", usage = "restore the specified abandoned change(s)")
|
||||||
private boolean restoreChange;
|
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)")
|
@Option(name = "--submit", aliases = "-s", usage = "submit the specified patch set(s)")
|
||||||
private boolean submitChange;
|
private boolean submitChange;
|
||||||
|
|
||||||
@ -154,6 +157,9 @@ public class ReviewCommand extends SshCommand {
|
|||||||
if (deleteDraftPatchSet) {
|
if (deleteDraftPatchSet) {
|
||||||
throw error("abandon and delete actions are mutually exclusive");
|
throw error("abandon and delete actions are mutually exclusive");
|
||||||
}
|
}
|
||||||
|
if (rebaseChange) {
|
||||||
|
throw error("abandon and rebase actions are mutually exclusive");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (publishPatchSet) {
|
if (publishPatchSet) {
|
||||||
if (restoreChange) {
|
if (restoreChange) {
|
||||||
@ -185,6 +191,17 @@ public class ReviewCommand extends SshCommand {
|
|||||||
if (changeComment != null) {
|
if (changeComment != null) {
|
||||||
throw error("json and message are mutually exclusive");
|
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) {
|
if (deleteDraftPatchSet && submitChange) {
|
||||||
throw error("delete and submit actions are mutually exclusive");
|
throw error("delete and submit actions are mutually exclusive");
|
||||||
@ -285,6 +302,10 @@ public class ReviewCommand extends SshCommand {
|
|||||||
applyReview(patchSet, review);
|
applyReview(patchSet, review);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rebaseChange){
|
||||||
|
revisionApi(patchSet).rebase();
|
||||||
|
}
|
||||||
|
|
||||||
if (submitChange) {
|
if (submitChange) {
|
||||||
revisionApi(patchSet).submit();
|
revisionApi(patchSet).submit();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user