Does anyone know how to search mercurial repositories? (We are currently using hgweb
to host our repositories.) We would like to search past revisions of source code. E.g. to find out when a bug may have been introduced.
Fisheye looks like it would fit nicely but the company is unwilling to pay for it. Are there any open source alternatives or another solution all together that would allow us to search source history in hg?
An ideal solution would allow us to:
As long as you are willing to have a local clone of the code to be searched, Mercurial itself and TortoiseHg have strong search options.
Mercurial Alone
hg grep
allows you to search the code for patterns. It searches all revisions of the code, not just your working copy.
hg revsets
provide a functional language to limit the output of commands like hg log
to interesting sets. For example, you may limit the output based on revision ranges, keywords, and many other options.
hg filesets
is similar to revsets, but operates on file selections instead.
Finally, hg bisect
can help find which changeset introduced a bug, assuming that you have a scriptable test for it.
TortoiseHg
TortoiseHg bundles some of the above commands into pretty GUI interfaces. In particular, you would probably be interested in the search interface which provides a nice wrapper for hg grep
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With