Search code examples
svnmergetree-conflict

SVN: How to resolve evil twins tree conflict by accepting incoming add (removing local add)


In SVN I have a tree conflict upon merging two branches. The tree conflict arises because I have added a the same file or the same directory in both branches. Much the same question is asked here:

Other Stackoverflow Question on evil twins tree-conflict

However I need to accept the incoming add. Subversion will only allow me to accept the working state of the repository. So I would expect I can do the merge from B1 to B2, delete locally added file in B2, tell svn to add (remerge?) the file from B1 into B2, and then commit the merge. Is it possible to resolve an evil twin conflict to the incoming version?

The point here is to accept the incoming version so that when merging the next time from B1 to B2 I will get the changes merged automatically, without having to ever do the opposite B2->B1 merge.


Solution

  • I would resolve the add-add conflict manually like so:

    svn rm twin
    svn cp ^/branches/B1/twin .
    svn resolve --accept working twin
    

    The result is a nice clean history, showing B2/twin replaced by a copy of B1/twin.