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

1

11

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.

Inquisitionist answered 21/12, 2010 at 13:11 Comment(1)
What version of Subversion is your repository and what is support version of Subversion that your client is providing? i.e. 1.5.x, 1.6.x?Outmarch
W
15

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.

Weinhardt answered 17/7, 2011 at 23:9 Comment(2)
That may be the right answer, but I can't in good conscience upvote it. It's not your fault... it's SVN's!Astonishment
It is indeed ugly, but it appears the way of SVN. Thanks for pointing it out to me.Inquisitionist

© 2022 - 2024 — McMap. All rights reserved.