Mercurial 设置:一个还是多个中央存储库?
我的公司正在从 Subversion 切换到 Mercurial。我们的产品使用.NET。我们有一个包含大约十几个项目的解决方案,这些项目是独立的模块,彼此之间没有依赖关系。我们在服务器上使用带有推/拉功能的中央存储库来进行集成构建。
我试图弄清楚是否应该创建一个包含所有项目的中央存储库,或者是否应该为每个项目创建一个单独的存储库。支持单独存储库的一个论点是,分支各个模块会更容易,但支持单个存储库的一个论点是更容易管理和工作流程。
我对 hg 和 DVCS 非常陌生,因此非常感谢一些指导。
预计到达时间:Joel 在 hginit.com 上说:
[I]如果你习惯了一个大的 巨大的整体存储库 公司,有些人只检查 并在子目录上工作 他们关心的,这不是一个非常 使用 Mercurial 的好方法 — 您 最好有很多更小的 每个项目的存储库。
如果有人可以对此进行扩展或向我指出更多文档,那就太好了。
My company is switching from Subversion to Mercurial. We're using .NET for our product. We have a solution with about a dozen projects that are separate modules with no dependencies on each other. We're using a central repo on a server with push/pull for our integration build.
I'm trying to figure out if I should create one central repo with all the projects in it, or if I should create a separate repo for each project. One argument for separate repos is that branching the individual modules would be easier, but an argument for a single repo is easier management and workflow.
I'm very new to hg and DVCS, so some guidance is greatly appreciated.
ETA: At hginit.com, Joel says:
[I]f you’re used to having one big
gigantic repository for the whole
company, where some people only check
out and work on subdirectories that
they care about, this isn’t a very
good way to work with Mercurial—you’re
better off having lots of smaller
repositories for each project.
It'd be great if someone could expand on this or point me to more documentation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这里您应该考虑的一件事是 Mercurial 不支持像 subversion 那样检查目录。一种典型的颠覆设置是拥有一个巨大的存储库,其中包含多个单独的项目,当有人需要代码时,他们只会检出包含该项目的子目录。你不能在 Mercurial 中做到这一点。你要么拿走整个仓库,要么什么也不拿。如果从事这些项目的每个人并不总是需要所有代码,您可能希望将其拆分到单独的存储库中。
编辑:此链接可能有助于设置,特别是“发布多个存储库”部分。
One thing you should take into consideration here is the fact that Mercurial does not support checking out directories like subversion does. One typical subversion setup is to have one giant repo with multiple separate projects in it, and when somebody needs code they will just checkout a subdirectory containing that project. You can't do this in mercurial. You either take the whole repo, or nothing. If everybody working on these projects does not need all the code, all the time, you might want to split it up into separate repositories.
EDIT: This link might be helpful in setting things up, in particular the "Publishing Multiple Repositories" section.
如果完全独立的存储库不适合您,则可以将每个项目作为某个伞式存储库的子存储库。我不得不说,单独的存储库听起来像是您所需要的,但考虑到每个项目听起来完全独立。
if completely separate repos don't work for you maybe have each project as a subrepo of some umbrella repo. I have to say that seperate repos sounds like what you need though given that each project sounds totally independent.
我自己对 Mercurial 相当陌生(我的公司正在从 SourceSafe 实现飞跃),所以我不知道更多的经验会说什么。
对我来说,每个 Visual Studio 解决方案拥有一个存储库是有意义的。如果您的模块确实彼此不依赖,为什么它们都在同一个解决方案中?如果您有充分的理由将它们全部放在一个解决方案中,那么这可能就是将它们保留在一个存储库中的原因。如果没有充分的理由让它们出现在一个解决方案中,那么每个存储库和一个解决方案对我来说更有意义。
编辑:因此,由于所有模块都是构建在一起并且需要集成,这将推动我走向单一解决方案和单一存储库。
Mercurial 在合并方面做得很好,但我遇到的一件事是在合并添加多个项目时的解决方案文件。它与多个
End Project
行混淆。因此,只要您不经常添加新项目,您的合并就应该很顺利。I'm fairly new to Mercurial myself (my company is making the leap from SourceSafe) so I don't know what more experience would say.
For me it makes sense to have one repository per Visual Studio Solution. If your modules are truly not dependent on each other, why are they all in the same solution? If you have a good reason for them all being in one solution, then that's probably the reason to keep them in one repository. If there's not a good reason for them to be in one solution, then a repository and a solution for each makes more sense to me.
Edit: So, since all the modules are built together and need to integrate, that would push me towards a single solution and a single repository.
Mercurial does a great job of merging, but the one thing I've had issues with is the solution file when merging the addition of more than one project at a time. It gets confused with multiple
End Project
lines. So, as long as you aren't adding new projects very often, your merges should be smooth.根据我的经验,而不是基于研究等,我会说每个逻辑 blob 都是一个存储库。如果您在子项目之间共享代码,它们需要位于同一个存储库中。 将有完整的子存储库功能,但目前(2010 年 4 月)尚未完全实现。
From my experience, and not based upon studies etc, I would say that each logical blob is a repository. If you share code between subprojects, they need to be in the same repo. There will be full subrepo functionality, but currently (apr 2010) it's not fully implemented.