Mercurial:关于分支之间合并时如何跳过某些变更集的任何想法? [英] Mercurial: Any ideas on how to skip some changesets when merging between branches?
问题描述
这是我们的情况: 我们在Mercurial存储库中有两个分支,可以将它们称为分支A和分支B.
Here our situation: We have two branches in our Mercurial repository lets call them Branch A and Branch B.
- 分支A用于代码的稳定版本
- B分支用于开发分支
在分支A中修改的所有内容都已合并到分支B. 但是,现在我们到达了分支B中的代码与分支A有几个区别的地步. 我们在分支A中进行了一些大的代码更改,将这些更改合并到分支B中将是一个真正的痛苦,实际上,我们想对解决方案进行替代实现. 但是,稍后我们也希望继续在分支A上进行更改,并且仍然能够将这些稍后的较小更改合并到分支B中. 所以问题是: 合并到分支B中时是否可以跳过分支A中的某些变更集,然后再将以后的变更集从A合并到B中? (可能使用纯汞解决方案,没有解决方法,包括备份的副本等等.)
Everything that was modified in branch A has been merged to branch B. However now we came to a point where the code in branch B has several differences from branch A. We made some large code changes in branch A, merging these changes in branch B would be a real pain and actually we would like to make an alternative implementation of the solution. However later we would also like to continue the changes on branch A and still be able to merge these later minor changes into branch B. So the question is: Is it possible to skip some single changesets from branch A when merging into branch B and merge later changesets from A into B again? (Possibly with a pure Hg solution and no workarounds, with copies from backups and so on...)
以下是我们将要达到的目标的概述:
Here an overview of what we would reach:
Changesets Branch A Changesets Branch B
Chgset A.1 Chgset B.1 (Merged with A.1)
Chgset A.2
Chgset B.2 (**Not merged with A.2**)
Chgset A.3 Chgset B.3 (Merged with A.3 but not with A.2)
预先感谢您的任何建议
推荐答案
这是 transplant
扩展名.
This is the exact purpose of the transplant
extension.
transplant
扩展名(在其他DVCS中进行樱桃挑选)可跟踪复制更改集时来自何处,因此合并更加容易.
The transplant
extension (cherry-picking in other DVCS) keep tracks of what comes from where when you copy change sets, so merge is easier.
您必须先激活扩展名(已包含 ,但默认情况下禁用了 ).在您的hgrc
文件中,添加:
You have to activate the extension first (it is included but disabled by default). In your hgrc
file, add:
[extensions]
transplant=
这篇关于Mercurial:关于分支之间合并时如何跳过某些变更集的任何想法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!