view tests/test-encoding @ 3781:d0a48313b0f6

test-encoding: copy a bundle from TESTDIR rather than constructing one
author Matt Mackall <mpm@selenic.com>
date Sun, 03 Dec 2006 17:28:58 -0600
parents 731c33d32839
children 4421cef5d3f0
line wrap: on
line source

#!/bin/sh

hg init t
cd t

# we need a repo with some legacy latin-1 changesets
hg unbundle $TESTDIR/legacy-encoding.hg
hg co

echo % should fail with encoding error
echo "plain old ascii" > a
hg st
HGENCODING=ascii hg ci -m "`printf "ascii 0xe9: \xe9"`" -d "0 0"

echo % these should work
echo "latin-1" > a
HGENCODING=latin-1 hg ci -m "`printf "latin-1 e' encoded: \xe9"`" -d "0 0"
echo "utf-8" > a
HGENCODING=utf-8 hg ci -m "`printf "utf-8 e': \xc3\xa9"`" -d "0 0"

HGENCODING=latin-1 hg tag -d "0 0" "`printf "\xe9"`"

hg --encoding ascii log
hg --encoding latin-1 log
hg --encoding utf-8 log
HGENCODING=ascii hg tags
HGENCODING=latin-1 hg tags
HGENCODING=utf-8 hg tags