As far as I understand, the most common (and recommended) way to handle branching and merging in Subversion is:
- create a branch as a copy of trunk
- Do subversive development on the branch and regular development on the torso
- In doing so, regularly merge the branch changes โ branch to avoid too much discrepancy. With merge tracking (
svn:mergeinfo ), I can simply run svn merge ^/trunk , and SVN will automatically select all unrelated changes from the trunk. - Once the branch is completed, merge everything back (on trunk:
svn merge --reintegrate ^/branch/foo ), then drop the branch.
(described, for example, in the book SVN, chapter Main Merge ).
Now my problem is: although this works well for "feature branches", sometimes "release branches" are also needed, which are submit / release for submitting versions.
With release branches, in my experience, merging should happen in both directions:
- Bug fixes from the release branch should be merged into the trunk (branch โ trunk)
- but sometimes a bug fix from the trunk (or even a new feature) is considered critical for the release version (or update for the release) and therefore needs to be combined with trunk โ branch
I did not find anything solid in how SVN and svn:mergeinfo deal with this. Can I merge in both directions ("bidirectional merge") and still have svn track merged versions?
Are there any pitfalls? Anything special you need to pay attention to?
source share