2

I have a situation where I have few classes in way too many places. I'd like to have them in one directory to avoid unnecessary file hunting. There's trunk (where all the actual development is being made), and several branches with same files and numerous little customizations.

Using svn move in the trunk and then merging that revision to all the branches will probably obliterate all the customizations, since it's basically just delete and add, so I thought that what if I ran same svn move commands in the trunk and all the branches, and never merged that particular revision from trunk to any of the aforementioned branches?

The problem is, I have absolutely no idea if merging from trunk to branches will work after that if I have to make changes to those files. Do I have a huge disaster in my hands (I have experienced all the horrors and generaly dickery regarding Subversion and moving/renaming files), or does SVN play nicely for once?

Edit: we're using Subversion 1.6.15

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

2 Answers2

1

I have absolutely no idea if merging from trunk to branches will work after that if I have to make changes to those files

Will not. Merge edited at one side and moved at other is guaranteed method of becoming a victim of "Refactoring Hell" and get Tree Conflicts, even in SVN 1.8+. For 1.6+ situation is more worse and uglier in common

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
0

It won't work - you'll probably end up with the 'evil twin' issue if you have 2 files added in 2 branches, but with the same name when you come to merge. If you mark the revision as merged and the file exists on trunk you should be ok though. Have a look at this question.

However, a possibly better way would be to merge in the changes to trunk (I assume that happens eventually) edit, and then branch off the trunk that contains the refactored directories to continue the changes to these files.

And upgrade, 1.8 is a bit better with tree conflicts, particularly with support for merging into moved files - in 1.6 it could resolve it correctly, and sometimes not, so 1.7 made it flag a conflict every time.

Community
  • 1
  • 1
gbjbaanb
  • 51,617
  • 12
  • 104
  • 148