tests/test-import-eol
changeset 10102 1720d70cd6d4
parent 8817 6c9dce20ed70
child 10127 d8214e944b84
equal deleted inserted replaced
10101:155fe35534d3 10102:1720d70cd6d4
    26 
    26 
    27 # Test different --eol values
    27 # Test different --eol values
    28 python -c 'file("a", "wb").write("a\nbbb\ncc\n\nd\ne")'
    28 python -c 'file("a", "wb").write("a\nbbb\ncc\n\nd\ne")'
    29 hg ci -Am adda
    29 hg ci -Am adda
    30 python ../makepatch.py
    30 python ../makepatch.py
       
    31 
    31 echo % invalid eol
    32 echo % invalid eol
    32 hg --config patch.eol='LFCR' import eol.diff
    33 hg --config patch.eol='LFCR' import eol.diff
    33 hg revert -a
    34 hg revert -a
       
    35 
    34 echo % force LF
    36 echo % force LF
    35 hg --traceback --config patch.eol='LF' import eol.diff
    37 hg --traceback --config patch.eol='LF' import eol.diff
    36 python -c 'print repr(file("a","rb").read())'
    38 python -c 'print repr(file("a","rb").read())'
    37 hg st
    39 hg st
       
    40 
    38 echo % force CRLF
    41 echo % force CRLF
    39 hg up -C 0
    42 hg up -C 0
    40 hg --traceback --config patch.eol='CRLF' import eol.diff
    43 hg --traceback --config patch.eol='CRLF' import eol.diff
       
    44 python -c 'print repr(file("a","rb").read())'
       
    45 hg st
       
    46 
       
    47 echo % auto EOL on LF file
       
    48 hg up -C 0
       
    49 hg --traceback --config patch.eol='auto' import eol.diff
       
    50 python -c 'print repr(file("a","rb").read())'
       
    51 hg st
       
    52 
       
    53 echo % auto EOL on CRLF file
       
    54 python -c 'file("a", "wb").write("a\r\nbbb\r\ncc\r\n\r\nd\r\ne")'
       
    55 hg commit -m 'switch EOLs in a'
       
    56 hg --traceback --config patch.eol='auto' import eol.diff
    41 python -c 'print repr(file("a","rb").read())'
    57 python -c 'print repr(file("a","rb").read())'
    42 hg st
    58 hg st
    43 
    59 
    44 # Test --eol and binary patches
    60 # Test --eol and binary patches
    45 python -c 'file("b", "wb").write("a\x00\nb")'
    61 python -c 'file("b", "wb").write("a\x00\nb")'