[RFC] revision sets

Dirkjan Ochtman dirkjan at ochtman.nl
Tue Apr 20 01:45:10 CDT 2010


On Tue, Apr 20, 2010 at 00:32, Matt Mackall <mpm at selenic.com> wrote:
> I've pitched an idea like this before, usually with a weird
> operator-intensive syntax. This time, I think the right thing is an
> easily-read but more verbose query language.

Your current proposal feels very verbose to me.

Couldn't we just translate the options we have to something queryish?

 hg log -r "branch(foo) and keyword(bar) and date(mar 1 - apr 1)"

could be

 hg log -r "b foo, key bar, d mar 1 - apr 1"

and

 hg log -r "descendant(parent2(1.0)) and ancestor(2.0) and
author(george) and sorted(date) and reversed()"

could be

 hg log -r "desc p2 1.0, anc 2.0, auth george, sort date, reverse"

Steps to get from yours to mine:

 1. Lose "and" as a separator, use ',' or '&'
 2. Allow non-ambiguous abbreviations like we do everywhere else
 3. Optional parens if unambiguous

Also, this proposal might perhaps benefit from a small list of use cases.

Cheers,

Dirkjan


More information about the Mercurial-devel mailing list