如何将一些变更集移至Mercurial的新分支 [英] How to move some changeset to a new branch in mercurial

查看:59
本文介绍了如何将一些变更集移至Mercurial的新分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将变更集从一个分支移动到另一个分支.基本上,我目前有:

I want to move a changeset from one branch to another. Basically, I currently have:

A -> B -> C -> D # default branch

我想要:

A # default branch
 \-> B -> C -> D # some_new_branch

尚不存在some_new_branch的位置.我已经习惯了git,所以我猜想我有一种简单的水银"方式.

Where some_new_branch does not exist yet. I am used to git, so I guess there is a simple "mercurial" way I am missing.

推荐答案

一种方法是导出B,C,D的补丁.更新到A;分支;申请补丁:

One way is to export a patch for B,C,D; update to A; branch; apply patch:

hg export -o patch B C D
hg update A
hg branch branchname
hg import patch

要从默认分支中删除B,C,D,请使用mq扩展名的strip命令.

To remove B,C,D from the default branch, use the mq extension's strip command.

这篇关于如何将一些变更集移至Mercurial的新分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆