If we discover bug in some branche we fix it (check New release on picture). But also we interesting in moving this fix to Old release and Main development branch:
a-->b-->c (Old release) | A-->B-->C-->D (Main release) | 1-->2-->bugfix-->4 (New release)
svn remember in svn:merge properties (from svn 1.6, 2009) which revision merged to which branches. So next time if you merge region of revisions previously merged revisions was skipped from merge patch.
How deal with modern DVCS?
I need make plain patch and apply it to each branches or there are exist some help from DVCS?
Note: I can not just merge New branche to Main as previous changesets move also to Main branche.
Rebase also not possible as New release come to many developers.
I interesting in answer for named braches schema and for multirepository schema.
PS. Andy suggest find common parent to all branches for which bug have affect, update to it, apply fix to the bug and move fix to affected branches.
By updating to old changeset and making changes you create new branch. I recommend create named branch (name it as bugID), so later you can easy back to it.
There are problem on finding common parent to all branches in which we have interest to fix bug.
First solution (that suggest Andy) is using $ hg/git/bzr blame and carefully check output for all affected files. This involve first fix bug on some newest changeset before you find with blame what changeset introduce a bug. Then you need rebase fix (patch) to common parent changeset.
Another solution is using $ hg/git/bzr bisect (you can also manually perform updates to find first revision in which bug introduced). This can be expansive but more true solution as allow populate bugfix to any branches in which bug present.
I think it is better first find first BAD changeset and then fix a bug, instead of first fix a bug and then find first BAD changeset (except case when you already know how fix bug). Also having a diff that introduce can help in understanding why it occur.
PPS. With bugs it is clear which branch effected to allow merge changes to any effected branch.
Interesting question come if ask how backport feature from development branch to release branch. As you can see you must commit feature changesets starting with changeset that before release branch. But when you develop feature you can don't know where you need backport feature. With svn:merge VCS remember for you all backports. How about DVCS?
You could:
Find common parent. Thanks to Novelocrat for this step.git merge-base branch1 branch2 branch3 ...
Checkout the common parentgit checkout A
create new branch to fix bugs ongit checkout -b bugFix
Make bug fixes and commit them to bugFix branch
Checkout branch that needs the bug fixgit checkout branchToApplyFixTo
Merge the bugFix into the branchgit merge bugFix
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With