406
|
1 #!/bin/bash
|
|
2
|
408
|
3 test -d hello || hg clone http://hg.serpentine.com/tutorial/hello
|
|
4
|
|
5 set -e
|
406
|
6
|
|
7 for i in 0 1 2 3 4
|
|
8 do
|
408
|
9 export REV$i=$(hg --cwd hello log -r $i --template '{node|short}' | cut -c1-4)
|
406
|
10 done
|
408
|
11 export REV_my_hello=$(cat /tmp/REV5.my-hello)
|
|
12 export REV_my_new_hello=$(cat /tmp/REV5.my-new-hello)
|
|
13 export REV6_my_new_hello=$(cat /tmp/REV6.my-new-hello)
|
|
14 export REV7_my_new_hello=$(cat /tmp/REV7.my-new-hello)
|
406
|
15
|
|
16 FILE=$1
|
408
|
17 OUTFILE=$FILE-tmp.svg
|
|
18 rm -f $OUTFILE
|
406
|
19 echo "Fixing $FILE"
|
408
|
20 cp $FILE $OUTFILE
|
|
21 perl -p -i -e "s#REV0#$REV0#" $OUTFILE
|
|
22 perl -p -i -e "s#REV1#$REV1#" $OUTFILE
|
|
23 perl -p -i -e "s#REV2#$REV2#" $OUTFILE
|
|
24 perl -p -i -e "s#REV3#$REV3#" $OUTFILE
|
|
25 perl -p -i -e "s#REV4#$REV4#" $OUTFILE
|
|
26 perl -p -i -e "s#REV_my_hello#$REV_my_hello#" $OUTFILE
|
|
27 perl -p -i -e "s#REV_my_new_hello#$REV_my_new_hello#" $OUTFILE
|
|
28 perl -p -i -e "s#REV6_my_new_hello#$REV6_my_new_hello#" $OUTFILE
|
|
29 perl -p -i -e "s#REV7_my_new_hello#$REV7_my_new_hello#" $OUTFILE
|