Mercurial execution of binary comparison for specific file types

Possible duplicate:
Why does Mercurial consider my SQL files to be binaries?

I recently started using Mercurial, and when I returned one of my .SQL files, Mercurial did a binary comparison. This clearly limits the visibility of the changes made, since there is no difference.

Is it possible to set file types for string comparison?

I am using Tortioise Hg 0.8.1 with Mercurial 1.3.1.

+2


source to share


3 answers


Mercurial does not actually handle text and binaries very differently relative to real storage. However, he tries to guess "would visually demonstrate that this diff makes sense" when asked to show the difference to the user with "hg diff", "hg log -p", or when viewing a set of changes in the web interface. When it tries to make the message โ€œshould I show this as if itโ€™s textโ€, the test applied is โ€œIs there a NUL byte (0x00) in the first 1000 bytes of the file.

This way your file is not processed any differently other than being displayed in the user output, but if you can find NUL bytes in there, you can probably stop that too.



Alternatively, the extdiff extension can be used for complete control over how differences are displayed.

+7


source


I do not know about the graphic part of TortoiseHg, but if you use the command line, the flag --text

on hg diff

should do the trick: it makes Mercurial process all files as text.



+2


source


You should try adding these lines to ~/.hgrc

:

[diff]
git=1

      

The git diff format works for binaries.

0


source