Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to merge back from branch to main and close branch in Mercurial

I've got a named branch (same repository) that was created in order to to spike something. I've now decided that I want to move all the changesets created in the branch back into the main (default) and then close the branch.

I've tried a number of different things, including what was outlined in this post (How to repeatedly merge branches in Mercurial) but I just can't get it working :(

Can anyone provide any pointers?

Thanks.

like image 896
Martin MacPherson Avatar asked Feb 06 '10 22:02

Martin MacPherson


2 Answers

Merge the feature branch into default

hg up default
hg merge feature-branch-name
hg ci -m 'merged feature-branch-name into default'

Close the branch you don't want to use anymore

hg up feature-branch-name
hg ci --close-branch -m 'close feature-branch-name branch'
hg up default

Note that the close command doesn't have any disruptive effects on the repository history

It flags your branch as closed so that it won't appear in hg branches and hg heads commands output

like image 103
catalin.costache Avatar answered Nov 03 '22 01:11

catalin.costache


I've managed to solve my problem using the link I mentioned in my question. The steps described in the link had actually merged my changes across however I didn't realise as I was looking in the TortoiseHg UI and couldn't see the changes there. When I performed hg outgoing via the command line it appears that the merge had worked correctly.

like image 32
Martin MacPherson Avatar answered Nov 03 '22 01:11

Martin MacPherson