您如何跨多个水银库进行搜索 [英] How do you search across multiple mercurial repositories

查看:100
本文介绍了您如何跨多个水银库进行搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我们所有的不同项目设置多个Mercurial存储库,可能接近50.是否可以在多个存储库中搜索特定的文件或字符串?例如,假设数据库列已重命名,我将如何在每个存储库中搜索对旧列名称的任何引用?我知道我可以分别为每个存储库执行此操作,但是如果您有50个存储库,那会很耗时吗?

I'm setting up multiple Mercurial repositories for all of our different projects, probably close to 50. Is there a way to search across multiple repos for a specific file or string? For example, say that a database column is renamed, how would I search each repository for any reference to the old column name? I know that I can do this for each repository individually, but if you've got 50 repositories, that can be quite time consuming?

如果不可能,那么是否有任何最佳实践来构建存储库以最大程度地减少这种麻烦?

If it's not possible, are there any best practices then for structuring your repositories to minimize this pain?

推荐答案

不可能-存储库完全独立.

It's not possible -- repositories are entirely independent.

如果要设置全局搜索的一种方法是将所有50个存储库推送到一个可搜索的存储库中.像这样:

If you wanted to set up a global search one way to do it would be to push all your 50 repositories into a single repository that can be searched. Something like this:

hg init everything
for therepo in /path/to/repos/* ; do
   hg -R everything pull -f $therepo
done

然后您可以在everything中搜索.您可以使用cron作业使所有内容保持最新状态,或者使用其他存储库上的changegroup钩子来推送所有内容.

Then you can search in everything. You could keep everything current using a cron job or changegroup hooks on your other repos that do a push to everything.

这篇关于您如何跨多个水银库进行搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆