highlight: was broken since 580a79dde2a3 (encoding)
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Sun, 21 Jun 2009 16:54:57 +0200
changeset 8874 74baf78202e8
parent 8873 e872ef2e6758
child 8875 801cacf46e62
highlight: was broken since 580a79dde2a3 (encoding)
hgext/highlight/__init__.py
--- a/hgext/highlight/__init__.py	Sun Jun 21 16:45:47 2009 +0200
+++ b/hgext/highlight/__init__.py	Sun Jun 21 16:54:57 2009 +0200
@@ -25,10 +25,10 @@
 
 import highlight
 from mercurial.hgweb import webcommands, webutil, common
-from mercurial import extensions
+from mercurial import extensions, encoding
 
 def filerevision_highlight(orig, web, tmpl, fctx):
-    mt = ''.join(tmpl('mimetype', encoding=web.encoding))
+    mt = ''.join(tmpl('mimetype', encoding=encoding.encoding))
     # only pygmentize for mimetype containing 'html' so we both match
     # 'text/html' and possibly 'application/xhtml+xml' in the future
     # so that we don't have to touch the extension when the mimetype
@@ -42,7 +42,7 @@
     return orig(web, tmpl, fctx)
 
 def annotate_highlight(orig, web, req, tmpl):
-    mt = ''.join(tmpl('mimetype', encoding=web.encoding))
+    mt = ''.join(tmpl('mimetype', encoding=encoding.encoding))
     if 'html' in mt:
         fctx = webutil.filectx(web.repo, req)
         style = web.config('web', 'pygments_style', 'colorful')