After pushing to a review repository, “abort: can't rebase immutable changeset” on rebase

孤街浪徒 提交于 2019-11-28 06:22:30
nmichaels

In the review repository's .hg/hgrc file, add these lines:

[phases]
publish = False

The problem is due to a new feature in mercurial 2.1 called phases. It's great. Here is a nice introduction to its use.

To make the changesets in question mutable right now, use hg phase -f -d REV to force REV to be mutable again. Once the hgrc file has been changed, you shouldn't have to do that any more.

As a side note, hg push -f is lame. Make an alias hg review that pushes with -f to that repository.

I don't think disabling phase support on the server is the correct solution, but your problem sounds weird.

Pull --rebase should rebase your local changes, on top of the remote changes, which should be allowed, even if phases are supported by the client, as long as these changes have not been seen by anyone else, eg. they haven't been pushed out anywhere.

Is it possible that you have already pushed your your own changes, to somewhere else (which set them to public phase), and after that tried pulling from the testing repo? Because then, this is the correct behaviour that you are seeing.

Most of the time it is a bad idea to mess with phases manually (with hg phase -f), because it can easily lead to a history rewrite, which can lead to duplicated changesets, or various errors when other people try to pull/push. If a changeset became marked as public (as in your case), it probably happened for a good reason.

I've encountered such behaviour with collapsed rebase. Phasing out back to draft hadn't helped me. So I've just pulled up (hg pull -u) to sync with remote repo, then just grafted the problem commit (hg graft <problem_commit>) and then amended this very new commit.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!