subversion/subversion.viewvc-r1423.patch

43 lines
1.5 KiB
Diff

------------------------------------------------------------------------
r1423 | cmpilato | 2006-08-16 16:32:09 +0000 (Wed, 16 Aug 2006) | 7 lines
Port r1422 to the 1.0.x branch.
* lib/viewvc.py
(view_markup): Correct the syntax highlighter choosing logic.
---
lib/viewvc.py | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
Index: lib/viewvc.py
===================================================================
--- lib/viewvc.py.orig
+++ lib/viewvc.py
@@ -1425,14 +1425,17 @@ def view_markup(request):
streamer = markup_streamers.get(ext)
if streamer:
markup_fp = streamer(fp, cfg)
- elif cfg.options.use_enscript:
- markup_fp = MarkupEnscript(cfg, fp, request.path_parts[-1])
- elif cfg.options.use_highlight:
- markup_fp = MarkupHighlight(cfg, fp, request.path_parts[-1])
-
- # If no one has a suitable markup handler, we'll use the default.
- if not markup_fp:
- markup_fp = MarkupPipeWrapper(fp)
+
+ # If there wasn't a custom streamer, or the streamer wasn't enabled, we'll
+ # try to use one of the configured syntax highlighting programs.
+ if not markup_fp:
+ if cfg.options.use_enscript:
+ markup_fp = MarkupEnscript(cfg, fp, request.path_parts[-1])
+ elif cfg.options.use_highlight:
+ markup_fp = MarkupHighlight(cfg, fp, request.path_parts[-1])
+ else:
+ # If no one has a suitable markup handler, we'll use the default.
+ markup_fp = MarkupPipeWrapper(fp)
data['markup'] = markup_fp