Mercurial: Any ideas on how to skip some changesets when merging between branches?

*爱你&永不变心* 提交于 2020-01-03 12:35:10

问题


Here our situation: We have two branches in our Mercurial repository lets call them Branch A and Branch B.

  • Branch A is for the stable version of the code
  • Branch B is for the development branch

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)

Thanks in advance for any advices


回答1:


This is the exact purpose of the transplant extension.

The transplant extension (cherry-picking in other DVCS) keep tracks of what comes from where when you copy change sets, so merge is easier.

You have to activate the extension first (it is included but disabled by default). In your hgrc file, add:

[extensions]
transplant=


来源:https://stackoverflow.com/questions/5018228/mercurial-any-ideas-on-how-to-skip-some-changesets-when-merging-between-branche

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!