Using revsets for specifying a revision

Gilles Moris gilles.moris at free.fr
Wed Jun 23 05:50:06 UTC 2010


On Wednesday 23 June 2010 05:42:47 am Julian Cowley wrote:
> The revsets feature in the upcoming Mercurial 1.6 looks like it is going
> to be really useful.  So far, it appears to only work for the hg log
> command.  Are there plans to make it available for other commands, too?
>
> For instance, it would be great to be able to say this instead of having
> to look up the base revision using debugancestor:
>
> $ hg diff -r 'ancestor(11387, 11386)' -r 11387
>
> Ideally, revsets could be used anywhere a revision can be specified, as
> long as the result is just one revision, such as the above.

Actually, I would tend to think the opposite.
I am usually putting dash in my mq patch names. Yesterday, when I wanted to 
display one of my patches, I got:

% hg export mq-retcode
abort: unknown revision 'mq'!

It took me a couple minutes to understand what was happening and how to 
workaround it:

% hg export '"mq-retcode"'

To have it everywhere but not by default, I would suggest an on-demand 
activation of the revset grammar only when the user ask for it:

% hg export 'expr(mq-retcode)'
% hg diff -r 'expr(ancestor(11387, 11386))' -r 11387

I think people may already have a lot of tags with possibly some special 
characters that the grammar will try to interpret.

Regards.
Gilles.



More information about the Mercurial mailing list