test-treediscovery: fix escaping for both dash and bash
authorMartin Geisler <mg@lazybytes.net>
Thu, 05 May 2011 19:29:02 +0200
changeset 14200 dc733eec9169
parent 14199 e3dd3dcd6059
child 14201 57e04ded3da4
test-treediscovery: fix escaping for both dash and bash A '\n' on the command line is turned into a newline by dash, but kept as-is by bash, which resulted in a syntax error in the config file. Luckily, dash wont turn '\n' into a newline when it is part of a here-doc, so we can write the config file using that technique.
tests/test-treediscovery.t
--- a/tests/test-treediscovery.t	Thu May 05 12:53:33 2011 +0200
+++ b/tests/test-treediscovery.t	Thu May 05 19:29:02 2011 +0200
@@ -2,10 +2,12 @@
 
   $ CAP=getbundle
   $ . "$TESTDIR/notcapable"
-  $ echo '[ui]' >>$HGRCPATH
-  $ echo 'logtemplate="{rev} {node|short}: {desc} {branches}\\n"' >>$HGRCPATH
-  $ echo '[extensions]' >>$HGRCPATH
-  $ echo 'graphlog=' >>$HGRCPATH
+  $ cat >> $HGRCPATH <<EOF
+  > [ui]
+  > logtemplate="{rev} {node|short}: {desc} {branches}\n"
+  > [extensions]
+  > graphlog=
+  > EOF
 
 Setup HTTP server control: