Mercurial & Text mode in Asset Serialization = Problem

I use Mercurial in my project and we just switched to “force text” in the Asset Serialization option.

My files are text now, but when I try to merge, I get this “tool opendiff can’t handle binary” message. I tried to force FileMerge to merge and it marks the whole file as different.

I tried to switch to DiffMerge and force it to merge, and it tells an important info:
“File has a NUL byte at offset 0; this is not valid for encoding…”

The ‘file’ bash command tells me that those asset files are “text/plain; charset=us-ascii”.

Isn’t that a bug? I mean, Unity should convert to text files that merge tools are able to merge…

By the way, we are using Mac OSX.

  1. Your merging tool sucks (or your config for those tools is incorrect). It works fine with regular diff and diffmerge.
  2. Or you are trying to compare (diff) or merge your current file (in text mode) with the one on the repository (in binary mode). Since one of the file is still binary, this cannot work.

Don’t try to convert the project in more than one repository and after merge them.

Somehow it worked when I converted the project on one repo and distributed it to others, that is, no problem in future merges.

The downside is that everybody has to get to the same revision, stop to work and wait for the conversion.