Line ending translation extension

Martin Geisler mg at lazybytes.net
Fri Sep 11 14:42:16 CDT 2009


Paul Moore <p.f.moore at gmail.com> writes:

> 2009/9/11 Martin Geisler <mg at lazybytes.net>:
>>> No, internal format should always be the same (probably LF).
>>
>> I disagree -- I want a repository that looks normal even without
>> using the extension. That means that files which are specified as
>> CRLF format in .hgeol should be stored in CRLF format in the
>> repository.
>
> Ah, I see.
>
> How does that interact with changing .hgeol? Suppose I checked in
> a.txt without putting it in .hgeol (say, on Windows so my working file
> uses CRLF). Then I set .hgeols to "unix" for it and check in (note -
> no checkout or other edit, all I did was update .hgeols).
>
> By your description, "unix" means no conversion (already in LF format)
> and yet the file is NOT in LF format. So someone checks out the repo
> and gets CRLF. That doesn't sound like what they'd expect.

You're right -- we should also convert files upon checkout to match the
settings in .hgeol. So that means they will get a file in LF format.
Somewhat unusually, it will be reported as modified when they do 'hg
status', even though they just made a fresh clone.

It is modified because it's format in the repository (CRLF) doesn't
match the format it will get using the current filters (LF). They should
make a commit to bring things back in sync.

This suggests that we should watch for commits to .hgeol and convert
files (or warn/abort) at that point. That way a change in .hgeol and
subsequent commit will have everything in sync.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20090911/058019fe/attachment.pgp 


More information about the Mercurial-devel mailing list