Comments
Patch
@@ -931,6 +931,25 @@
l.append(r)
return l
+def keywords_(repo, subset, x):
+ """``keywords(string)``
+ Search commit message, user name, and names of changed files for all
+ individual words from the string.
+ Equivalent to a conjunction of multiple keyword() calls.
+ The match is case-insensitive.
+ """
+ # i18n: "keywords" is a keyword
+ kws = encoding.lower(getstring(x, _("keywords requires a string"))).split()
+ l = []
+ for r in subset:
+ c = repo[r]
+ if util.all(
+ (util.any(kw in encoding.lower(t)
+ for t in c.files() + [c.user(), c.description()]))
+ for kw in kws):
+ l.append(r)
+ return l
+
def limit(repo, subset, x):
"""``limit(set, [n])``
First n members of set, defaulting to 1.
@@ -1586,6 +1605,7 @@
"hidden": hidden,
"id": node_,
"keyword": keyword,
+ "keywords": keywords_,
"last": last,
"limit": limit,
"_matchfiles": _matchfiles,
@@ -331,6 +331,10 @@
$ log 'keyword("test a")'
$ log 'descs("0 1")'
9
+ $ log 'keywords("test a")'
+ 0
+ 6
+ 9
$ log 'limit(head(), 1)'
0
$ log 'matching(6)'