# HG changeset patch # User Greg Ward # Date 1241795031 14400 # Node ID 3048a2dcf68acbf57b3c1890c7ffa7db86ae3403 # Parent 513449a88de2c11d7b13dfbfbd3066eca1a8a7cb Test that fastimport dumps with non-ASCII characters import OK. diff -r 513449a88de2 -r 3048a2dcf68a tests/test-fastimport-nonascii --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-fastimport-nonascii Fri May 08 11:03:51 2009 -0400 @@ -0,0 +1,72 @@ +#!/bin/sh + +# Test dumps with non-ASCII characters in various places. +# +# This file, including the fastimport dumps in it and the +# associated .out file, are all encoded in UTF-8. + +. $TESTDIR/fastimport-common + +echo "% import dump with non-ASCII committer" +cat > committer.dump <<__EOF__ +commit refs/heads/master +mark :1 +committer Jean-François 1007132290 +0000 +data 4 +foo + +__EOF__ + +hg init committer +cd committer +hg --traceback fastimport ../committer.dump +echo "% log with non-ASCII committer" + +# Overide HGENCODING (it is set to 'ascii' by run-tests.py) to ensure +# log is accurately printed. +HGENCODING=utf-8 hg log +cd .. + +echo "% import dump with non-ASCII author" +cat > author.dump <<__EOF__ +commit refs/heads/master +mark :1 +author Jürgen 1250000000 +0400 +committer Dave 1250000030 +0400 +data 5 +blah + +__EOF__ + +hg init author +cd author +hg --traceback fastimport ../author.dump +echo "% log with non-ASCII author" +HGENCODING=utf-8 hg log +cd .. + +echo "% import dump with non-ASCII message" +cat > message.dump <<__EOF__ +commit refs/heads/master +mark :1 +committer Dave 1250000030 +0400 +data 60 +fix naïve implementation that Øle threw together for €5 + +M 644 inline foo.txt +data 6 +hello + + +__EOF__ + +hg init message +cd message +hg --traceback fastimport ../message.dump +echo "% log with non-ASCII message" +HGENCODING=utf-8 hg log +echo "% manifest" +hg manifest -r0 +echo "% contents of foo.txt" +hg cat -r0 foo.txt +cd .. diff -r 513449a88de2 -r 3048a2dcf68a tests/test-fastimport-nonascii.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-fastimport-nonascii.out Fri May 08 11:03:51 2009 -0400 @@ -0,0 +1,37 @@ +% import dump with non-ASCII committer +Reading source: ../committer.dump +0 files updated, 0 files merged, 0 files removed, 0 files unresolved +Done commit of rev 0 +% log with non-ASCII committer +changeset: 0:d06142abc8ab +tag: tip +user: Jean-François +date: Fri Nov 30 14:58:10 2001 +0000 +summary: foo + +% import dump with non-ASCII author +Reading source: ../author.dump +0 files updated, 0 files merged, 0 files removed, 0 files unresolved +Done commit of rev 0 +% log with non-ASCII author +changeset: 0:9a86e5e78bae +tag: tip +user: Jürgen +date: Tue Aug 11 10:13:20 2009 -0400 +summary: blah + +% import dump with non-ASCII message +Reading source: ../message.dump +0 files updated, 0 files merged, 0 files removed, 0 files unresolved +Done commit of rev 0 +% log with non-ASCII message +changeset: 0:0700c36eef88 +tag: tip +user: Dave +date: Tue Aug 11 10:13:50 2009 -0400 +summary: fix naïve implementation that Øle threw together for €5 + +% manifest +foo.txt +% contents of foo.txt +hello