31 |
31 |
32 def checkfctx(fctx, expr): |
32 def checkfctx(fctx, expr): |
33 ctx = fctx.changectx() |
33 ctx = fctx.changectx() |
34 tree = fileset.parse(expr) |
34 tree = fileset.parse(expr) |
35 mctx = fileset.matchctx(ctx, subset=[fctx.path()], status=None) |
35 mctx = fileset.matchctx(ctx, subset=[fctx.path()], status=None) |
36 repo = ctx.repo() |
|
37 # To allow matching file names in the fileset in hgweb directory mode. |
|
38 # See issue4568. |
|
39 object.__setattr__(repo, 'getcwd', lambda: repo.root) |
|
40 return fctx.path() in fileset.getset(mctx, tree) |
36 return fctx.path() in fileset.getset(mctx, tree) |
41 |
37 |
42 def filerevision_highlight(orig, web, req, tmpl, fctx): |
38 def filerevision_highlight(orig, web, req, tmpl, fctx): |
43 mt = ''.join(tmpl('mimetype', encoding=encoding.encoding)) |
39 mt = ''.join(tmpl('mimetype', encoding=encoding.encoding)) |
44 # only pygmentize for mimetype containing 'html' so we both match |
40 # only pygmentize for mimetype containing 'html' so we both match |