[Patchew-devel] [PATCH 15/16] search: Introduce maintained-by:NAME term

Fam Zheng famz at redhat.com
Wed Nov 21 02:08:45 UTC 2018


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 0be435f..9ab6e0b 100644
--- a/api/search.py
+++ b/api/search.py
@@ -110,6 +110,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:
@@ -303,6 +313,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._make_filter_keywords(term)
-- 
2.17.2




More information about the Patchew-devel mailing list