changeset 34119:d4a5193332b3

configitems: register the 'eol.only-consistent' config
author Boris Feld <boris.feld@octobus.net>
date Fri, 30 Jun 2017 03:39:32 +0200
parents 4a6ef3a5b282
children 07f09995e857
files hgext/eol.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/eol.py	Fri Jun 30 03:39:26 2017 +0200
+++ b/hgext/eol.py	Fri Jun 30 03:39:32 2017 +0200
@@ -121,6 +121,9 @@
 configitem('eol', 'native',
     default=pycompat.oslinesep,
 )
+configitem('eol', 'only-consistent',
+    default=True,
+)
 
 # Matches a lone LF, i.e., one that is not part of CRLF.
 singlelf = re.compile('(^|[^\r])\n')
@@ -132,7 +135,7 @@
     """Filter to convert to LF EOLs."""
     if util.binary(s):
         return s
-    if ui.configbool('eol', 'only-consistent', True) and inconsistenteol(s):
+    if ui.configbool('eol', 'only-consistent') and inconsistenteol(s):
         return s
     if (ui.configbool('eol', 'fix-trailing-newline')
         and s and s[-1] != '\n'):
@@ -143,7 +146,7 @@
     """Filter to convert to CRLF EOLs."""
     if util.binary(s):
         return s
-    if ui.configbool('eol', 'only-consistent', True) and inconsistenteol(s):
+    if ui.configbool('eol', 'only-consistent') and inconsistenteol(s):
         return s
     if (ui.configbool('eol', 'fix-trailing-newline')
         and s and s[-1] != '\n'):