gerrit: add support for topic filtering (-t)

Using the -t,--topic argument, we can now filter only changes which
belongs to a particular topic. This can be used together with other
similar arguments such as -b or -p.

BUG=none
TEST=gerrit mine -t wireless-3.18

Change-Id: I0b8a5ae42aa9951144d58c3e2987d1fe4aa60a19
Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
Reviewed-on: https://chromium-review.googlesource.com/241358
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/gerrit.py b/scripts/gerrit.py
index 093c5d1..ef80bcc 100644
--- a/scripts/gerrit.py
+++ b/scripts/gerrit.py
@@ -174,6 +174,8 @@
     query += ' branch:%s' % opts.branch
   if opts.project is not None:
     query += ' project: %s' % opts.project
+  if opts.topic is not None:
+    query += ' topic: %s' % opts.topic
 
   helper, _ = GetGerrit(opts)
   for cl in helper.Query(query, raw=True, bypass_cache=False):
@@ -421,6 +423,8 @@
                       help='Limit output to the specific branch')
   parser.add_argument('-p', '--project',
                       help='Limit output to the specific project')
+  parser.add_argument('-t', '--topic',
+                      help='Limit output to the specific topic')
   parser.add_argument('args', nargs='+')
   opts = parser.parse_args(argv)