Show More
@@ -29,16 +29,14 b' from mercurial import extensions, encodi' | |||
|
29 | 29 | # leave the attribute unspecified. |
|
30 | 30 | testedwith = 'internal' |
|
31 | 31 | |
|
32 | def checkfctx(fctx, expr): | |
|
32 | def pygmentize(web, field, fctx, tmpl): | |
|
33 | style = web.config('web', 'pygments_style', 'colorful') | |
|
34 | expr = web.config('web', 'highlightfiles', "size('<5M')") | |
|
35 | ||
|
33 | 36 | ctx = fctx.changectx() |
|
34 | 37 | tree = fileset.parse(expr) |
|
35 | 38 | mctx = fileset.matchctx(ctx, subset=[fctx.path()], status=None) |
|
36 |
|
|
|
37 | ||
|
38 | def pygmentize(web, field, fctx, tmpl): | |
|
39 | style = web.config('web', 'pygments_style', 'colorful') | |
|
40 | expr = web.config('web', 'highlightfiles', "size('<5M')") | |
|
41 | if checkfctx(fctx, expr): | |
|
39 | if fctx.path() in fileset.getset(mctx, tree): | |
|
42 | 40 | highlight.pygmentize(field, fctx, style, tmpl) |
|
43 | 41 | |
|
44 | 42 | def filerevision_highlight(orig, web, req, tmpl, fctx): |
General Comments 0
You need to be logged in to leave comments.
Login now