tests/test-encoding
changeset 3784 4421cef5d3f0
parent 3781 d0a48313b0f6
child 3789 734b1d6ba3dc
equal deleted inserted replaced
3783:a8725ae15c7c 3784:4421cef5d3f0
     5 
     5 
     6 # we need a repo with some legacy latin-1 changesets
     6 # we need a repo with some legacy latin-1 changesets
     7 hg unbundle $TESTDIR/legacy-encoding.hg
     7 hg unbundle $TESTDIR/legacy-encoding.hg
     8 hg co
     8 hg co
     9 
     9 
       
    10 printf "latin-1 e' encoded: \xe9" > latin-1
       
    11 printf "utf-8 e' encoded: \xc3\xa9" > utf-8
       
    12 printf "\xe9" > latin-1-tag
       
    13 
    10 echo % should fail with encoding error
    14 echo % should fail with encoding error
    11 echo "plain old ascii" > a
    15 echo "plain old ascii" > a
    12 hg st
    16 hg st
    13 HGENCODING=ascii hg ci -m "`printf "ascii 0xe9: \xe9"`" -d "0 0"
    17 HGENCODING=ascii hg ci -l latin-1 -d "0 0"
    14 
    18 
    15 echo % these should work
    19 echo % these should work
    16 echo "latin-1" > a
    20 echo "latin-1" > a
    17 HGENCODING=latin-1 hg ci -m "`printf "latin-1 e' encoded: \xe9"`" -d "0 0"
    21 HGENCODING=latin-1 hg ci -l latin-1 -d "0 0"
    18 echo "utf-8" > a
    22 echo "utf-8" > a
    19 HGENCODING=utf-8 hg ci -m "`printf "utf-8 e': \xc3\xa9"`" -d "0 0"
    23 HGENCODING=utf-8 hg ci -l utf-8 -d "0 0"
    20 
    24 
    21 HGENCODING=latin-1 hg tag -d "0 0" "`printf "\xe9"`"
    25 HGENCODING=latin-1 hg tag -d "0 0" `cat latin-1-tag`
    22 
    26 
       
    27 echo % ascii
    23 hg --encoding ascii log
    28 hg --encoding ascii log
       
    29 echo % latin-1
    24 hg --encoding latin-1 log
    30 hg --encoding latin-1 log
       
    31 echo % utf-8
    25 hg --encoding utf-8 log
    32 hg --encoding utf-8 log
       
    33 echo % ascii
    26 HGENCODING=ascii hg tags
    34 HGENCODING=ascii hg tags
       
    35 echo % latin-1
    27 HGENCODING=latin-1 hg tags
    36 HGENCODING=latin-1 hg tags
       
    37 echo % utf-8
    28 HGENCODING=utf-8 hg tags
    38 HGENCODING=utf-8 hg tags