我从default创建了一些分支(称为brnch),并在那里进行了一些提交。现在,需要从分支到某个发布分支挑选所有的差异来进行热修复。这样的事情在mercurial中是可能的吗?
^ ^
| |<--- brnch
| - commit3
| |
| - commit2
- |
| |
| - commit1
- |
| |
| |
|--
|
-
default是否可以从分支brnch (commit1,commit2,commit3)中的所有通信创建一个补丁,并将其应用于其他分支(在我的情况下,发布热修复)?
发布于 2017-10-12 01:31:35
参见hg help export和hg help import。
示例:
hg export branch(brnch) -o brnch.patch # export everything on brnch
hg export -r commit1 -r commit2 -o cherrypick.patch # cherrypick two changesets
hg update <somewhere_else>
hg import brnch.patch # import the revisions in the patch
hg import --no-commit brnch.patch # import (but don't commit) revisions.
hg commit -m hotfix # commit changes as one commit with "hotfix" description.发布于 2017-10-12 01:40:00
您可以通过hg rebase简单地实现这一点。
为简单起见,我假设您希望在brnch中看到从commit1开始的所有内容,请参阅put into your release分支。因此,检查发布分支,然后重新设置brnch提交的基础:
hg update release
hg rebase --source commit1 --collapse --keep --dest . --message "bla bla something fixed"或者,您可以给出一个修订范围。如果你希望看到的提交在brnch分支中是非线性的,那么你将需要求助于移植(这是精挑细选的单个提交)--你可以在你的release分支中随后折叠(hg fold)所有移植的变更集,前提是你最初将它们保持在阶段草案中。
https://stackoverflow.com/questions/46691291
复制相似问题