简体   繁体   English

何时在Mercurial中进行分支,标记和合并?

[英]When to branch, tag & merge in Mercurial?

When should one branch/tag in Mercurial ( hg ), both at the local repo level and at the centralized/originating repo (that you hg clone )? Mercurial( hg )何时应在本地回购级别和集中式/原始回购(您为hg clone )上使用一个分支/标记? When should you merge (again at the local level and in the central repo)? 什么时候应该合并(再次在本地和中央仓库中)?

I come from a SVN background where branches were used for new features (" feature branches "), as well as " release branches ". 我来自SVN背景,其中分支用于新功能(“ 功能分支 ”)以及“ 发布分支 ”。 In the case of feature branches, a developer would create a branch if he/she knew a project was going to span multiple sprints/releases. 对于功能分支,如果开发人员知道项目将跨越多个sprint /发行版,则开发人员将创建一个分支。 The feature branch would then be merged back in once the developer was certain they'd be releasing the new feature during the given sprint. 一旦开发人员确定他们将在给定的sprint中发布新功能,功能分支便会合并回去。 The release branch would then be created and deployed to QA and a staging environemnt for QAT/UAT testing respectively. 然后将创建发行分支并将其部署到QA和暂存环境以分别进行QAT / UAT测试。 Any bugs that arose during testing would be committed directly to the release branch. 测试期间出现的任何错误都将直接提交到发行分支。 When the release branch was finally ready to be released, it would be tagged (for archival/record-keeping purposes) and then finally, after the release branch was deployed live, it would be merged back with trunk. 当发布分支最终准备发布时,将对其进行标记(出于存档/记录保留的目的),然后,最终,在发布分支被实时部署之后,它将与主干合并。

How does this process change with a DVCS such as hg ? 对于诸如hg的DVCS,此过程如何变化?

Branching|merging policy can does not differ at all. 合并策略可以完全相同。 These processes just give less headache in Mercurial (you will not be a victim of "Refactoring Hell" with a minimal level of accuracy, unfamous Tree Conflicts are also history) - DVCS vs CVCS will change almost nothing here, Mercurial give you just more freedom: branch when|if you want 这些过程使Mercurial的头痛减轻了(您将不会以最低的准确性成为“重构地狱”的受害者,臭名昭著的Tree Conflicts也是历史)-DVCS vs CVCS在这里几乎不会改变,Mercurial给您带来更多的自由:何时|如果需要,分支

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM