i have these two named branches in my repo. Stable and dev. My question is how do i copy a bugfix patch that was changed in stable to the dev branch? i would really like to do this within the framework and not with any extension 🙂
EDIT
I set a bounty for the question because i really wanted the solution. There was a nice solution but was left mid way. So i had no other option. It now appears to have been answered. But i will let the question fair another day, just in case someone has a better solution. Hope that makes sense. 🙂
To augment Tim’s answer, a different way to approach it is how the Mercurial recommend you do it if you can, plan ahead (I’ll see if I can rustle up a link.)
The plan goes that if you know that a bugfix/change has to go into several branches, you don’t commit that changeset into one of those places to begin with, you do it somewhere else.
Since you’re fixing a bug, somewhere in the history of the project, that bug was introduced.
And since the bugfix needs to go into more than one branch, that “somewhere” has to be before the point where you branched, otherwise the bug wouldn’t be in both (/all) branches.
So, the recommended way is to fix the bug where it was introduced, and then merge that changeset into each of the branches that needs it.
Let’s look at an example, we have
defaultandstablebranches:Then you discover that changeset 2 introduced a bug, and the bugfix needs to be applied to both
defaultandstable. The way you describe it in the question, it looks like you would do this:But this would merge changeset 13 into
defaultas well. If you don’t want that to happen, you would instead do this:For more information on how to use Mercurial in bugfixing-scenarios, the 9th Chapter of ‘Mercurial: The Definitive Guide’ is well worth the read.