Reputation: 3611
Im reading Mercurial, the definitive guide, and it mentions that in large projects, its useful to have your project split up into feature branches. Ive drawn a quick picture of what i think is happening when you want to merge the Feature Branch with the Master Branch.
Is my diagram correct + does the Feature Branch continue to exist? Im assuming yes.
Upvotes: 1
Views: 506
Reputation: 64467
The active named branch can be explicitly closed using:
hg commit --close-branch
This tends to be done if a line of work was not going anywhere. If you want to re-open a branch of the same name on top of a closed branch, you need to force that branch open again using:
hg branch <name> --force
However, they implicitly become inactive if you merge from your feature branch into another branch and the feature branch has no un-merged change-sets (as in, the last thing on that branch is the merge into another branch). The destination of this merge does not have to be the "mainline" in order to deactivate the branch, inactivity is purely based on any un-merged change-sets.
They become active again if you subsequently create change-sets on them at a later date. This tends to be the common situation, if you are working on features off-mainline and merging in frequently.
Do note that a closed branch is not the same as an inactive branch.
I'm sorry, but I couldn't really understand your diagram so I hope the above sentences make sense.
Also, do not confuse named branches with anonymous branches, which are when a single branch has multiple "heads".
Upvotes: 3