1. Arne Babenhauserheide
  2. hgbook

Commits

Guido Ostkamp  committed fb5c0d5

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.

  • Participants
  • Parent commits 1b52bda
  • Branches default

Comments (0)

Files changed (7)

File en/Makefile

View file
 	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
 	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
 # 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 $@ $<
 	epstopdf $<
 
 %.eps: %.svg
-	inkscape -E $@ $<
+	./fixsvg $<
+	mv $<.tmp foobar.svg
+	inkscape -E $@ foobar.svg
 
 %.eps: %.dot
 	dot -Tps -o $@ $<

File en/examples/tour

View file
 #$ name: log-r
 
 hg log -r 3
-hg log -r ff5d7b70a2a9
+hg log -r 0272e0d5a517
 hg log -r 1 -r 4
 
 #$ name: log.range
 
 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
 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
 
 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
 
 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

File en/fixsvg

View file
+#!/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

File en/tour-history.svg

View file
Old
Old image
New
New image

File en/tour-merge-merge.svg

View file
Old
Old image
New
New image

File en/tour-merge-pull.svg

View file
Old
Old image
New
New image

File en/tour-merge-sep-repos.svg

View file
Old
Old image
New
New image