# HG changeset patch # User Guido Ostkamp # Date 1219263335 -7200 # Node ID fb5c0d56d7f1a6084a1b0fc69653bda0008efefb # Parent 1b52bda675d03cdec19974bc0f0a4ccf15b0e138 Fix test 'tour'. Executing 'tour' test now creates some files in /tmp to store the revision numbers as they are created on the fly and appear in the output files. When SVG files are to be converted to PNG or EPS files within the Makefile, a tool 'fixsvg' will be invoked to substitute some placeholder markup by the real version number which fits to the test output, before the final conversion takes place. diff -r 1b52bda675d0 -r fb5c0d56d7f1 en/Makefile --- a/en/Makefile Wed Aug 20 22:08:24 2008 +0200 +++ b/en/Makefile Wed Aug 20 22:15:35 2008 +0200 @@ -123,7 +123,7 @@ if grep 'Reference.*undefined' $(@:.pdf=.log); then exit 1; fi endef -pdf/hgbook.pdf: $(sources) $(image-pdf) examples +pdf/hgbook.pdf: $(sources) examples $(image-pdf) $(call pdf) html: onepage split @@ -153,7 +153,7 @@ rm $(dir $(1))/hgbook.css endef -html/onepage/hgbook.html: $(sources) $(image-html) examples bookhtml.cfg +html/onepage/hgbook.html: $(sources) examples $(image-html) bookhtml.cfg $(call htlatex,$@,$<) html/split/hgbook.html: $(sources) examples bookhtml.cfg @@ -162,7 +162,9 @@ # Produce 90dpi PNGs for the web. %.png: %.svg - inkscape -D -e $@ $< + ./fixsvg $< + mv $<.tmp foobar.svg + inkscape -D -e $@ foobar.svg %.svg: %.dot dot -Tsvg -o $@ $< @@ -173,7 +175,9 @@ epstopdf $< %.eps: %.svg - inkscape -E $@ $< + ./fixsvg $< + mv $<.tmp foobar.svg + inkscape -E $@ foobar.svg %.eps: %.dot dot -Tps -o $@ $< diff -r 1b52bda675d0 -r fb5c0d56d7f1 en/examples/tour --- a/en/examples/tour Wed Aug 20 22:08:24 2008 +0200 +++ b/en/examples/tour Wed Aug 20 22:15:35 2008 +0200 @@ -31,7 +31,7 @@ #$ name: log-r hg log -r 3 -hg log -r ff5d7b70a2a9 +hg log -r 0272e0d5a517 hg log -r 1 -r 4 #$ name: log.range @@ -73,6 +73,10 @@ hg commit +#$ name: merge.dummy1 + +hg log -r 5 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV5.my-hello + #$ name: tip hg tip -vp @@ -143,6 +147,10 @@ sed -i '/printf/i\\tprintf("once more, hello.\\n");' hello.c hg commit -m 'A new hello for a new day.' +#$ name: merge.dummy2 + +hg log -r 5 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV5.my-new-hello + #$ name: merge.cat cat hello.c @@ -152,6 +160,10 @@ hg pull ../my-hello +#$ name: merge.dummy3 + +hg log -r 6 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV6.my-new-hello + #$ name: merge.heads hg heads @@ -173,6 +185,10 @@ hg commit -m 'Merged changes' +#$ name: merge.dummy4 + +hg log -r 7 | grep changeset | cut -c 16-19 2>/dev/null > /tmp/REV7.my-new-hello + #$ name: merge.tip hg tip diff -r 1b52bda675d0 -r fb5c0d56d7f1 en/fixsvg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/en/fixsvg Wed Aug 20 22:15:35 2008 +0200 @@ -0,0 +1,26 @@ +#!/bin/bash + +REPO=/home/ostkamp/mercurial/hello.repo + +for i in 0 1 2 3 4 +do + export REV$i=`cd $REPO; hg log -r $i | grep changeset | cut -c 16-19 2>//dev/null` +done +export REV_my_hello=`cat /tmp/REV5.my-hello` +export REV_my_new_hello=`cat /tmp/REV5.my-new-hello` +export REV6_my_new_hello=`cat /tmp/REV6.my-new-hello` +export REV7_my_new_hello=`cat /tmp/REV7.my-new-hello` + +FILE=$1 +rm -f $FILE.tmp +echo "Fixing $FILE" +cp $FILE $FILE.tmp +perl -p -i -e "s#REV0#$REV0#" $FILE.tmp +perl -p -i -e "s#REV1#$REV1#" $FILE.tmp +perl -p -i -e "s#REV2#$REV2#" $FILE.tmp +perl -p -i -e "s#REV3#$REV3#" $FILE.tmp +perl -p -i -e "s#REV4#$REV4#" $FILE.tmp +perl -p -i -e "s#REV_my_hello#$REV_my_hello#" $FILE.tmp +perl -p -i -e "s#REV_my_new_hello#$REV_my_new_hello#" $FILE.tmp +perl -p -i -e "s#REV6_my_new_hello#$REV6_my_new_hello#" $FILE.tmp +perl -p -i -e "s#REV7_my_new_hello#$REV7_my_new_hello#" $FILE.tmp diff -r 1b52bda675d0 -r fb5c0d56d7f1 en/tour-history.svg --- a/en/tour-history.svg Wed Aug 20 22:08:24 2008 +0200 +++ b/en/tour-history.svg Wed Aug 20 22:15:35 2008 +0200 @@ -96,7 +96,7 @@ y="493.12619" style="font-family:Courier">0: 0a04 + id="tspan1876">0: REV0 1: 82e5 + style="font-weight:bold">1: REV1 2: 057d + id="tspan2866">2: REV2 3: ff5d + id="tspan2864">3: REV3 4: b57f + id="tspan2862">4: REV4 4: b57f + id="tspan1913">4: REV4 4: b57f + id="tspan2862">4: REV4 5: ae13 + id="tspan1973">5: REV_my_new_hello 6: d2b5 + style="font-weight:bold">6: REV6_my_new_hello 4: b57f + id="tspan2822">4: REV4 5: ae13 + id="tspan2832">5: REV_my_new_hello 6: d2b5 + style="font-weight:bold">6: REV6_my_new_hello 7: dba3 + id="tspan2997">7: REV7_my_new_hello 0: 0a04 + id="tspan1876">0: REV0 1: 82e5 + style="font-weight:bold">1: REV1 2: 057d + id="tspan2866">2: REV2 3: ff5d + id="tspan2864">3: REV3 4: b57f + id="tspan2862">4: REV4 5: ae13 + id="tspan1973">5: REV_my_new_hello 6: d2b5 + style="font-weight:bold">6: REV6_my_new_hello 0: 0a04 + id="tspan1876">0: REV0 1: 82e5 + style="font-weight:bold">1: REV1 2: 057d + id="tspan2866">2: REV2 3: ff5d + id="tspan2864">3: REV3 4: b57f + id="tspan2862">4: REV4 5: ae13 + id="tspan1973">5: REV_my_hello 0: 0a04 + id="tspan2869">0: REV0 1: 82e5 + style="font-weight:bold">1: REV1 2: 057d + id="tspan2885">2: REV2 3: ff5d + id="tspan2893">3: REV3 4: b57f + id="tspan2901">4: REV4 5: d2b5 + id="tspan2917">5: REV_my_new_hello