Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial Repository Searching/Indexing

Tags:

mercurial

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
like image 762
Josh Johnson Avatar asked Dec 21 '22 11:12

Josh Johnson


1 Answers

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.

like image 149
Tim Henigan Avatar answered Jan 30 '23 23:01

Tim Henigan