##// END OF EJS Templates
webcommands: use fctx.isbinary
Jun Wu -
r32136:f238a483 default
parent child Browse files
Show More
@@ -808,7 +808,7 b' def comparison(web, req, tmpl):'
808 context = parsecontext(web.config('web', 'comparisoncontext', '5'))
808 context = parsecontext(web.config('web', 'comparisoncontext', '5'))
809
809
810 def filelines(f):
810 def filelines(f):
811 if util.binary(f.data()):
811 if f.isbinary():
812 mt = mimetypes.guess_type(f.path())[0]
812 mt = mimetypes.guess_type(f.path())[0]
813 if not mt:
813 if not mt:
814 mt = 'application/octet-stream'
814 mt = 'application/octet-stream'
@@ -886,7 +886,7 b' def annotate(web, req, tmpl):'
886 yield p
886 yield p
887
887
888 def annotate(**map):
888 def annotate(**map):
889 if util.binary(fctx.data()):
889 if fctx.isbinary():
890 mt = (mimetypes.guess_type(fctx.path())[0]
890 mt = (mimetypes.guess_type(fctx.path())[0]
891 or 'application/octet-stream')
891 or 'application/octet-stream')
892 lines = [((fctx.filectx(fctx.filerev()), 1), '(binary:%s)' % mt)]
892 lines = [((fctx.filectx(fctx.filerev()), 1), '(binary:%s)' % mt)]
General Comments 0
You need to be logged in to leave comments. Login now