Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to accept 'theirs-conflict' to resolve tree conflict: Local add, incoming add upon merge

Tags:

I have come across the following basic Tree conflict: Local add, incoming add upon merge.

I know we can use svn resolve --accept working file to resolve it, but SVN prevent me to use accept their-conflict to accept the incoming version.

Can anyone tell me how to replace my local file by the incoming one? Is it possible using svn resolved file in any way?

like image 237
Elie Xu Avatar asked Feb 10 '12 06:02

Elie Xu


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.

What is SVN tree conflict?

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

The right thing to do is detect this problem in a previous --dry-run and delete the local conflicting dir with svn delete before doing the merge.

First scenario: Working copy with the merge already done. Solution: Delete the working copy, checkout a clean copy and do the right thing.

Second scenario: Already commited wrong directory, after svn resolve --accept=working.

You must svn delete the conflicting directory, and rerun the merge from the parent directory of the conflicting directory ignoring mergeinfo. Revert every object except the previous conflicting directory (now there isn't conflict). Check and commit the changes.

Ex. Working copy un WC folder. Your conflict in A/conflictDir directory:

cd A svn delete conflictDir svn merge --ignore-ancestry -rbeginRev:endRev <URLrepo/A> svn -R revert `ls | grep -v conflictDir` <... check ...> svn ci -m "conflictDir fixed" 
like image 177
Diego Fernández Durán Avatar answered Sep 20 '22 10:09

Diego Fernández Durán