EOLExtension - Renaming of the "only-consistent" property

Martin Geisler mg at aragost.com
Fri Dec 10 08:11:33 CST 2010

Svante Schubert <Svante.Schubert at oracle.com> writes:

> Hi,
> Martin and I had a short off-list discussion about the EOF extension
> variable "only-consistent", that he asked me to bring to the list.
> It started when I pointed out that I felt the naming of the variable
> "only-consistent" explained by
> http://mercurial.selenic.com/wiki/EolExtension
> seems quite improvable to me.
> In the following our conversation after my objection (shortened)
>         Martin answered:
> I think the documentation is correct, but perhaps the name is
> unfortunate... the code does this:
> def tocrlf(s, params, ui, **kwargs):
>     """Filter to convert to CRLF EOLs."""
>     if util.binary(s):
>         return s
>     if ui.configbool('eol', 'only-consistent', True) and inconsistenteol(s):
>         return s
>     return eolre.sub('\r\n', s)
> meaning that
> - if the file is binary, then we do not touch it,
> - if eol.only-consistent is enabled *and* the file is inconsistent, then
>   we do not touch it,
> - otherwise we replace EOLs.
>>>       It would be great if you could suggest a better help text.
>>    Very well, let me first repeat what you told me, to see if I
>>    understood your code snippet and explanation:
>>    In general the line endings of all repository files are being
>>    converted, unless a file is binary or the file uses inconsistent
>>    line endings. The user can force the conversion of files with
>>    mixed line endings by setting a variable XY.
>>    What I found odd was that the setting of the property to force the
>>    conversion of inconsistent files, to have only consistent files in
>>    the repository is "only-consistent=false".
>>    The riddles solutions: You were looking from the
>>    "what-has-to-be-converted" perspective, but as the other EOF
>>    properties in the vicinity are about the repository, I was looking
>>    from the repository perspective. And from the repository
>>    perspective "only-consistent" means quite the opposite ;)
>>    Therefore I suggest to keep this property internally, but drop it
>>    in the documentation and exchange it by
>>    "convert-mixed-endings=true" Does it makes sense to you?
> He agreed on a deprecation of the old name if the developer on the
> list would agree upon it.

I just looked at this mail again and a couple of other names came to
mind about the names 'convert-inconsistent-files' or

Martin Geisler

aragost Trifork
Professional Mercurial support

More information about the Mercurial-devel mailing list