How to remove multiple heads in mercury
2 answers
I don't think you really want to remove the heads. If you do this, you will lose the work that was done on those branches.
You probably want to merge the heads back into one branch.
Say you have a tree:
o 4 : Head 1
|
o 3 : Another commit
|
| o 2 : Head 2
| |
|/
o 1 : A commit
|
o 0 : Initial commit
To get rid of the extra head without losing the work contained within it, you combine the two heads (versions 2 and 4 in this example) like this:
hg update 4
hg merge 2
hg commit -m "Merge"
This will create another commit that has all the changes in versions 2, 3 and 4 in one head like this:
o 5: Merge
|\
o | 4 : Head 1
| |
o | 3 : Another commit
| |
| o 2 : Head 2
| |
|/
o 1 : A commit
|
o 0 : Initial commit
This is a standard procedure when several developers work in the same repository.
+5
source to share