comparison mercurial/hgweb/webcommands.py @ 29522:9c37df347485

hgweb: add link to parents of annotated revision in annotate view The link is embedded into a div with class="annotate-info" that only shows up upon hover of the annotate column. To avoid duplicate hover-overs (this new one and the one coming from link's title), drop "title" attribute from a element and put it in the annotate-info element.
author Denis Laxalde <denis.laxalde@logilab.fr>
date Tue, 28 Jun 2016 11:42:42 +0200
parents c4fc33c477da
children df7d8ea90695
comparison
equal deleted inserted replaced
29521:83147ff53112 29522:9c37df347485
862 f = fctx.path() 862 f = fctx.path()
863 parity = paritygen(web.stripecount) 863 parity = paritygen(web.stripecount)
864 diffopts = patch.difffeatureopts(web.repo.ui, untrusted=True, 864 diffopts = patch.difffeatureopts(web.repo.ui, untrusted=True,
865 section='annotate', whitespace=True) 865 section='annotate', whitespace=True)
866 866
867 def parents(f):
868 for p in f.parents():
869 yield {
870 "node": p.hex(),
871 "rev": p.rev(),
872 }
873
867 def annotate(**map): 874 def annotate(**map):
868 if util.binary(fctx.data()): 875 if util.binary(fctx.data()):
869 mt = (mimetypes.guess_type(fctx.path())[0] 876 mt = (mimetypes.guess_type(fctx.path())[0]
870 or 'application/octet-stream') 877 or 'application/octet-stream')
871 lines = enumerate([((fctx.filectx(fctx.filerev()), 1), 878 lines = enumerate([((fctx.filectx(fctx.filerev()), 1),
880 previousrev = rev 887 previousrev = rev
881 yield {"parity": next(parity), 888 yield {"parity": next(parity),
882 "node": f.hex(), 889 "node": f.hex(),
883 "rev": rev, 890 "rev": rev,
884 "author": f.user(), 891 "author": f.user(),
892 "parents": parents(f),
885 "desc": f.description(), 893 "desc": f.description(),
886 "extra": f.extra(), 894 "extra": f.extra(),
887 "file": f.path(), 895 "file": f.path(),
888 "blockhead": blockhead, 896 "blockhead": blockhead,
889 "targetline": targetline, 897 "targetline": targetline,