reidLinden
reidLinden

Reputation: 4170

Incorrect "Can't rebase immutable changeset" error

Occasionally, when I do a pull with rebase, I get the following error:

abort: can't rebase immutable changeset fa044e766d1f
hint: see hg help phases for details

Funny thing is, that changeset that errors (and it is the same one every time) is very old, and is already public.

Here's a screenshot:https://db.tt/xHiOxm6R

It appears that I can just ignore the message (at least, so far, I've not gotten into any trouble by doing so), but obviously, I'd like to help Hg resolve this issue so that its not going to continue to be a hassle in the future.

Thanks.

Update

hg out does not list it. The clone is probably about 6 months old. Also, as far as I know, none of the other developers are experiencing this problem.

Upvotes: 3

Views: 3165

Answers (1)

icabod
icabod

Reputation: 7074

(note: I can't see the screenshot due to a strict firewall).

You mention that the error occurs every time on a changeset that "is very old, and is already public." This should give you a hint as to why you're getting the error.

Changesets in Mercurial have 3 possible phases:

 - public : changeset is visible on a public server
 - draft : changeset is not yet published
 - secret : changeset should not be pushed, pulled, or cloned

Changesets that are at draft and secret are considered to be mutable, that is you can change their history, modify them (perhaps change the author, for example), and so on.

Changesets that are at public are considered immutable, you "cannot" change anything about them when they are in this phase. The reason being, they have already been seen by the outside world, and so if you make any modifications, it could cause issues. The theory is that you can't remove a changeset that's public - if you tried to change it, you would simply create another changeset.

That said, you can force the phase of a changeset back to draft like so:

hg phase -d -f <changeset_id>

This would allow you to rebase, or modify the changeset in some other way.

However, this would not remove the original changeset in the "outside world"... that already exists, and will until the end of time itself. It would simply create a new one that does mostly the same thing.

So, if you did try to resolve the issue, you would likely just create a new issue in its place.

Caveat: as I can't see the screenshot from here, I may revise my answer later.

Update: A quick note - having seen the screenshot, that looks like a very old changeset, which makes me wonder just what you're trying to rebase. As Kindread mentions above, merging would be your best bet here.

Upvotes: 6

Related Questions