gerrit: add support for ignore/reviewed settings

This allows people to toggle the "ignore" and "reviewed" bits.

BUG=None
TEST=`gerrit ignore 2039142 && gerrit unignore 2039142` work

Change-Id: Ib88f2055c8472f26d7371f70a362b287447f51fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2044496
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Alex Klein <saklein@chromium.org>
diff --git a/scripts/gerrit.py b/scripts/gerrit.py
index 84a26d8..a7c6d5a 100644
--- a/scripts/gerrit.py
+++ b/scripts/gerrit.py
@@ -530,6 +530,42 @@
 UserActDeletedraft.usage = '<CLs...>'
 
 
+def UserActReviewed(opts, *args):
+  """Mark CLs as reviewed"""
+  def task(arg):
+    helper, cl = GetGerrit(opts, arg)
+    helper.ReviewedChange(cl, dryrun=opts.dryrun)
+  _run_parallel_tasks(task, *args)
+UserActReviewed.usage = '<CLs...>'
+
+
+def UserActUnreviewed(opts, *args):
+  """Mark CLs as unreviewed"""
+  def task(arg):
+    helper, cl = GetGerrit(opts, arg)
+    helper.UnreviewedChange(cl, dryrun=opts.dryrun)
+  _run_parallel_tasks(task, *args)
+UserActUnreviewed.usage = '<CLs...>'
+
+
+def UserActIgnore(opts, *args):
+  """Ignore CLs (suppress notifications/dashboard/etc...)"""
+  def task(arg):
+    helper, cl = GetGerrit(opts, arg)
+    helper.IgnoreChange(cl, dryrun=opts.dryrun)
+  _run_parallel_tasks(task, *args)
+UserActIgnore.usage = '<CLs...>'
+
+
+def UserActUnignore(opts, *args):
+  """Unignore CLs (enable notifications/dashboard/etc...)"""
+  def task(arg):
+    helper, cl = GetGerrit(opts, arg)
+    helper.UnignoreChange(cl, dryrun=opts.dryrun)
+  _run_parallel_tasks(task, *args)
+UserActUnignore.usage = '<CLs...>'
+
+
 def UserActAccount(opts):
   """Get the current user account information"""
   helper, _ = GetGerrit(opts)