Using revsets for specifying a revision

Julian Cowley julian at lava.net
Thu Jun 24 01:26:45 UTC 2010


On Wed, 23 Jun 2010, Gilles Moris wrote:
> 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

Martin mentioned that a colon cannot be part of a tag name.  For cases
where --rev specifies a single revision (not a revision range), then
perhaps an unambiguous syntax could be to say something like "expr"
or "revset", followed by a colon.  For example:

hg diff -r 'expr:ancestor(11387, 11386)' -r 11387
hg diff -r 'revset: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.

Unfortunately this syntax wouldn't be unambiguous in the cases where
a revision range is allowed (which incidentally I found to be the hg
log, export, and grep commands), and you'd still have to use quotes
like you did above.

> Regards.
> Gilles.



More information about the Mercurial mailing list