Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 777
arberg Avatar asked Dec 21 '10 13:12

arberg


People also ask

How do you resolve tree conflict?

Other tree conflictsIf you want to keep the folder from the merge target, just mark the conflict as resolved. If you want to use the one in the merge source then you need to SVN delete the one in the target first and run the merge again. If you need anything more complicated then you have to resolve manually.

How do you mark conflict as resolved in svn?

To resolve a conflict do one of three things: Merge the conflicted text by hand (by examining and editing the conflict markers within the file). Copy one of the temporary files on top of the working file. Run svn revert FILENAME to throw away all of the local changes.

What does svn resolve do?

svn resolve — Resolve conflicts on working copy files or directories.

What causes svn conflicts?

Since 1.6 version SVN recognizes a new kind of conflict, known as a "tree conflict". Such conflicts manifest at the level of directory structure, rather than file content. Situations now flagged as conflicts include deletions of locally modified files, and incoming edits to locally deleted files.


1 Answers

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.

like image 163
slowdog Avatar answered Sep 17 '22 09:09

slowdog