diff hgext/eol.py @ 14854:23c2d7d25329

eol: eol.only-consistent can now be specified in .hgeol
author Stepan Koltsov <stepancheg@yandex-team.ru>
date Fri, 01 Jul 2011 22:53:58 +0400
parents 56e71e7d2ba2
children f33579435378
line wrap: on
line diff
--- a/hgext/eol.py	Thu Jul 07 10:34:19 2011 +0200
+++ b/hgext/eol.py	Fri Jul 01 22:53:58 2011 +0400
@@ -158,7 +158,7 @@
         # about inconsistent newlines.
         self.match = match.match(root, '', [], include, exclude)
 
-    def setfilters(self, ui):
+    def copytoui(self, ui):
         for pattern, style in self.cfg.items('patterns'):
             key = style.upper()
             try:
@@ -167,6 +167,9 @@
             except KeyError:
                 ui.warn(_("ignoring unknown EOL style '%s' from %s\n")
                         % (style, self.cfg.source('patterns', pattern)))
+        # eol.only-consistent can be specified in ~/.hgrc or .hgeol
+        for k, v in self.cfg.items('eol'):
+            ui.setconfig('eol', k, v)
 
     def checkrev(self, repo, ctx, files):
         failed = []
@@ -273,7 +276,7 @@
             eol = parseeol(self.ui, self, nodes)
             if eol is None:
                 return None
-            eol.setfilters(self.ui)
+            eol.copytoui(self.ui)
             return eol.match
 
         def _hgcleardirstate(self):