gerrit: Add wip/ready to control the Work-In-Progress state
Add wip and ready commands to respectively set and clear the
Work-In-Progress bits of the given CLs, as per:
https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-work-in-pogress
https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-ready-for-review
BUG=none
TEST=gerrit wip 2599501; gerrit ready 2599501
Change-Id: Iafa76a4a9ee74c6fde444aa1a829812a5fd8a627
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2639118
Tested-by: Tomasz Figa <tfiga@chromium.org>
Auto-Submit: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/gerrit.py b/scripts/gerrit.py
index 9bf7907..bc86825 100644
--- a/scripts/gerrit.py
+++ b/scripts/gerrit.py
@@ -580,6 +580,28 @@
helper.RestoreChange(cl, dryrun=opts.dryrun)
+class ActionWorkInProgress(_ActionSimpleParallelCLs):
+ """Mark CLs as work in progress"""
+
+ COMMAND = 'wip'
+
+ @staticmethod
+ def _process_one(helper, cl, opts):
+ """Use |helper| to process the single |cl|."""
+ helper.SetWorkInProgress(cl, True, dryrun=opts.dryrun)
+
+
+class ActionReadyForReview(_ActionSimpleParallelCLs):
+ """Mark CLs as ready for review"""
+
+ COMMAND = 'ready'
+
+ @staticmethod
+ def _process_one(helper, cl, opts):
+ """Use |helper| to process the single |cl|."""
+ helper.SetWorkInProgress(cl, False, dryrun=opts.dryrun)
+
+
class ActionReviewers(UserAction):
"""Add/remove reviewers' emails for a CL (prepend with '~' to remove)"""