TortoiseMerge indicates entire file as conflicted, then attempts to delete file

457 Views Asked by At

Usually, when I encounter merge conflicts in SVN upon updating my working copy, the lines or blocks that are conflicted are highlighted in TortoiseMerge. I can then choose to use "theirs" or "mine", or both in some way. In any case, I can see at one glance in an intuitive way where the problem lies.

On a regular basis, however, this is not the case. TortoiseMerge will just kind of mark the entire file as conflicted. Judging from the icons, it appears to be telling me that "they" removed the entire contents of the file and added new contents:

TortoiseMerge screenshot

When I look at the individual diffs of the few commits that have happened since I got my working copy1, only a few lines have changed. Likewise, I have only changed a very limited number of lines in my working copy. Therefore, it seems it cannot be an EOL problem (or else, at least one of the commits should highlight the entire file as changed, shouldn't it?).

Furthermore, it is not the version incompatibility between 1.4 and 1.5; I seem to be using client version 1.9.6 and server version 1.8.16. Of course, there may be another incompatibility between that pair of versions that I am not aware of.

Update: Furthermore, when I select "Use this whole file" in the mine version and then save the result, TortoiseMerge claims the "File is Empty" and offers to remove it.

What is TortoiseMerge trying to tell me with that view, and how can I conveniently resolve the conflict in a file with 1000 or more lines when that happens? Why would it claim that the file is empty when I am trying to use the version from my working copy (and indeed purge its content!)?


1: In fact, in the case that I am currently facing, there has been exactly one commit. It has modified line 3 and some lines between lines 74 and 120. Meanwhile, in my working copy, I had inserted new lines after line 150.

1

There are 1 best solutions below

2
On
  • Theirs has UTF8 BOM encoding with CRLF EOL.
  • Mine has ASCII encoding with AEOL EOL.

I expect that there is an issue with encoding and EOLs. BTW, it makes sense to add svn:eol-style=native property on your files.

You can also try to enable Ignore line endings option in TortoiseMerge settings and see the result. However, I would recommend to keep this option disabled.