[SOLVED] (was: hg grep seems not very effective to find strings of old changesets!?)
Uwe Brauer
oub at mat.ucm.es
Sat Oct 23 19:01:58 UTC 2021
>>> "DLB" == Dennis Lee Bieber <wlfraed at ix.netcom.com> writes:
> On Sat, 23 Oct 2021 18:58:06 +0200, Uwe Brauer <oub at mat.ucm.es> declaimed
> the following:
>>
>> Maybe I don't know enough of the sophisticated syntax of «hg grep» but I
>> have always found hg grep not very useful.
>>
> https://www.mercurial-scm.org/repo/hg/help/grep
>> Here is an example: I have around 700 change sets in a current repository
>>
>> I found out that in revision 562, the string \label{eq:section4-sh15}
>> appeared in a certain file. However hg grep was enable to find that
>> string in that particular revision.
>>
> What was the exact invocation you used?
> { } may need to be escaped as they are used to delimit an occurrence
> count/range
I tried
hg grep -a eq:section4-sh15 section4-sh.tex
Which did not work, but
hg grep -a -r 0:tip eq:section4-sh15 section4-sh.tex
Did! So the -r 0:tip option is very important, but the documentation is a bit sparse!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5673 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20211023/8bd43d47/attachment.p7s>
More information about the Mercurial
mailing list