comparison tests/test-highlight @ 6485:938319418d8c

highlight: Generate pygments style sheet dynamically This patch allows a per-repository (for example, within a hgwebdir) selection of pygments_style web option. No static .css files required. Test edited by pmezard (compatibility fixes)
author Isaac Jurado <diptongo@gmail.com>
date Sat, 05 Apr 2008 21:29:02 +0200
parents 3b841c189ab7
children d78d0f9783b8
comparison
equal deleted inserted replaced
6484:ab8038bf5127 6485:938319418d8c
3 "$TESTDIR/hghave" pygments || exit 80 3 "$TESTDIR/hghave" pygments || exit 80
4 4
5 cat <<EOF >> $HGRCPATH 5 cat <<EOF >> $HGRCPATH
6 [extensions] 6 [extensions]
7 hgext.highlight = 7 hgext.highlight =
8 [web]
9 pygments_style = friendly
8 EOF 10 EOF
9 11
10 hg init test 12 hg init test
11 cd test 13 cd test
12 cp $TESTDIR/get-with-headers.py ./ 14 cp $TESTDIR/get-with-headers.py ./
22 24
23 echo % hgweb fileannotate 25 echo % hgweb fileannotate
24 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/get-with-headers.py') \ 26 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/get-with-headers.py') \
25 | sed "s/[0-9]* years ago/long ago/g" 27 | sed "s/[0-9]* years ago/long ago/g"
26 28
29 echo % hgweb highlightcss friendly
30 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss') \
31 | head -n 4
32
33 echo % errors encountered
34 cat errors.log
35 kill `cat hg.pid`
36
37 # Change the pygments style
38 cat > .hg/hgrc <<EOF
39 [web]
40 pygments_style = fruity
41 EOF
42
43 echo % hg serve again
44 hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
45 cat hg.pid >> $DAEMON_PIDS
46
47 echo % hgweb highlightcss fruity
48 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss') \
49 | head -n 4
50
27 echo % errors encountered 51 echo % errors encountered
28 cat errors.log 52 cat errors.log
29 53