I just started using hg Mercurial repository and stuck in a situation with multiple HEADS. I in the past pushed my code to repository as well but its missing from current code as well. It seems to me every time some body else push his code, my default head count increments on my side but i don't see such behaviour on anybody else machine. Can any body help it out how can i get rid of these heads and don't lose my pushes?
Note: i'm using MAC OSX with eclipse mercurial plugin.
As far as I understand your problem right now, you are pushing to a repository and there are other guys using the same repository. Correct?
For me, it seems like that you aren't working on the latest commit, therefore multiple heads are created on your current branch. Note besides: there is some difference between heads and branches in Mercurial.
I can imagine something like this happens to you (assuming we are working on only one branch):
Your working copy:
so you're committing on
r6
, e.g. two commits7'
and8'
.Now your working copy looks like this:
But in the meanwhile the shared repository you're all pushing to / pulling from looks like this:
Now, if you're pushing to the shared repository, this happens:
And voila, now there are two different heads, called
8'
and10
.For the future, pulling first from the shared repository and updating on the latest commit will prevent you from this problem.
Now, as your question was how to resolve the multiple heads, there are different options, most easy for you is doing a simple merge.
Depending on if the heads are only locally (have a look at the phase of your heads / commits), you have more (maybe more elegant) options, e.g. rebasing.
In general, this is a good resource for getting started / deep with Mercurial.