##// END OF EJS Templates
hgweb/annotate: handle binary files like hgweb/file
Thomas Arendsen Hein -
r6203:3a75fcc9 default
parent child Browse files
Show More
@@ -654,6 +654,12 b' class hgweb(object):'
654
654
655 def annotate(**map):
655 def annotate(**map):
656 last = None
656 last = None
657 if util.binary(fctx.data()):
658 mt = (mimetypes.guess_type(fctx.path())[0]
659 or 'application/octet-stream')
660 lines = enumerate([((fctx.filectx(fctx.filerev()), 1),
661 '(binary:%s)' % mt)])
662 else:
657 lines = enumerate(fctx.annotate(follow=True, linenumber=True))
663 lines = enumerate(fctx.annotate(follow=True, linenumber=True))
658 for lineno, ((f, targetline), l) in lines:
664 for lineno, ((f, targetline), l) in lines:
659 fnode = f.filenode()
665 fnode = f.filenode()
General Comments 0
You need to be logged in to leave comments. Login now