Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you force Mercurial (hg) to treat a file as binary?

I have a LaTeX hg repository for a paper and I use hg serve to display the progress to my coauthors. Until last week the file paper.pdf was treated as binary and its contents were not displayed in the changesets. (The users could download it via the raw link)

Since last week, paper.pdf is treated as text and I see huge diffs of PDF code in my changesets...

Is there a way to tell the repository to treat this file as binary instead of "guessing" ?

On my server (where hg serve runs):
hg --version --> Mercurial Distributed SCM (version 1.0.1)
on my laptop:
hg --version --> Mercurial Distributed SCM (version 1.3.1)

like image 373
ivan Avatar asked Nov 06 '22 09:11

ivan


1 Answers

You can't override the heuristic (which is quite simple, it just checks for the presence of a NUL byte in the data).

I guess the generated PDF isn't compressed which means it is just plain text, and it doesn't contain any NUL byte.

But why is it important for you to have it as binary?

like image 156
tonfa Avatar answered Nov 09 '22 09:11

tonfa