Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Querying improvements on hg.mozilla.org

8 views
Skip to first unread message

Gregory Szorc

unread,
Jun 23, 2017, 9:05:17 PM6/23/17
to dev-version-control
There were some minor but potentially very useful improvements to querying
data on hg.mozilla.org this week.

Pretty much every repo page now has an input box on the top right. e.g.
https://hg.mozilla.org/mozilla-central/. Before this week, some pages were
missing it. You also now get a hover box on mouseover telling you what it
is for and more importantly linking to
https://hg.mozilla.org/mozilla-central/help/revsets so you can see what
types of queries are possible.

Mercurial has a built-in query language called "Revision Sets" (or
"revsets"). It's like SQL, but for repository data. That search box on
hg.mozilla.org allows you to type in revsets. That's existed for ages.

What's new this week is we now expose pushlog functions/predicates to
web-based queries. If you go to the aforementioned help page, search for
"push" to see what they are. So, you can now type queries like
'pushdate(">2017") & pushuser(gszorc)' to find all pushes by me in 2017. Or
'pushdate(-7) & file("glob:servo/**")' to find all changesets touching the
servo/ directory pushed in the past 7 days. Or "pushhead()" to select all
changesets that were heads at the time of push (hint: automation is
typically tied to this set).

And as a reminder, if you add "json-" to the "action" in the URL (e.g.
https://hg.mozilla.org/mozilla-central/json-log?rev=pushdate(-7)+%26+file(%22glob%3Aservo%2F**%22)
) you can get JSON output for pretty much any page on hg.mozilla.org.

It is pretty easy to add new query predicates and to modify the output. So
if you have feature suggestions, get in touch.

Happy querying.
0 new messages