gerrit: Add 'private' subcommand.
This adds:
$ gerrit private <CL> <bool>
To mark a given CL as private or not.
BUG=None
TEST=manual
Change-Id: Ib3ff64b062864a87351e435705edd343ddac0231
Reviewed-on: https://chromium-review.googlesource.com/985128
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
diff --git a/scripts/gerrit.py b/scripts/gerrit.py
index 96e4388..ec9a134 100644
--- a/scripts/gerrit.py
+++ b/scripts/gerrit.py
@@ -456,6 +456,16 @@
helper, arg = GetGerrit(opts, arg)
helper.SetTopic(arg, topic, dryrun=opts.dryrun)
+def UserActPrivate(opts, cl, private_str):
+ """Set private bit on CL to private"""
+ try:
+ private = cros_build_lib.BooleanShellValue(private_str, False)
+ except ValueError:
+ raise RuntimeError('Unknown "boolean" value: %s' % private_str)
+
+ helper, cl = GetGerrit(opts, cl)
+ helper.SetPrivate(cl, private)
+
def UserActSethashtags(opts, cl, *args):
"""Add/remove hashtags for CL <n> (prepend with '~' to remove)"""