[PATCH] EOL: Exclude .hgtags file from eol translation

Colin Caughie c.caughie at indigovision.com
Sat Nov 13 04:00:10 CST 2010


# HG changeset patch
# Parent 071800e9734e621170debcfaf6f2876ccec66302
# User Colin Caughie <c.caughie at indigovision.com>
eol: exclude .hgtags file from eol translation (issue2493)

diff -r 071800e9734e hgext/eol.py
--- a/hgext/eol.py      Wed Nov 10 20:26:56 2010 +0000
+++ b/hgext/eol.py      Sat Nov 13 09:55:04 2010 +0000
@@ -162,6 +162,7 @@

         _decode = {'LF': 'to-lf', 'CRLF': 'to-crlf', 'BIN': 'is-binary'}
         _encode = {'LF': 'to-lf', 'CRLF': 'to-crlf', 'BIN': 'is-binary'}
+        _donttouch = ['.hgtags']

         def readhgeol(self, node=None, data=None):
             if data is None:
@@ -186,6 +187,10 @@
             else:
                 self._encode['NATIVE'] = 'to-lf'

+            for pattern in self._donttouch:
+                self.ui.setconfig('decode', pattern, 'is-binary')
+                self.ui.setconfig('encode', pattern, 'is-binary')
+
             for pattern, style in eol.items('patterns'):
                 key = style.upper()
                 try:
@@ -204,6 +209,9 @@
                 else:
                     include.append(pattern)

+            for pattern in self._donttouch:
+                exclude.append(pattern)
+
             # This will match the files for which we need to care
             # about inconsistent newlines.
             return match.match(self.root, '', [], include, exclude)


Latest News at: http://www.indigovision.com/news2010.php


More information about the Mercurial-devel mailing list