[PATCH] Work around AIX shell builtin printf not handling \NNN

Jim Hague jim.hague at acm.org
Wed Jan 6 12:09:01 CST 2010


# HG changeset patch
# User Jim Hague <jim.hague at acm.org>
# Date 1262801013 0
# Node ID 5f312bb0ab65369c7dbf54648d585aa3732846d0
# Parent  3ab391dd5ec5ab1f4af06169bde7a9c850a7f4ce
Work around AIX shell builtin printf not handling \NNN.

On AIX, ksh builtin printf does not understand \NNN. Some tests use this
to generate test data, and so fail on AIX. Rework these tests to use python
to generate the correct characters. This fixes the tests on AIX and should
be more generally portable.

diff -r 3ab391dd5ec5 -r 5f312bb0ab65 tests/test-highlight
--- a/tests/test-highlight	Tue Jan 05 22:41:39 2010 +0100
+++ b/tests/test-highlight	Wed Jan 06 18:03:33 2010 +0000
@@ -119,7 +119,7 @@
 hg init eucjp
 cd eucjp
 
-printf '\265\376\n' >> eucjp.txt  # Japanese kanji "Kyo"
+python -c 'print("\265\376")' >> eucjp.txt  # Japanese kanji "Kyo"
 
 hg ci -Ama
 
diff -r 3ab391dd5ec5 -r 5f312bb0ab65 tests/test-patchbomb
--- a/tests/test-patchbomb	Tue Jan 05 22:41:39 2010 +0100
+++ b/tests/test-patchbomb	Wed Jan 06 18:03:33 2010 +0000
@@ -176,7 +176,7 @@
 cat tmp.mbox | fixheaders
 
 echo "% test multi-byte domain parsing"
-UUML=`printf '\374'`
+UUML=`python -c 'import sys; sys.stdout.write("\374")'`
 HGENCODING=iso-8859-1
 export HGENCODING
 hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" \


More information about the Mercurial-devel mailing list