SVN 用户推荐的 Mercurial 存储库/文件夹结构 [英] Recommended Mercurial repository/folder structure for an SVN user

查看:17
本文介绍了SVN 用户推荐的 Mercurial 存储库/文件夹结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试验 Hg,以期摆脱 SVN,但想就如何构建 Hg 存储库提出一些意见.我来自 SVN 背景(这可能会影响我对它应该如何工作的看法!)并且我的存储库目前看起来像这样:

I am experimenting with Hg with a view to moving away from SVN but wanted some opinions on how I should structure my Hg repository. I come from a SVN background (which may of tainted my outlook on how this should work!) and my repository currently looks something like this:

Project1
  trunk
  branches
    1.0
    1.1
Project2
  trunk

等等.这似乎是构建 SVN 存储库的传统"方式.

etc. This seems to be the 'traditional' way to structure an SVN repository.

我应该如何用 Hg 重现这个?为了让这更有趣,我喜欢稳定"、qa"和开发"存储库/文件夹的想法,如果可能的话,我想介绍一下.

How should I reproduce this with Hg? To spice this up a little I like the idea of 'stable', 'qa' and 'dev' repositories/folders and would like to introduce this if possible.

我是汞初学者,欢迎任何帮助或建议.

I am an Hg beginner so any help or advice is welcome.

推荐答案

Subversion (SVN) 和 Mercurial (HG) 存储库(或简称为 repo)之间存在一些结构差异,这意味着您将如何设计"您的层次结构:

There are several structural differences between a Subversion (SVN) and Mercurial (HG) repository, or repo for short, implies how you'll "design" your hierarchy:

  • Mercurial 在每个存储库中只使用一个项目时效果更好:因为您总是需要克隆整个存储库,所以在一个存储库中拥有多个项目可能会对克隆时间以及推/拉操作,因为您每次都必须同步在其他项目上完成的所有工作.
  • SVN 没有标记/分支的强"概念,而 Mercurial 有:在 SVN(在撰写本文时)中,每个分支、每个标记基本上是给定的项目/文件夹/任何东西.推荐的 trunk/branches/tags 结构可以帮助您找到您的副本",仅此而已.另一方面,分支和标签在 mercurial 中有很好的定义.标签实际上是您放在特定修订版上的名称,您可以要求所有现有标签.对于分支机构,您会看到有 许多 处理它们的方法,但最适合 SVN 哲学的方法称为分支.
  • Mercurial works better with only one project per repository: Because you always have to clone the entire repository, having multiple project in a single repository might have a big impact on the cloning time as well as on the pushing/pulling operations, as you'll have to synchronize all the job that was done on other projects than yours each time.
  • SVN does not have a "strong" notion of tagging/branching, while Mercurial does: In SVN (at the time of writing), each branch, each tag, is basically a copy of a given project/folder/whatever. The recommended trunk/branches/tags structure is there to help you to find your "copies" back, no more. On the other side, branches and tags are well defined in mercurial. A tag is really a name that you put on a particular revision, and you can ask for all the existing tags. For branches, you'll see that there are MANY ways to handle them, but the one that fits best to the SVN philosophy, are named branches.

考虑到这一点,并将其与您关于稳定、质量保证 (QA) 和开发 (dev) 流程的想法相结合,以下是我的建议:

With that in mind, and coupling it with you idea of stable, quality assurance (QA), and development (dev) process, here is what I would recommend:

  • 每个项目一个名为Stable"的存储库.每个项目有多个质量保证"存储库,每个项目有大量开发".
  • 标签和名称分支仅由稳定"存储库定义,或最终由QA"定义.开发"存储库可以以不同的方式处理它们而不会受到伤害.
  • 您永远不会推动质量保证"或稳定"存储库,他们会拉取或集成捆绑包或补丁,并且每个都有一个人负责.

示例:MyProject-1.0

 [STABLE Repository, pulls from any/all QA]
  - MyProject-1.0

 [QA Repositories, branched from STABLE, pulls from any/all DEV ]
  - QA_MyProject-001 (Person A)
  - QA_MyProject-002 (Person B)
  - QA_MyProject-003 (Person C)
            ...
  - QA_MyProject-### (Person #)

 [DEV Repositories, branched from STABLE or QA]
  - DEV_MyProject-001 (Feature X) 
  - DEV_MyProject-002 (Feature Y)
  - DEV_MyProject-003 (Feature Z)
            ...
  - DEV_MyProject-### (Feature #)

  1. DEV completes feature(s)
  2. QA pulls feature(s) from DEV
  3. STABLE pulls from all approved QA(s) (consolidating all changes)

这篇关于SVN 用户推荐的 Mercurial 存储库/文件夹结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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