mercurialdiffbinary-diff

I can't find the code for diff binary in mercurial source code


I am reading source code of mercurial,but what I saw in bdiff.c and mdiff.py is processing text, not binary.but they said mercurial treat all files as binary.I am confused.


Solution

  • bdiff.c and mdiff.py both works perfectly fine on binary files. They won't give you optimal diffs since they rely on the presence of newlines, but they work correctly (you won't lose any data).