Omar
Omar

Reputation: 40162

Handling the hotfix branch in Mercurial

Our current branching strategy is using three branches: default, release, hotfix.

hotfix is branched off release and then, following QA/testing, merged back into release, then into default.

When the next release is completed and another hotfix needs to be created, should we update the hotfix branch with the latest code or just force create a new hotfix branch from the latest release branch?

My instinct is to recreate the branch to be more explicit in when and why the branch was recreated. However, I'm not sure if there are any drawbacks to recreating the branch.

Upvotes: 3

Views: 573

Answers (1)

Aaron Jensen
Aaron Jensen

Reputation: 26719

You could give each release/hotfix branch its own name, e.g. v1.0.0 and v1.0.0-hotfix. At the time of the next release, you could close the old release/hotfix branches.

You could also create hotfix-specific branches on an as-needed basis. When you identify a new hotfix, give it a name and/or identifier, create a branch for it (e.g. hotfix-v1.0.0-001) and make the hotfix. Once it is accepted, merge it into release and close it.

Or, if you want to keep your current release/hotfix naming scheme, when you release a new product, merge default into release then release into hotfix. Because you've been merging them down into default, you shouldn't get any merge conflicts. If you do, you know to always take the side from default.

Upvotes: 3

Related Questions