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?
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.
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.
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With