tests/test-username-newline
author Martin Geisler <mg@lazybytes.net>
Thu, 26 Nov 2009 20:06:45 +0100
branchstable
changeset 9941 11d7ee94b56a
parent 7035 9d023ef7b467
permissions -rwxr-xr-x
extdiff: prevent exception on double-translation The docstring is translated twice: once when used as a format string, and once on display. The second translation fails when the first translation introduces non-ASCII characters in the string. The problem is that the gettext module calls unicode(message) on the string, i.e., it decodes it to a Unicode string using the ASCII encoding (the default encoding). By translating it into a Unicode string here, the unicode() call becomes a noop.

#!/bin/sh
#

hg init foo
cd foo
touch a


unset HGUSER
echo "[ui]" >> .hg/hgrc
echo "username= foo" >> .hg/hgrc
echo "          bar1" >> .hg/hgrc

hg ci -Am m

rm .hg/hgrc

HGUSER=`(echo foo; echo bar2)` hg ci -Am m

hg ci -Am m -u "`(echo foo; echo bar3)`"

true