Fix pattern section in doc

Mads Kiilerich mads at kiilerich.com
Fri Aug 5 08:23:48 UTC 2011


On 08/05/2011 04:17 AM, RizThon wrote:
> The pattern section may need to be fixed
> http://www.selenic.com/mercurial/hg.1.html#patterns
> If I try the patterns from the page (eg path:foo/bar), I get a "Parse
> Error: syntax error" (at least that's what TortoiseHg tells me).

What do Mercurial say? Which Mercurial version? And what is your 
platform / shell?

This works for me in the Mercurial repo:
   hg log path:hgext/mq.py
   hg log glob:hgext/*
(but I should quote the * to make sure my bash shell doesn't expand it:)
   hg log "glob:hgext/*"

> But if I look at http://www.selenic.com/mercurial/hg.1.html#revsets and
> try the patter (eg file('hgext/*')), it works.

Yes, this works too:
   hg log -r "file('hgext/*.py')"

- but it really is quite a bit different because it first find the set 
fo revisions that touches these files and then show the log of that set. 
The first examples (with -r) just works on Mercurials storage of 
individual files (so you can use --follow) and translates that to the 
most likely corresponding changeset.

> The name of the files in the samples from
> http://www.selenic.com/mercurial/hg.1.html#patterns should be inside
> single quotes.

Why? Mercurial follows the usual quotation rules, and I haven't seen any 
evidence that the documentation is wrong.

There is however the constraint that single quotes doesn't "work" in the 
windows cmd prompt, so windows users should always put there revset 
expressions in double quotes and then it is most convenient to use 
single quotes inside the revset.

/Mads



More information about the Mercurial mailing list