Search code examples
svnfeature-branch

Subversion feature branch requires changes from another feature branch


I have two feature branches: featureA and featureB.

FeatureA is complete, but not merged into trunk because it's untested and we're not ready to test it yet.

I'm working on featureB, and have realised that a change implemented in featureA is required for me to continue.

What's the best approach? I think I have a couple of options:

Option 1

Merge featureA to featureB branch (or maybe just specific revisions if I'm careful to get all the ones I want), then revert all but the changes I need.

Option 2

Re-implement the changes in featureB (they're not too complex this time) and sort out the conflicts when featureA and featureB are merged into the same place.

Either way, the features will be merged into a release candidate branch ready for testing and deployment. Once that RC branch is confirmed as tested, it'll be merged into trunk in one go.


Solution

  • There's a third option:

    You can cherry-pick what you want to merge, and merge just that. Perform a merge from featureA to featureB, but only merge the revisions that you are interested in. Then optionally fix any remaining problems.

    In Eclipse e.g. this can be done quite conveniently, because the merge dialog will let you select which revision (or which range) you want to merge. Just repeat that for all the revision ranges you need.