Revset search syntax in hgweb

Alexander Plavin me at aplavin.ru
Thu Jul 4 11:29:43 CDT 2013


Improving hgweb search by introducing revset syntax is a part of my
summer plan, and I'm having several questions about overall
implementing strategy of this feature and whether my understanding of
it is correct or not.

This feature is inspired by BitBucket, which has such thing in commits
search. They use revset-syntax search if such expression is specified,
and just simple search (similar to what is now in hgweb) otherwise.
One of the questions is how to distinguish the two cases. This can be
implemented by:
a) check if the specified expression is a revset expression: try to
parse it to a search tree and fallback if there is an error
b) always try the search which exists now first, and if nothing is
found use revset-syntax search (or the opposite way)
c) check for revset specifics: brackets and constructions like 'x::y'
d) just add a checkbox to switch revset syntax (seems unpreferable to me)
e) your ideas?

As for me, the first variant seems better, but it also can have false positives.

Another question is about that we probably should ban heavyweight
revset functions not to overload the server. As I understand, it can
be done only by having a list of such functions. Also, in my opinion
there should be a config option to remove the restriction, e.g. for
local use.

Any comments and advice are appreciated.


More information about the Mercurial-devel mailing list