Mercurial > hg > hg-fastimport
changeset 38:3048a2dcf68a
Test that fastimport dumps with non-ASCII characters import OK.
| author | Greg Ward <greg-hg@gerg.ca> |
|---|---|
| date | Fri, 08 May 2009 11:03:51 -0400 |
| parents | 513449a88de2 |
| children | 177a133519bc |
| files | tests/test-fastimport-nonascii tests/test-fastimport-nonascii.out |
| diffstat | 2 files changed, 109 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /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 <jf@example.com> 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 <juergen@example.org> 1250000000 +0400 +committer Dave <dave@example.org> 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 <dave@example.org> 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 ..
--- /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 <jf@example.com> +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 <juergen@example.org> +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 <dave@example.org> +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
