47
50
return [_UNIX_NL_RE.sub('\r\n', content)]
50
# Register the eol content filter.
51
def register_eol_content_filter():
52
from bzrlib.filters import ContentFilter, register_filter_stack_map
54
if sys.platform == 'win32':
55
_native_output = _to_crlf_converter
57
_native_output = _to_lf_converter
58
_eol_filter_stack_map = {
60
'native': [ContentFilter(_to_lf_converter, _native_output)],
61
'lf': [ContentFilter(_to_lf_converter, _to_lf_converter)],
62
'crlf': [ContentFilter(_to_lf_converter, _to_crlf_converter)],
63
'native-with-crlf-in-repo':
64
[ContentFilter(_to_crlf_converter, _native_output)],
65
'lf-with-crlf-in-repo':
66
[ContentFilter(_to_crlf_converter, _to_lf_converter)],
67
'crlf-with-crlf-in-repo':
68
[ContentFilter(_to_crlf_converter, _to_crlf_converter)],
71
filter = _eol_filter_stack_map.get(key)
73
raise BzrError("Unknown eol value '%s'" % key)
75
register_filter_stack_map('eol', eol_lookup)
53
if sys.platform == 'win32':
54
_native_output = _to_crlf_converter
56
_native_output = _to_lf_converter
57
_eol_filter_stack_map = {
59
'native': [ContentFilter(_to_lf_converter, _native_output)],
60
'lf': [ContentFilter(_to_lf_converter, _to_lf_converter)],
61
'crlf': [ContentFilter(_to_lf_converter, _to_crlf_converter)],
62
'native-with-crlf-in-repo':
63
[ContentFilter(_to_crlf_converter, _native_output)],
64
'lf-with-crlf-in-repo':
65
[ContentFilter(_to_crlf_converter, _to_lf_converter)],
66
'crlf-with-crlf-in-repo':
67
[ContentFilter(_to_crlf_converter, _to_crlf_converter)],
70
filter = _eol_filter_stack_map.get(key)
72
raise BzrError("Unknown eol value '%s'" % key)