changeset 406: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, 20 Aug 2008 22:15:35 +0200
parents 1b52bda675d0
children e6d9741c8933
files en/Makefile en/examples/tour en/fixsvg en/tour-history.svg en/tour-merge-merge.svg en/tour-merge-pull.svg en/tour-merge-sep-repos.svg
diffstat 7 files changed, 83 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- 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 $@ $<
--- 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
--- /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
--- 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"><tspan
    style="font-weight:bold"
-   id="tspan1876">0</tspan>: 0a04</tspan></text>
+   id="tspan1876">0</tspan>: REV0</tspan></text>
     <rect
        style="opacity:1;fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2800"
@@ -116,7 +116,7 @@
          y="446.25119"
          style="font-family:Courier"><tspan
    id="tspan2868"
-   style="font-weight:bold">1</tspan>: 82e5</tspan></text>
+   style="font-weight:bold">1</tspan>: REV1</tspan></text>
     <rect
        style="opacity:1;fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2810"
@@ -136,7 +136,7 @@
          y="399.37619"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2866">2</tspan>: 057d</tspan></text>
+   id="tspan2866">2</tspan>: REV2</tspan></text>
     <rect
        style="opacity:1;fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2820"
@@ -156,7 +156,7 @@
          y="352.50122"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2864">3</tspan>: ff5d</tspan></text>
+   id="tspan2864">3</tspan>: REV3</tspan></text>
     <rect
        style="opacity:1;fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2830"
@@ -176,7 +176,7 @@
          y="305.62619"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2862">4</tspan>: b57f</tspan></text>
+   id="tspan2862">4</tspan>: REV4</tspan></text>
     <text
        xml:space="preserve"
        style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Courier"
@@ -246,7 +246,7 @@
          y="338.48334"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan1913">4</tspan>: b57f</tspan></text>
+   id="tspan1913">4</tspan>: REV4</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1"
        d="M 332.14286,375.21932 L 335.71429,347.36218"
--- a/en/tour-merge-merge.svg	Wed Aug 20 22:08:24 2008 +0200
+++ b/en/tour-merge-merge.svg	Wed Aug 20 22:15:35 2008 +0200
@@ -113,7 +113,7 @@
          y="311.38342"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2862">4</tspan>: b57f</tspan></text>
+   id="tspan2862">4</tspan>: REV4</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1"
        d="M 185.14286,343.63731 L 185.14286,319.47656"
@@ -139,7 +139,7 @@
          y="264.56592"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan1973">5</tspan>: ae13</tspan></text>
+   id="tspan1973">5</tspan>: REV_my_new_hello</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.00000143px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1;display:inline"
        d="M 173.95727,296.76228 L 149.75702,272.19085"
@@ -167,7 +167,7 @@
          y="218.02673"
          style="font-family:Courier"><tspan
    id="tspan1966"
-   style="font-weight:bold">6</tspan>: d2b5</tspan></text>
+   style="font-weight:bold">6</tspan>: REV6_my_new_hello</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.00000143px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1;display:inline"
        d="M 191.06908,296.76228 L 227.93092,226.11942"
@@ -260,7 +260,7 @@
          y="311.38342"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2822">4</tspan>: b57f</tspan></text>
+   id="tspan2822">4</tspan>: REV4</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1"
        d="M 530.28921,343.6373 L 530.28921,319.47655"
@@ -286,7 +286,7 @@
          y="264.56613"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2832">5</tspan>: ae13</tspan></text>
+   id="tspan2832">5</tspan>: REV_my_new_hello</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.00000143px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1;display:inline"
        d="M 519.10362,296.76227 L 494.90337,272.19084"
@@ -312,7 +312,7 @@
          y="218.02698"
          style="font-family:Courier"><tspan
    id="tspan2842"
-   style="font-weight:bold">6</tspan>: d2b5</tspan></text>
+   style="font-weight:bold">6</tspan>: REV6_my_new_hello</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.00000143px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1;display:inline"
        d="M 536.21543,296.76227 L 574.03453,224.76218"
@@ -353,7 +353,7 @@
          y="170.39714"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2997">7</tspan>: dba3</tspan></text>
+   id="tspan2997">7</tspan>: REV7_my_new_hello</tspan></text>
     <text
        xml:space="preserve"
        style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Times New Roman"
--- a/en/tour-merge-pull.svg	Wed Aug 20 22:08:24 2008 +0200
+++ b/en/tour-merge-pull.svg	Wed Aug 20 22:15:35 2008 +0200
@@ -107,7 +107,7 @@
          y="493.12619"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan1876">0</tspan>: 0a04</tspan></text>
+   id="tspan1876">0</tspan>: REV0</tspan></text>
     <rect
        style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2800"
@@ -127,7 +127,7 @@
          y="446.25119"
          style="font-family:Courier"><tspan
    id="tspan2868"
-   style="font-weight:bold">1</tspan>: 82e5</tspan></text>
+   style="font-weight:bold">1</tspan>: REV1</tspan></text>
     <rect
        style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2810"
@@ -147,7 +147,7 @@
          y="399.37619"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2866">2</tspan>: 057d</tspan></text>
+   id="tspan2866">2</tspan>: REV2</tspan></text>
     <rect
        style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2820"
@@ -167,7 +167,7 @@
          y="352.50122"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2864">3</tspan>: ff5d</tspan></text>
+   id="tspan2864">3</tspan>: REV3</tspan></text>
     <rect
        style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2830"
@@ -187,7 +187,7 @@
          y="305.62619"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2862">4</tspan>: b57f</tspan></text>
+   id="tspan2862">4</tspan>: REV4</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1"
        d="M 185.14286,478.50504 L 185.14286,454.34432"
@@ -228,7 +228,7 @@
          y="258.80865"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan1973">5</tspan>: ae13</tspan></text>
+   id="tspan1973">5</tspan>: REV_my_new_hello</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.00000143px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1;display:inline"
        d="M 173.95727,291.00504 L 149.75702,266.43361"
@@ -256,7 +256,7 @@
          y="212.26949"
          style="font-family:Courier"><tspan
    id="tspan1966"
-   style="font-weight:bold">6</tspan>: d2b5</tspan></text>
+   style="font-weight:bold">6</tspan>: REV6_my_new_hello</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.00000143px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1;display:inline"
        d="M 191.06908,291.00504 L 227.93092,220.36218"
--- a/en/tour-merge-sep-repos.svg	Wed Aug 20 22:08:24 2008 +0200
+++ b/en/tour-merge-sep-repos.svg	Wed Aug 20 22:15:35 2008 +0200
@@ -106,7 +106,7 @@
          y="493.12619"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan1876">0</tspan>: 0a04</tspan></text>
+   id="tspan1876">0</tspan>: REV0</tspan></text>
     <rect
        style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2800"
@@ -126,7 +126,7 @@
          y="446.25119"
          style="font-family:Courier"><tspan
    id="tspan2868"
-   style="font-weight:bold">1</tspan>: 82e5</tspan></text>
+   style="font-weight:bold">1</tspan>: REV1</tspan></text>
     <rect
        style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2810"
@@ -146,7 +146,7 @@
          y="399.37619"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2866">2</tspan>: 057d</tspan></text>
+   id="tspan2866">2</tspan>: REV2</tspan></text>
     <rect
        style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2820"
@@ -166,7 +166,7 @@
          y="352.50122"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2864">3</tspan>: ff5d</tspan></text>
+   id="tspan2864">3</tspan>: REV3</tspan></text>
     <rect
        style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2830"
@@ -186,7 +186,7 @@
          y="305.62619"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2862">4</tspan>: b57f</tspan></text>
+   id="tspan2862">4</tspan>: REV4</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1"
        d="M 185.14286,478.50504 L 185.14286,454.34432"
@@ -227,7 +227,7 @@
          y="258.80865"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan1973">5</tspan>: ae13</tspan></text>
+   id="tspan1973">5</tspan>: REV_my_hello</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.00000143px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1"
        d="M 185.143,291.06218 L 185.143,266.90143"
@@ -262,7 +262,7 @@
          y="493.11404"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2869">0</tspan>: 0a04</tspan></text>
+   id="tspan2869">0</tspan>: REV0</tspan></text>
     <rect
        style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2871"
@@ -282,7 +282,7 @@
          y="446.23904"
          style="font-family:Courier"><tspan
    id="tspan2877"
-   style="font-weight:bold">1</tspan>: 82e5</tspan></text>
+   style="font-weight:bold">1</tspan>: REV1</tspan></text>
     <rect
        style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2879"
@@ -302,7 +302,7 @@
          y="399.36404"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2885">2</tspan>: 057d</tspan></text>
+   id="tspan2885">2</tspan>: REV2</tspan></text>
     <rect
        style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2887"
@@ -322,7 +322,7 @@
          y="352.48907"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2893">3</tspan>: ff5d</tspan></text>
+   id="tspan2893">3</tspan>: REV3</tspan></text>
     <rect
        style="fill:#a5c3c8;fill-opacity:1;stroke:#6396a0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect2895"
@@ -342,7 +342,7 @@
          y="305.61404"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2901">4</tspan>: b57f</tspan></text>
+   id="tspan2901">4</tspan>: REV4</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1"
        d="M 417.85701,478.4929 L 417.85701,454.33218"
@@ -383,7 +383,7 @@
          y="258.79678"
          style="font-family:Courier"><tspan
    style="font-weight:bold"
-   id="tspan2917">5</tspan>: d2b5</tspan></text>
+   id="tspan2917">5</tspan>: REV_my_new_hello</tspan></text>
     <path
        style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.00000143px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-opacity:1"
        d="M 417.85715,291.05004 L 417.85715,266.88929"