diff mercurial/hgweb/webcommands.py @ 24712:bbf1ae6b6a44

hgweb: expose raw line numbers to templates Surpringly, the templates didn't receive an unmodified version of the line numbers. Expose it to make implementing the JSON templates easier. In theory, we could post-process an existing template variable. But extra string manipulation seems quite wasteful, especially on items that could occur hundreds or even thousands of times in output.
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 10 Apr 2015 22:34:12 -0400
parents 6ddc86eedc3b
children 64e3f97bdf08
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Sat Apr 11 11:54:09 2015 -0400
+++ b/mercurial/hgweb/webcommands.py	Fri Apr 10 22:34:12 2015 -0400
@@ -927,6 +927,7 @@
                    "file": f.path(),
                    "targetline": targetline,
                    "line": l,
+                   "lineno": lineno + 1,
                    "lineid": "l%d" % (lineno + 1),
                    "linenumber": "% 6d" % (lineno + 1),
                    "revdate": f.date()}