Mercurial 存储库搜索/索引
有谁知道如何搜索 Mercurial 存储库? (我们目前使用 hgweb
来托管我们的存储库。)我们希望搜索源代码的过去修订版本。例如,找出何时可能引入错误。
Fisheye 看起来很合适,但该公司不愿意为此付费。是否有任何开源替代方案或其他解决方案可以让我们在 hg 中搜索源历史记录?
理想的解决方案将允许我们:
- 搜索注释
- 搜索源代码的所有修订版
- 搜索多个存储库
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要您愿意有要搜索的代码的本地克隆,Mercurial 本身和 TortoiseHg 都有强大的搜索选项。
Mercurial Alone
hg grep
允许您搜索代码对于图案。它搜索代码的所有修订版本,而不仅仅是您的工作副本。hg revsets
提供了一种功能语言来限制hg 等命令的输出记录到有趣的集合。例如,您可以根据修订范围、关键字和许多其他选项来限制输出。
hg 文件集
与修订集类似,但对文件选择进行操作。最后,
hg bisect
可以帮助找到哪个变更集引入了错误,假设您有一个可编写脚本的测试。TortoiseHg
TortoiseHg 将上述一些命令捆绑到漂亮的 GUI 界面中。特别是,您可能会对搜索界面感兴趣,它为
hg grep
提供了一个很好的包装器。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 likehg 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
.