Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mercurial 为分支中的所有更改创建差异修补程序?_Mercurial_Branch - Fatal编程技术网

Mercurial 为分支中的所有更改创建差异修补程序?

Mercurial 为分支中的所有更改创建差异修补程序?,mercurial,branch,Mercurial,Branch,我从default创建了一些分支(称之为brnch),并在那里进行了一些提交。现在需要仔细挑选从分支到某个发布分支的所有差异,以进行热修复。在mercurial中可能有这样的事情吗 ^ ^ | |<--- brnch | - commit3 | | | - commit2 - | | | | - commit1 - | | | | | |-- | - d

我从
default
创建了一些分支(称之为
brnch
),并在那里进行了一些提交。现在需要仔细挑选从分支到某个发布分支的所有差异,以进行热修复。在mercurial中可能有这样的事情吗

    ^  ^ 
    |  |<--- brnch
    |  - commit3
    |  |
    |  - commit2
    -  |
    |  |
    |  - commit1
    -  |
    |  |
    |  |
    |--
    |
    -
 default
^

||请参见
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.
hg导出分支(brnch)-o brnch.patch#导出brnch上的所有内容
hg export-r commit1-r commit2-o cherrypick.patch#cherrypick两个变更集
汞更新
hg import brnch.patch#在补丁中导入修订
hg import——不提交brnch.patch#导入(但不提交)修订。
hg commit-m hotfix#将更改提交为一个带有“hotfix”描述的提交。

请参见
hg帮助导出
hg帮助导入

示例:

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.
hg导出分支(brnch)-o brnch.patch#导出brnch上的所有内容
hg export-r commit1-r commit2-o cherrypick.patch#cherrypick两个变更集
汞更新
hg import brnch.patch#在补丁中导入修订
hg import——不提交brnch.patch#导入(但不提交)修订。
hg commit-m hotfix#将更改提交为一个带有“hotfix”描述的提交。

您可以通过
hg rebase
简单地实现这一点

为了简单起见,我假设您希望在brnch see中看到从commit1开始的所有内容,并将其放入发布分支中。因此,签出发布分支,然后重新确定brnch提交的基础:


或者,您可以给出修订范围。如果您希望看到折叠的提交在brnch分支中是非线性的,那么您将需要求助于嫁接(这是一个单独的提交),并且您可以在发布分支中折叠(
hg fold
)所有嫁接的变更集,如果您最初将它们保持在阶段草稿中。

您可以通过
hg-rebase
简单地实现这一点

为了简单起见,我假设您希望在brnch see中看到从commit1开始的所有内容,并将其放入发布分支中。因此,签出发布分支,然后重新确定brnch提交的基础:

或者,您可以给出修订范围。如果您希望看到折叠的提交在brnch分支中是非线性的,那么您将需要求助于嫁接(这是一个单独的提交),并且您可以在发布分支中折叠(
hg fold
)所有嫁接的变更集,前提是您最初将它们保持在阶段草稿中