Mercurial 中的快进分支
由于某种原因,我遇到以下情况:
现在我想摆脱 default_2 并快进
default
到 rev 89。但是当我这样做时
hg up -r default
hg transplant 61:89
,
hg transplant -b default_2
Mercurial (1.8.2+20110401) 只是将我的工作副本更新到 rev 89。使用 mq
扩展看起来我必须一一指定所有中间修订。
所以问题是:
- 为什么
移植
不起作用? (这里推荐:https://www.mercurial-scm.org/wiki/RebaseProject #When_rebase_is_not_allowed) - 有没有一种方法可以快进而不会带来太多痛苦?
For some reason, I have following situation:
Now I want to get rid of default_2
and fast-forward default
to rev 89. But when I do
hg up -r default
hg transplant 61:89
or
hg transplant -b default_2
Mercurial (1.8.2+20110401) just updates my working copy to rev 89. With mq
extension it looks like I have to specify all intermediate revisions one-by-one.
So the questions are:
- Why doesn’t
transplant
work? (It’s recommended here: https://www.mercurial-scm.org/wiki/RebaseProject#When_rebase_is_not_allowed) - Is there a way to fast-forward without much pain?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 Mercurial 队列,您可以:
注意: 这假设修订版 61:89 尚未推送到公共存储库。给定的 mq 命令将修改历史记录。如果这些修订已经推送,那么最好简单地关闭
default2
分支,然后将default2
合并到default
中。Using Mercurial Queues, you can:
NOTE: This assumes that revisions 61:89 have not been pushed to a public repo. The given
mq
commands will modify history. If these revisions have already been pushed, then it would be best to simply close thedefault2
branch and then mergedefault2
intodefault
.尝试:
它重新创建名为default的新分支
try:
it recreate new branch named default
从 Mercurial 2.0 开始,您可以使用 graft 命令(内置命令很大程度上取代了 transplant 扩展):
另请参阅 移植物和移植之间的差异。
请注意,Mercurial 不支持命名分支之间的 Git 实际快进的原因是分支名称是 Mercurial 提交对象的一部分。另请参阅此 详细介绍 Mercurial 分支模型的文章。
As of Mercurial 2.0 you can use the graft command (built-in command largely replacing the transplant extension):
See also a related question on differences between graft and transplant.
Note that the reason Mercurial doesn't support actual fast-forwards a la Git between named branches is that the branch name is part of the Mercurial commit object. See also this article detailing the Mercurial branch model.