EOL extension and patch.eol

Mark Hammond mhammond at skippinet.com.au
Tue Dec 8 23:01:37 CST 2009


On 9/12/2009 3:50 PM, Steve Borho wrote:
> This was done to allow hg import, export, and other commands that read
> or write stdin/stdout to work on Windows.  Long before we had even
> patch.eol, we had to make these file descriptors binary for patching
> to work at all.

Right - but as we are seeing, it is probably undesirable to assume \n 
line endings with things like patch and export.

IOW, I suspect this was added to help mask various symptoms of not 
having a decent EOL story - but once a decent story exists those masks 
should be redundant and probably hurt more than they help (ie, they are 
still refusing to acknowledge \r\n is native on Windows)

> By default Mercurial treats file contents as binary, and it expects
> stdout to follow suit.  Otherwise commands like hg cat would be
> utterly useless on Windows.

Only useless for binary files.  For the vast majority of files in a 
repo, using text mode for 'hg cat' seems entirely appropriate - you get 
native line endings.  Binary files are a special case so could be 
treated as such (eg, an option to 'hg cat' which indicates you want a 
'raw' dump instead of treating it as text...)

Cheers,

Mark


More information about the Mercurial-devel mailing list