水银与多个项目 [英] Mercurial with multiple projects

查看:90
本文介绍了水银与多个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的SVN信息库中有几个项目具有不同的发布周期.通过使用SVN中的经典标记结构来创建发行版.如果存在要在发行版中修复的错误,则根据标签创建分支后,便会修复该错误,然后将其从此处合并到主干中.

I have a couple of projects with different release cycles sitting in my SVN repository. Releases are created by using the classic tags structure in SVN. When there are bugs to fix in releases a branch is created from a tag, the bug is fixed and then merged from there into trunk.

现在,由于多种原因,我想通过一个中央推送站点从SVN切换到正常运行.

Now, for multiple reasons, I want to switch from SVN to mercurial with a central push site.

问题:在组织多个项目之间共享很少的代码时,哪种方法最好?我是否应该创建多个推送站点,每个项目一个?

Question: Which is the best way in mercurial to organize multiple projects that share little code between them? Should I create multiple push sites, one for each project?

请在答案中包含有关如何使用您喜欢的存储库设计版本重新创建发行标签,错误修正分支...的说明.

Please include in the answer a description on how to recreate my release-tag, bugfix branch, ... with your preferred version of repository design.

我想安装尽可能少的扩展.

I would like to install as little extensions as possible.

Edit2:

给出此SVN布局:

.
|-- project-a
|   |-- branches
|   |   |-- 1.x
|   |   `-- feature-1
|   |-- tags
|   `-- trunk
`-- project-b
    |-- branches
    |-- tags
    |   |-- 1.0
    |   `-- 1.1
    `-- trunk

(感谢@bendin!:))

(thanks @bendin! :) )

使用多个汞推存储库更好吗

Is it better to work with multiple hg push repositories

project_a-trunk
project_a-1.x
project_a-feature-1
project_b-trunk

用于分支.标签被折叠到适当的分支中.

for the branches. Tags are folded into the appropriate branch.

或者在这个示例中您宁愿使用两个推送存储库

Or would you rather go with two push repositories in this example

project_a
project_b

具有命名分支,因此在一个存储库中有多个头.

with named branches and therefore multiple heads within one repo.

我看到了多头回购协议的优势在于,我不必去寻找多个回购协议中的标签.我看到的缺点是,汞书似乎不鼓励使用多个头存储库.你会/你会做什么?

The advantage I see with the multiple heads repos is that I don't have to go hunt for a tag in multiple repos. The disadvantage I see is that the hg book seems to discourage multiple head repos. What would/do you do?

推荐答案

某些Subversion存储库会将逻辑上不相关的内容(即具有不同版本号和发布周期的项目)归为一个主干:

Some subversion repositories will group logically unrelated things (i.e. projects with different version numbers and release cycles) under one trunk:

.
|-- branches
|   |-- project-a-1.x
|   `-- project-a-feature-1
|-- tags
|   |-- project-a-1.0
|   |-- project-b-1.0
|   `-- project-b-1.1
`-- trunk
    |-- project-a
    `-- project-b

这种布局在汞方面没有直接的类似物.每个项目都有自己的发布周期和版本号,应该有自己的存储库.

This kind of layout has no direct analog in mercurial. Each project which has its own release cycle and own version numbers should have its own repository.

一些Subversion信息库的结构是通过为每个项目赋予其自己的主干,标签和分支来实现此目的:

Some subversion repositories are structured to do this by giving each project its own trunk, tags and branches:

.
|-- project-a
|   |-- branches
|   |   |-- 1.x
|   |   `-- feature-1
|   |-- tags
|   `-- trunk
`-- project-b
    |-- branches
    |-- tags
    |   |-- 1.0
    |   `-- 1.1
    `-- trunk

您可以将每个项目都视为物理Subversion存储库中的逻辑存储库.每个项目都有自己的主干,标签和分支.这样做还有一个好处,因为您已经知道标签和分支的名称属于哪个项目,所以可以将标签和分支的名称保持较短.

You can think of each project as a logical repository within your physical subversion repository. Each project has its own trunk, tags and branches. This also has the benefit that you can keep tag and branch names shorter because you already know which project they belong to.

使用诸如Mercurial之类的工具来表达这种布局也是微不足道的.每个项目"都将成为一个商业资源库.该存储库中的标签和分支是该项目的标签和分支.

This layout is also trivial to express with a tool like mercurial. Each "project" becomes a mercurial repository. Tags and branches within that repository are tags and branches of that project.

这篇关于水银与多个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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