gerrit: add support for "topic" action
This change adds code to be able to set the topic using the gerrit
command. It supports multiple CLs as an argument. The syntax is as
follow:
gerrit topic mytopic cl1 [cl2 cl3 ...]
BUG=none
TEST=Unit test
Change-Id: I9729f42ac05af6e8078fe3ca9e5e8d6226e77c0b
Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
Reviewed-on: https://chromium-review.googlesource.com/239864
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/gerrit.py b/scripts/gerrit.py
index f1555a1..8fb1925 100644
--- a/scripts/gerrit.py
+++ b/scripts/gerrit.py
@@ -339,6 +339,13 @@
helper.SetReview(cl, msg=message, dryrun=opts.dryrun)
+def UserActTopic(opts, topic, *args):
+ """Set |topic| for CL number <n> [n ...]"""
+ for arg in args:
+ helper, arg = GetGerrit(opts, arg)
+ helper.SetTopic(arg, topic, dryrun=opts.dryrun)
+
+
def UserActDeletedraft(opts, *args):
"""Delete draft patch set <n> [n ...]"""
for arg in args: