Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What can cause SVN Update to merge incorrectly?

I got an email a few days ago from someone who was having trouble building a Delphi project I have on Google Code. The project file and one of the DFM files were munged after he updated with some changes I had checked in. We talked back and forth a bit, and traced it down to what he said was SVN throwing in extra stuff. He deleted the files and ran Update again and it worked fine.

I've never seen this problem before, and I wasn't able to reproduce or verify any of it at my end. There weren't any update conflicts with other users, since I'm the only one with write access to the repository. So I'm wondering what could have caused this. Is this a known issue for SVN? Is there a way to keep it from happening?

like image 361
Mason Wheeler Avatar asked Dec 18 '25 00:12

Mason Wheeler


1 Answers

If the DFM file was treated by Subversion as text, assuming the user had local changes, it will attempt a merge. Where there are conflicts and Subversion can't resolve them, it will add extra detail to help you manually resolve the conflicts, you will see text like <<<<<<< .mine which of course will bork in Delphi. It could also be that Subversion did a merge automatically, which didn't conflict, but lead to a corrupt DFM file.

The reason why you didn't see the problem was probably because you didn't have local changes, so no merge was necessary. Deleting or reverting the files resets the working copy back to BASE so any update won't need to do a merge.

One solution: If you have text files which should not be merged by Subversion, then set the svn:mime-type to an appropriate non-text value, and it will treat it as binary, and won't attempt a merge. You will be required to manually fix the problem. Incidentally, this is also a good tip if you need to store sensitive text files in Subversion and don't want diffs showing the content :)

like image 165
si618 Avatar answered Dec 19 '25 15:12

si618



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!