Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reintegrate to the branch (not the trunk) in Subversion (SVN)

I know there is the --reintegrate option in Subversion (SVN) 1.6 to merge a feature branch back to the trunk.

My workflow is a little more complex:

We have feature branches - we merge trunk to them often. But we don't put them back to trunk right away. Instead we create a release branch off the trunk, and merge feature branches to release branch. At this point we get a lot of tree conflicts (since lot of changes exist both in feature branch and the trunk).

Option --reintegrate must help in this scenario, but it looks like --reintegrate doesn't work when merging to the branch other than trunk. Is that true?

like image 396
tevch Avatar asked Oct 10 '22 01:10

tevch


1 Answers

It's news to me that you can't use the --reintegrate option on any branch besides trunk. Subversion doesn't have any standard on naming or the placement of branches, so there's no way that trunk is special. To Subversion, branches, trunk, and tags are mere directories. These directories are only special to us because we said so.

The --reintegrate option has to do with the fact that if I merge from branch A to branch B, and then try to merge back from branch B to branch A, I might be attempting to merge stuff back to branch A that was initially in branch A. The --reintegrate option lets Subversion know that I am reversing the direction of my merge, and to not consider stuff in branch B that was really the result of merging from branch A.

Reintegration is an issue in any version control system that actually tracks merged changes. In any case, there's no reason why --reintegrate must involve a branch called trunk. Otherwise, there's no real need for the option. All Subversion has to do is see you're merging into a branch called trunk and realize it's probably a reintegration.

like image 61
David W. Avatar answered Oct 14 '22 01:10

David W.