gerrit: add support for project filtering (-p)

The gerrit command already supports the -b,--branch argument, used to
filter only changes done for one particular branch. This change adds
a similar capability for the project, using the -p,--project option.

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