[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mercurial-devel
Subject:    Re: [PATCH 5 of 6 V3] hgweb: blacklist heavyweight revset functions in hgweb search
From:       Alexander Plavin <alexander () plav ! in>
Date:       2013-08-31 12:43:32
Message-ID: 129301377953012 () web4m ! yandex ! ru
[Download RAW message or body]



29.08.2013, 10:04, "FUJIWARA Katsunori" <foozy@lares.dti.ne.jp>:
> At Thu, 22 Aug 2013 19:11:16 +0400,
> Alexander Plavin wrote:
> 
> > š# HG changeset patch
> > š# User Alexander Plavin <alexander@plav.in>
> > š# Date 1374269558 -14400
> > š# šššššSat Jul 20 01:32:38 2013 +0400
> > š# Node ID 3767921c4b274499fe4254bdafef56bba346b088
> > š# Parent š5734dd4b2bd2a859a2ef0be6e0f4485f028abf6e
> > šhgweb: blacklist heavyweight revset functions in hgweb search
> > 
> > šDisallow usage of functions 'contains' and 'grep'.
> > 
> > šdiff -r 5734dd4b2bd2 -r 3767921c4b27 mercurial/hgweb/webcommands.py
> > š--- a/mercurial/hgweb/webcommands.py Wed Aug 07 01:21:31 2013 +0400
> > š+++ b/mercurial/hgweb/webcommands.py Sat Jul 20 01:32:38 2013 +0400
> > š@@ -179,6 +179,10 @@
> > ššššššššššif any_((token, (value or '')[:3]) == ('string', 're:')
> > šššššššššššššššššfor token, value, pos in revset.tokenize(revdef)):
> > ššššššššššššššreturn 'kw', query
> > š+ šššššššfuncsused = revset.funcsused(tree)
> > š+ šššššššblacklist = set(['contains', 'grep'])
> > š+ šššššššif funcsused & blacklist:
> > š+ šššššššššššreturn 'kw', query
> 
> IMHO, "blacklist" information of revsets should be managed in
> mercurial/revset.py, for ease of maintenance in future (following
> newly added predicates, for example).

Not sure if I am for or against this, so probably neutral :) I would like to hear \
other opinions, and if it's really more suitable then no problem to move the related \
code to revset.py.

> 
> > ššššššššššmfunc = revset.match(None, revdef)
> > šššššššššštry:
> > š_______________________________________________
> > šMercurial-devel mailing list
> > šMercurial-devel@selenic.com
> > šhttp://selenic.com/mailman/listinfo/mercurial-devel
> 
> ----------------------------------------------------------------------
> [FUJIWARA Katsunori] ššššššššššššššššššššššššššššfoozy@lares.dti.ne.jp
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@selenic.com
http://selenic.com/mailman/listinfo/mercurial-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic