##// END OF EJS Templates
highlight: inline checkfctx()...
Gregory Szorc -
r26679:0d93df4d default
parent child Browse files
Show More
@@ -29,16 +29,14 b' from mercurial import extensions, encodi'
29 # leave the attribute unspecified.
29 # leave the attribute unspecified.
30 testedwith = 'internal'
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 ctx = fctx.changectx()
36 ctx = fctx.changectx()
34 tree = fileset.parse(expr)
37 tree = fileset.parse(expr)
35 mctx = fileset.matchctx(ctx, subset=[fctx.path()], status=None)
38 mctx = fileset.matchctx(ctx, subset=[fctx.path()], status=None)
36 return fctx.path() in fileset.getset(mctx, tree)
39 if fctx.path() in fileset.getset(mctx, tree):
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):
42 highlight.pygmentize(field, fctx, style, tmpl)
40 highlight.pygmentize(field, fctx, style, tmpl)
43
41
44 def filerevision_highlight(orig, web, req, tmpl, fctx):
42 def filerevision_highlight(orig, web, req, tmpl, fctx):
General Comments 0
You need to be logged in to leave comments. Login now