EOLExtension - Renaming of the "only-consistent" property

Svante Schubert Svante.Schubert at oracle.com
Wed Oct 27 13:19:24 CDT 2010


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.

Svante

-- 

<http://www.oracle.com/>
Svante Schubert | ODF Standardization
Phone: +49 40 23646 965
OracleOffice GBU

ORACLE Deutschland B.V. & Co. KG | Nagelsweg 55 | 20097 Hamburg
Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Rijnzathe 6, 3454PV De Meern, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Jürgen Kunz, Marcel van de Molen, Alexander van der Ven

<http://www.oracle.com/commitment>

	

Oracle is committed to developing practices and products that help
protect the environment



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20101027/a48ed98a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Grafik1
Type: image/gif
Size: 658 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20101027/a48ed98a/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Grafik2
Type: image/gif
Size: 356 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20101027/a48ed98a/attachment-0001.gif>


More information about the Mercurial-devel mailing list