Search code examples
svnmergetree-conflict

Avoiding tree conflicts when merging structural changes


I have made a branch to do some cleanup and structural changes on a website. The contents of trunk were simply the website files, like so (abbreviated for brevity):

/trunk/css/
/trunk/images/
/trunk/js/
/trunk/index.html

After branching, I moved the contents down one level and created another directory for non-website content (mostly PSD files) that I nonetheless need to keep and work with. The structure is now:

/branches/cleanup/www/css/
/branches/cleanup/www/images/
/branches/cleanup/www/js/
/branches/cleanup/www/index.html
/branches/cleanup/support/psd/

How do I cleanly merge this back into the trunk without a ton of tree conflicts? I'm sure I've done this before. Problem is, I can't for the life of me remember how.

I made a number of trunk changes since the branch was created, so I am flooded with tree conflicts.

I'm happy to accept a less-than-ideal solution at this point, so my backup plan is to forget merging and instead perform an svn move on the trunk to something like /branches/old-trunk/, then svn move the cleanup branch into /trunk/ and go from there.

Will there be any nasty side-effects of doing this, besides having to manually apply the trunk changes to the cleanup branch?


Solution

  • If there were no changes to the files in trunk, you will not get any conflicts.

    If you changed any of the files inside trunk, that were also moved within the branch, there is no way to resolve this within Subversion without getting tree conflicts.

    Update

    If you move your branch to use it as the new trunk, it will break the automatic merge resolution for any other branches you might have. Other than that, there should be no issues with this move, since trunk is in no way "special" or different from any other directory when svn is concerned.