hgbook

diff en/fixsvg @ 307:fb5c0d56d7f1

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.
author Guido Ostkamp <hg@ostkamp.fastmail.fm>
date Wed Aug 20 22:15:35 2008 +0200 (2008-08-20)
parents
children 028543f67bea
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/en/fixsvg	Wed Aug 20 22:15:35 2008 +0200
     1.3 @@ -0,0 +1,26 @@
     1.4 +#!/bin/bash
     1.5 +
     1.6 +REPO=/home/ostkamp/mercurial/hello.repo
     1.7 +
     1.8 +for i in 0 1 2 3 4
     1.9 +do
    1.10 +  export REV$i=`cd $REPO; hg log -r $i | grep changeset | cut -c 16-19 2>//dev/null`
    1.11 +done
    1.12 +export REV_my_hello=`cat /tmp/REV5.my-hello`
    1.13 +export REV_my_new_hello=`cat /tmp/REV5.my-new-hello`
    1.14 +export REV6_my_new_hello=`cat /tmp/REV6.my-new-hello`
    1.15 +export REV7_my_new_hello=`cat /tmp/REV7.my-new-hello`
    1.16 +
    1.17 +FILE=$1
    1.18 +rm -f $FILE.tmp
    1.19 +echo "Fixing $FILE"
    1.20 +cp $FILE $FILE.tmp
    1.21 +perl -p -i -e "s#REV0#$REV0#" $FILE.tmp
    1.22 +perl -p -i -e "s#REV1#$REV1#" $FILE.tmp
    1.23 +perl -p -i -e "s#REV2#$REV2#" $FILE.tmp
    1.24 +perl -p -i -e "s#REV3#$REV3#" $FILE.tmp
    1.25 +perl -p -i -e "s#REV4#$REV4#" $FILE.tmp
    1.26 +perl -p -i -e "s#REV_my_hello#$REV_my_hello#" $FILE.tmp
    1.27 +perl -p -i -e "s#REV_my_new_hello#$REV_my_new_hello#" $FILE.tmp
    1.28 +perl -p -i -e "s#REV6_my_new_hello#$REV6_my_new_hello#" $FILE.tmp
    1.29 +perl -p -i -e "s#REV7_my_new_hello#$REV7_my_new_hello#" $FILE.tmp