i18n: safety writing into non-ASCII named files on any shell implementation stable
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Thu, 22 Jul 2010 23:18:38 +0900
branchstable
changeset 11674 c29012a73518
parent 11657 5ed6802e6bcb
child 11675 f92f8921a5cc
i18n: safety writing into non-ASCII named files on any shell implementation some shell implementation (e.g.: dash) can not handle redirection into non-ASCII UTF-8 named file correctly.
tests/test-encoding-align
--- a/tests/test-encoding-align	Thu Jul 22 21:43:45 2010 +0200
+++ b/tests/test-encoding-align	Thu Jul 22 23:18:38 2010 +0900
@@ -60,34 +60,38 @@
 ####     - user names in annotate
 ####     - file names in diffstat
 
+rm -f s; touch s
+rm -f m; touch m
+rm -f l; touch l
+
 #### add files
 
-touch $S
+cp s $S
 hg add $S
-touch $M
+cp m $M
 hg add $M
-touch $L
+cp l $L
 hg add $L
 
 #### commit(1)
 
-echo 'first line(1)' >> $S
-echo 'first line(2)' >> $M
-echo 'first line(3)' >> $L
+echo 'first line(1)' >> s; cp s $S
+echo 'first line(2)' >> m; cp m $M
+echo 'first line(3)' >> l; cp l $L
 hg commit -m 'first commit' -u $S -d "1000000 0"
 
 #### commit(2)
 
-echo 'second line(1)' >> $S
-echo 'second line(2)' >> $M
-echo 'second line(3)' >> $L
+echo 'second line(1)' >> s; cp s $S
+echo 'second line(2)' >> m; cp m $M
+echo 'second line(3)' >> l; cp l $L
 hg commit -m 'second commit' -u $M -d "1000000 0"
 
 #### commit(3)
 
-echo 'third line(1)' >> $S
-echo 'third line(2)' >> $M
-echo 'third line(3)' >> $L
+echo 'third line(1)' >> s; cp s $S
+echo 'third line(2)' >> m; cp m $M
+echo 'third line(3)' >> l; cp l $L
 hg commit -m 'third commit' -u $L -d "1000000 0"
 
 #### check