Patchwork [2,of,3] configitems: register the 'eol.native' config

login
register
mail settings
Submitter Boris Feld
Date Sept. 11, 2017, 1:44 p.m.
Message ID <6b6d538975c860009202.1505137462@FB>
Download mbox | patch
Permalink /patch/23775/
State Accepted
Headers show

Comments

Boris Feld - Sept. 11, 2017, 1:44 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1498786766 -7200
#      ven. juin 30 03:39:26 2017 +0200
# Node ID 6b6d538975c8600092024aa9693b5be4c8738633
# Parent  e5c4424dc0dabfa817f41fc81a49b4232fda05e6
# EXP-Topic config.register.eol
configitems: register the 'eol.native' config

Patch

diff -r e5c4424dc0da -r 6b6d538975c8 hgext/eol.py
--- a/hgext/eol.py	ven. juin 30 03:39:21 2017 +0200
+++ b/hgext/eol.py	ven. juin 30 03:39:26 2017 +0200
@@ -118,6 +118,9 @@ 
 configitem('eol', 'fix-trailing-newline',
     default=False,
 )
+configitem('eol', 'native',
+    default=pycompat.oslinesep,
+)
 
 # Matches a lone LF, i.e., one that is not part of CRLF.
 singlelf = re.compile('(^|[^\r])\n')
@@ -174,7 +177,7 @@ 
 
         isrepolf = self.cfg.get('repository', 'native') != 'CRLF'
         self._encode['NATIVE'] = isrepolf and 'to-lf' or 'to-crlf'
-        iswdlf = ui.config('eol', 'native', pycompat.oslinesep) in ('LF', '\n')
+        iswdlf = ui.config('eol', 'native') in ('LF', '\n')
         self._decode['NATIVE'] = iswdlf and 'to-lf' or 'to-crlf'
 
         include = []