4

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:

  • search comments
  • search all revisions of the source code
  • search multiple repositories

1 Answer 1

11

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.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.