mercurial/hgweb/webcommands.py
changeset 9136 31177742f54a
parent 8842 acd03a6e2426
child 9198 061eeb602354
equal deleted inserted replaced
9135:df881932362f 9136:31177742f54a
    63     if binary(text):
    63     if binary(text):
    64         mt = mimetypes.guess_type(f)[0] or 'application/octet-stream'
    64         mt = mimetypes.guess_type(f)[0] or 'application/octet-stream'
    65         text = '(binary:%s)' % mt
    65         text = '(binary:%s)' % mt
    66 
    66 
    67     def lines():
    67     def lines():
    68         for lineno, t in enumerate(text.splitlines(1)):
    68         for lineno, t in enumerate(text.splitlines(True)):
    69             yield {"line": t,
    69             yield {"line": t,
    70                    "lineid": "l%d" % (lineno + 1),
    70                    "lineid": "l%d" % (lineno + 1),
    71                    "linenumber": "% 6d" % (lineno + 1),
    71                    "linenumber": "% 6d" % (lineno + 1),
    72                    "parity": parity.next()}
    72                    "parity": parity.next()}
    73 
    73