Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/349351 )

Change subject: mwgrep: If --title is set, don't also require '*.js/.css'
......................................................................

mwgrep: If --title is set, don't also require '*.js/.css'

This allows searching for contents in interface messages by
an exact name. There is no need to additionally require the
same regex to match. It's wasteful and makes mwgrep also harder
to use.

 mwgrep foo --title 'Something.js'

 mwgrep foo --title 'Something else'

Should both work. Currently the latter doesn't work because it
fights the AND condition for .js/css regex on title match.

Change-Id: I977ac24cbaacea9cbfcaefe4099018783c9d9b68
---
M modules/scap/files/mwgrep
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/51/349351/1

diff --git a/modules/scap/files/mwgrep b/modules/scap/files/mwgrep
index 08ffc84..65f4f05 100755
--- a/modules/scap/files/mwgrep
+++ b/modules/scap/files/mwgrep
@@ -109,11 +109,11 @@
     }},
 ]
 
-if args.ns == NS_USER or args.ns == NS_MEDIAWIKI:
-    filters.append( {'regexp': {'title.keyword': '.*\\.(js|css)'}} )
 
 if args.title is not None:
     filters.append( {'term': {'title.keyword': args.title}} )
+elif args.ns == NS_USER or args.ns == NS_MEDIAWIKI:
+    filters.append( {'regexp': {'title.keyword': '.*\\.(js|css)'}} )
 
 search = {
     'size': args.max_results,

-- 
To view, visit https://gerrit.wikimedia.org/r/349351
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I977ac24cbaacea9cbfcaefe4099018783c9d9b68
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Krinkle <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to