Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 33012:1c97df5e3b46
hgweb: plug followlines action in annotate view
Add the followlines.js script and corresponding parameters as data attribute
on <tbody class="sourcelines"> element.
Extend CSS rules so that they also match the DOM structure of annotate view.
As previously, only address paper and gitweb styles (other styles do not have
followlines at all).
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Wed, 21 Jun 2017 17:17:17 +0200 |
parents | 582080a4a812 |
children | 2943141f5e07 |
comparison
equal
deleted
inserted
replaced
33011:7c82bfd55d47 | 33012:1c97df5e3b46 |
---|---|
863 The ``fileannotate`` template is rendered. | 863 The ``fileannotate`` template is rendered. |
864 """ | 864 """ |
865 fctx = webutil.filectx(web.repo, req) | 865 fctx = webutil.filectx(web.repo, req) |
866 f = fctx.path() | 866 f = fctx.path() |
867 parity = paritygen(web.stripecount) | 867 parity = paritygen(web.stripecount) |
868 ishead = fctx.filerev() in fctx.filelog().headrevs() | |
868 | 869 |
869 # parents() is called once per line and several lines likely belong to | 870 # parents() is called once per line and several lines likely belong to |
870 # same revision. So it is worth caching. | 871 # same revision. So it is worth caching. |
871 # TODO there are still redundant operations within basefilectx.parents() | 872 # TODO there are still redundant operations within basefilectx.parents() |
872 # and from the fctx.annotate() call itself that could be cached. | 873 # and from the fctx.annotate() call itself that could be cached. |
925 annotate=annotate, | 926 annotate=annotate, |
926 path=webutil.up(f), | 927 path=webutil.up(f), |
927 symrev=webutil.symrevorshortnode(req, fctx), | 928 symrev=webutil.symrevorshortnode(req, fctx), |
928 rename=webutil.renamelink(fctx), | 929 rename=webutil.renamelink(fctx), |
929 permissions=fctx.manifest().flags(f), | 930 permissions=fctx.manifest().flags(f), |
931 ishead=int(ishead), | |
930 **webutil.commonentry(web.repo, fctx)) | 932 **webutil.commonentry(web.repo, fctx)) |
931 | 933 |
932 @webcommand('filelog') | 934 @webcommand('filelog') |
933 def filelog(web, req, tmpl): | 935 def filelog(web, req, tmpl): |
934 """ | 936 """ |