Morten Lyhr
Morten Lyhr

Reputation: 679

Mercurial: How to make per version branching

I need to make a point in time branch, when we release a new version.

So i have Default branch for all development, and V1, V2 etc. branch for every time a new release is made to a server.

So if I have default development branch. V1 is at the Live server. V2 is at the Test server.

How do I handle the following scenarios:

Upvotes: 1

Views: 99

Answers (1)

Laurens Holst
Laurens Holst

Reputation: 21026

The usual method is to locate the changeset that introduced the bug (before the branching point of V1), and commit the fix as a child of that changeset. This will introduce a new head, which you can then merge into the branches where you want the fix, in this case V1, V2 and default.

This method is called “daggy fixes”.

Alternatively you can also fix it on one branch (say, default) and then cherry-pick it onto the other branches using the graft command. But that isn’t as nice, as the changeset will appear three times and could potentially cause merge problems if you ever merge two of those branches together again.

Upvotes: 5

Related Questions