Mercurial:粒度存储库与版本控制中的大型存储库和共享第三方工具

发布于 2024-11-29 13:13:03 字数 1260 浏览 7 评论 0原文

设想: 各种产品由较小的项目组合而成。每个产品在开发、发布和维护中都有几个不同的版本(错误/补丁/次要版本)。

大多数团队使用各种第三方工具和库进行开发和发布(常见的两个是用于开发的 XUnit 和用于产品的 AutoMapper)。他们是对这些工具/库进行有意义的版本控制的粉丝。

我似乎无法理解在 Mercurial 中组织结构的最佳方式。在中央 SVN 风格中,我会通过将第三方工具作为自己的项目进行组织,然后为项目进行小型构建以获取其他项目的输出,然后构建一个发布项目已建成的项目。所有内容都将位于一个层次结构中,

(开发分支)

Root/dev/ProjectX/
Root/dev/ProjectY/
Root/dev/ThirdParty/XXX -- could be a 3rd party lib
Root/dev/ThirdParty/YYY -- could be a 3rd party lib

(分支 1)

Root/release1/ProjectX/
Root/release1/ProjectY/
Root/release1/ThirdParty/XXX 
Root/release1/ThirdParty/YYY

(分支 2)

Root/release2/ProjectX/
Root/release3/ProjectY/
Root/release2/ThirdParty/XXX 
Root/release2/ThirdParty/YYY

等。

由于开发人员保持机器最新的方式(使用 NUGET 包管理器)第三方项目都必须位于 ThirdParty 文件夹中,以确保开发人员不必为每个项目都拥有这些库的多个副本项目。

我的问题是:

如果他们实施 Mercurial 应该实施类似的策略(大仓库)并在此处克隆/分支,或者他们应该在项目级别分解存储库并克隆/分支它们。在后一种情况下,他们会有产品/版本分支/存储库吗?我知道如果分布式模型从长远来看效果更好,他们会更喜欢它,即使学习新工作流程一开始很困难。

我读过 http://nvie.com/posts/a-successful- git-branching-model/ 和一些文章,但我仍然不确定如何组织。

Scenario:
Various products made up combinations of the smaller projects. A few different versions of each product in dev, release and maintennace (bugs/patches/minor releases).

Most the the team use various third party tools and libraries for dev and for release (common two are XUnit for dev, and AutoMapper in product). They're fans of version controlling these tools/libraries where it makes sense.

I cannot seem understand the best way to organise the structure in mercurial. In the the central SVN style, I'd organise by having the the third party tools as their own projects and then having small builds for the projects that would grab the output of the other projects, and then a release project that would be built from the built projects. All would be in a hierarchy,

(dev branch)

Root/dev/ProjectX/
Root/dev/ProjectY/
Root/dev/ThirdParty/XXX -- could be a 3rd party lib
Root/dev/ThirdParty/YYY -- could be a 3rd party lib

(branch 1)

Root/release1/ProjectX/
Root/release1/ProjectY/
Root/release1/ThirdParty/XXX 
Root/release1/ThirdParty/YYY

(branch 2)

Root/release2/ProjectX/
Root/release3/ProjectY/
Root/release2/ThirdParty/XXX 
Root/release2/ThirdParty/YYY

etc.

Here comes the rub, due to the way that developers keep their machines upto date (using NUGET package manager) the third party items all have to be in the ThirdParty folder to to ensure that the devs don't have to have multiple copies of these libraries for each project.

My question is this:

If they implement mercurial should implement a simmilar strategy (big repo) and clone/branch here or should they break up the repository say at the project level and clone/branch these. In the latter case would they have a product/version branch/repo? I know they'd prefer a distributed model if it works better in the long term, even if the pain of learning a new workflow is hard initially.

I've read http://nvie.com/posts/a-successful-git-branching-model/ and a number of articles but I'm still unsure as to how to organise.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回忆凄美了谁 2024-12-06 13:13:03

基本上,您为每个产品、每个项目和每个第三方库创建一个单独的存储库,然后在 子存储库。在您的中央服务器(或多个服务器)上,我可能会设置如下所示的裸存储库结构:

  products/ProductA/
           ProductB/
           ProductC/   
  projects/ProjectA/
           ProjectB/
           ProjectC/   
thirdparty/ThirdPartyA/
           ThirdPartyB/
           ThirdPartyC/

这样,您的中央服务器上的每个存储库都只有一个副本。您不需要为每个分支创建单独的存储库,因为 Mercurial 可以在一个存储库中保存多个分支。

然后,当有人在本地存储库中签出产品时,您可以使用子存储库机制来签出相应项目和第三方库的工作树。在本地磁盘上,结构将如下所示:

ProductA/
         ProjectA/
         ProjectB/
         ThirdParty/
                    ThirdPartyC/

这看起来与中央服务器上的不同,因为在那里您没有工作树,只有指向子存储库的指针

Basically, you make a separate repo for each product, each project, and each third-party library, and then you combine them as appropriate in subrepositories. On your central server (or servers), I would probably set up a structure of bare repos like this:

  products/ProductA/
           ProductB/
           ProductC/   
  projects/ProjectA/
           ProjectB/
           ProjectC/   
thirdparty/ThirdPartyA/
           ThirdPartyB/
           ThirdPartyC/

This way you have exactly one copy of each repo on your central server. You don't need to make separate repos for each branch, because mercurial can hold multiple branches in one repository.

Then, when someone checks out a Product in their local repository, you use the subrepo mechanism to also check out the working trees for the appropriate projects and third party libraries. On your local disk, the structure will look like this:

ProductA/
         ProjectA/
         ProjectB/
         ThirdParty/
                    ThirdPartyC/

This looks different than on the central server because there you don't have working trees, only pointers into the subrepos.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文