mercurial/hgweb/hgweb_mod.py
changeset 6203 3a75fcc96dac
parent 6168 2ab54f48dbe8
child 6211 f89fd07fc51d
equal deleted inserted replaced
6202:0ab0da2215d7 6203:3a75fcc96dac
   652         fl = fctx.filelog()
   652         fl = fctx.filelog()
   653         parity = paritygen(self.stripecount)
   653         parity = paritygen(self.stripecount)
   654 
   654 
   655         def annotate(**map):
   655         def annotate(**map):
   656             last = None
   656             last = None
   657             lines = enumerate(fctx.annotate(follow=True, linenumber=True))
   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:
       
   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()
   660                 name = self.repo.ui.shortuser(f.user())
   666                 name = self.repo.ui.shortuser(f.user())
   661 
   667 
   662                 if last != fnode:
   668                 if last != fnode: