Commit Graph

12 Commits

Author SHA1 Message Date
Martin Geisler
f51ce71d96 test-highlight: decouple test from get-with-headers.py
The test copied get-with-headers.py from $TESTDIR and committed it to
a test repository. The test output therefore depended unnecessarily on
the exact content of get-with-headers.py. It has now been replaced
with another small Python script.
2009-05-17 21:47:24 +02:00
Christian Ebert
510a4bc8a5 test-highlight: adapt output to latest pygments keeping backwards compatibility 2009-04-19 13:27:03 +01:00
Christian Ebert
3849a2cc57 tests: guess lexer by filename for recent pygments
Recent pygments guess AntlrJavaLexer for the isolatin text, converted to ascii
by util.tolocal, which yields class="err". Guess lexer by extension instead.
2009-04-04 15:14:36 +02:00
Dirkjan Ochtman
e53eace7ea tests: use killdaemons.py in test-highlight 2009-01-12 09:57:52 +01:00
Gilles Moris
9b7deb4420 test-hgweb-*: replace "XX years ago" by a fixed string in get-with-headers.py
Note that other sed replacement commands are also filtering get-with-headers.py,
but they seem to be more test specific, hence not handled here.
2008-12-25 17:49:08 +01:00
Christian Ebert
5cbc9e210a highlight: convert text to local before passing to pygmentize (issue1341)
Example case:
Display file written in iso-8859-1 with current HGENCODING utf-8.
At the moment only an Error page appears because pygmentize
chokes on the replacement chars.

Alternatives:
1) Turn off highlighting and avoid UnicodeDecodeError
   for files that are not in HGENCODING.
2) [this patch] use util.tolocal to display these files.

Alternative 2) seems ok, as this only concerns display and
readability.

See also: c5f1a58b8b9a, apparently put aside during refactor of
highlight.

Add test for UnicodeDecodeError with iso-8859-1 file contents.
2008-10-17 12:12:33 +02:00
Dirkjan Ochtman
0aa08a7ed8 merge with crew-stable 2008-09-17 11:34:37 +02:00
Dirkjan Ochtman
87abdc361c tests: fix test-highlight for compatiblity with newer Pygments 2008-09-17 11:14:06 +02:00
Rocco Rutte
cc79439de6 highlight: only pygmentize for HTML mimetypes
For non-html mimetypes it doesn't make much sense. This also fixes the
issue that highlight unconditionally adds a <link/> tag for its CSS to
the template's header (which is pointless in text/plain output).
2008-09-05 10:39:57 +02:00
Brendan Cully
a6d56747f2 Fix intermittent broken pipe in test-highlight 2008-08-06 15:08:18 -07:00
Isaac Jurado
ec51524d45 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)
2008-04-05 21:29:02 +02:00
Dirkjan Ochtman
a3c9e25c1e tests: add highlight extension tests 2008-03-22 20:16:30 +01:00