[Patchew-devel] [PATCH v2 11/12] search: Introduce maintained-by:NAME term

Fam Zheng fam at euphon.net
Wed Nov 28 14:35:04 UTC 2018


From: Fam Zheng <famz at redhat.com>

Signed-off-by: Fam Zheng <famz at redhat.com>
---
 api/search.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/api/search.py b/api/search.py
index a15d238..264c1cd 100644
--- a/api/search.py
+++ b/api/search.py
@@ -127,6 +127,16 @@ Compare the address info of message. Example:
 
 ---
 
+### Search by maintainer associated with the changeset
+
+ - Syntax: maintained-by:NAME
+ - Syntax: maint:NAME
+
+NAME can be the name, email or a substring of MAINTAINERS file entries of the
+maintainer.
+
+---
+
 ### Search by result
 
 Syntax:
@@ -321,6 +331,11 @@ Search text keyword in the email message. Example:
             cond = term[term.find(":") + 1:]
             self._projects.add(cond)
             return Q(project__name=cond) | Q(project__parent_project__name=cond)
+        elif term.startswith("maintained-by:") or term.startswith("maint:"):
+            cond = term[term.find(":") + 1:]
+            if cond == "me" and user:
+                cond = user.email
+            return Q(maintainers__icontains=cond)
 
         # Keyword in subject is the default
         return self._add_to_keywords(term)
-- 
2.17.2





More information about the Patchew-devel mailing list