~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/filters/eol.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
25
25
from bzrlib.errors import BzrError
26
26
 
27
27
 
28
 
# Real Unix newline - \n without \r before it
29
 
_UNIX_NL_RE = re.compile(r'(?<!\r)\n')
 
28
# Real Linux/Unix/OSX newline - \n without \r before it
 
29
_LINUX_NL_RE = re.compile(r'(?<!\r)\n')
30
30
 
31
31
 
32
32
def _to_lf_converter(chunks, context=None):
44
44
    if '\x00' in content:
45
45
        return [content]
46
46
    else:
47
 
        return [_UNIX_NL_RE.sub('\r\n', content)]
 
47
        return [_LINUX_NL_RE.sub('\r\n', content)]
48
48
 
49
49
 
50
50
# Register the eol content filter.