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
Mercurial,变更集的变更分支_Mercurial_Branch - Fatal编程技术网

Mercurial,变更集的变更分支

Mercurial,变更集的变更分支,mercurial,branch,Mercurial,Branch,我的Mercurial存储库中有两个分支。”默认值'和'其他' 默认值分支A-B-C-D 其他分支机构E-F 我需要将B变更集移动到其他分支。 所以它看起来是这样的: 默认值分支A-C-D 其他分支机构E-F-B 可能吗 提前谢谢 基于嫁接的解决方案 移植(hg-help-Graft)B到目标分支 从源分支中删除(历史扩展)B(仅复制变更集,不删除原始变更集) 基于再基础的解决方案 将B重设为其他分支 因为rebase也会将rebase变更集的后代移动到-rebase C回到default

我的Mercurial存储库中有两个分支。”默认值'和'其他'

默认值分支A-B-C-D

其他分支机构E-F

我需要将B变更集移动到其他分支。 所以它看起来是这样的:

默认值分支A-C-D

其他分支机构E-F-B

可能吗


提前谢谢

基于嫁接的解决方案

  • 移植(
    hg-help-Graft
    )B到目标分支
  • 从源分支中删除(历史扩展)B(仅复制变更集,不删除原始变更集)
基于再基础的解决方案

  • 将B重设为
    其他
    分支
  • 因为rebase也会将rebase变更集的后代移动到-rebase C回到
    default

    • 以下解决方案不需要启用任何扩展。不过,它确实假设存在
      补丁
      实用程序

      在默认设置上:

      $ hg diff -c B > diff.out
      $ hg backout --merge -r B
      $ hg merge
      $ hg ci
      
      在其他分支上:

      $ patch -p1 < diff.out
      $ hg ci
      
      $patch-p1
      非常感谢您提供的解决方案,我仍然收到这样的消息“中止”:在您的解决方案中没有要合并的内容(改为使用“hg update”)。但我知道如何修复它。这是我真正需要的对你来说,更好的(更自然的方式和稍微更Mercurial的方式)将是
      hg导出
      +
      hg导入
      。顺便说一句,在不剥离原件的情况下,您复制了变更集,而不是移动