如果在其他分支上,为什么不能基于源变更集的祖先? [英] Why can't I rebase on to an ancestor of source changesets if on a different branch?

查看:66
本文介绍了如果在其他分支上,为什么不能基于源变更集的祖先?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道为什么无法使用以下模式.

I would like to know why the following pattern is not possible.

已经创建了一个本地要素分支(minor_feature-不打算与世界共享),我想以此为基础将工作重新构建到知名分支(稳定)的尖端.但是我发现,如果自从分支稳定以来没有进展稳定,那么rebase并没有发现任何要重新建立基础的东西.

Having created a local feature branch (minor_feature - not intended to be shared with the world) I would like to rebase the work on it on to the tip of a well known branch (stable). However I have discovered that rebase finds nothing to be rebased in the case where stable has not progressed since branching away from it.

我很欣赏这违反了以下规则:rebase的目的地不能是源的祖先,但无法弄清楚为什么在所示的简单情况下应禁止这样做.我也了解,除了分支机构之外,拓扑在重新定级期间实际上不会更改.但是,鉴于分支名称确实对拓扑结构很重要,因此这似乎只是一种特殊情况,因为稳定版没有进一步的修订.只需在马stable的顶部进行一次额外的修订(例如从其他地方拉入),我当然可以执行重新设置

I appreciate that this breaks the rule that the destination of rebase can not be an ancestor of the source but can't work out why this should be prohibited in the simple case shown. I also understand that, branches aside, the topology would not actually change during the rebase. But given that the branch names are indeed significant to the topology, it only seems to be a special case in that stable has no further revisions commited to it. With a single extra revision on the tip of stable (say pulled in from elsewhere) I can of course perform the rebase

o  branch:minor_feature
|  rev:4
|  changeset:746d8191aa5d
|
o  branch:minor_feature
|  rev:3
|  changeset:520f565ba7f2
|
@  branch:stable
|  rev:2
|  changeset:64e7c753c090
|
o  branch:stable
|  rev:1
|  changeset:3dc55a5c9971
|
o  branch:stable
   rev:0
   changeset:fbf1f426945c

$hg rebase -b minor_feature
nothing to rebase

- 谢谢 克里斯·高曼(Chris Gorman)

-- Thanks Chris Gorman

推荐答案

Rebase严格用于更改变更集的祖先.正如您所观察到的,您在这里没有改变血统.祖先计算中不包括分支.

Rebase is strictly for changing ancestry of changesets. As you've observed, you're not changing ancestry here. Branches aren't included in the ancestry computation.

我不确定您要完成的目标100%.如果要有效地删除分支,那么只要您没有推送,就可以使用MQ扩展.导入变更集,全部弹出.确保您已更新到稳定分支(默认情况下应为稳定分支),然后将其全部重新启动.

I'm not 100% sure what you're trying to accomplish. If it's to effectively remove the branch, then as long as you haven't pushed, you can likely use the MQ extension. Import the changesets, pop all. Ensure you're updated to the stable branch (which it should be by default), and push them all back on.

它们现在都应该在稳定分支上.

They should now all be on the stable branch.

这篇关于如果在其他分支上,为什么不能基于源变更集的祖先?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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