aaaakkkkk
aaaakkkkk

Reputation: 80

Multiple heads in mercurial with different changesets

I have an issue with mercurial and multiple heads, which I believe has not been answered before due to my mercurial set up :)

I have a local copy of a repository (local/repo/) which is where I work. Once I have made the desired commits, I push to an "interim" repository (interim/repo), also on my machine. It is from the interim repo that I then push to/pull from the shared repository.

The issue is that I pushed from the local to the interim repo, then pulled and updated changes from the shared repository in both the interim and local repositories, and merged as requested.

I am now unable to push from either repo. Pushing from the local repo results in an abort because it would create a new remote head (ABC), whilst pushing from the interim repo results in an abort for the same reason but for a different changeset (XYZ).

I am not sure how to proceed! I had tried to run hg backout on commits made in my local repo, but I fear that this may have contributed to, not alleviated, the issue.

Upvotes: 3

Views: 97

Answers (1)

StayOnTarget
StayOnTarget

Reputation: 13008

I think you should discard the changes you made directly to interim. Then you can resume your normal workflow and propagate changes local → interim → shared.

The most direct way to clean up interim is to use hg strip. Be careful with that command since it can be considered destructive (although it should produce a backup file).


backout doesn't do what you want because even though it restores the latest file state to what it had been, it still leaves (and in fact creates) changesets you have to deal with.

Upvotes: 1

Related Questions