[PATCH] EOL: Exclude .hgtags file from eol translation
Colin Caughie
c.caughie at indigovision.com
Fri Nov 12 13:13:44 UTC 2010
# HG changeset patch
# Parent 70ee1384455a3df39f8eda31822b679fae25e1c0
# User Colin Caughie <c.caughie at indigovision.com>
EOL: Exclude .hgtags file from eol translation
This fixes issue 2493.
diff -r 70ee1384455a hgext/eol.py
--- a/hgext/eol.py Wed Nov 10 20:26:56 2010 +0000
+++ b/hgext/eol.py Fri Nov 12 13:12:38 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