Hgview is a fantastic tool but for some reason the search field refused to come up in my version no matter how much CTRL+F I tried.

So I had to find some other way of searching all the revision changes by a substring in the content/code.

As it happens the command hg log -v -p -r 100 will for instance give you all the details for revision 100, which code was added, deleted, changed and all. Just what I needed in order to loop revisions.

As you can see we search for a substring in a span of revisions, if we have a match we print out a string containing the match with some after and before and the revision number. Those revision numbers can be used in hgview to get more information.

The script could be invoked like this: php hgsearch.php searchForMe 100 200 to search for the substring searchForMe in revisions 100 to 200.