Mercurial > hg
comparison hgext/highlight/__init__.py @ 26295:e7cb19b1ef2b
highlight: remove temporary hack to overwrite repo.getcwd
Now hgweb does it globally.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 20 Sep 2015 20:13:27 +0900 |
parents | 3166bcc0c538 |
children | 613d850cce53 |
comparison
equal
deleted
inserted
replaced
26294:1ffc61c4e32e | 26295:e7cb19b1ef2b |
---|---|
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 |