changeset 31285:e2f141045634

hgweb: start enumerate at 1 in webutil.diffs's inner function prettyprintlines
author Denis Laxalde <denis.laxalde@logilab.fr>
date Mon, 06 Mar 2017 09:44:39 +0100
parents a8023a64c40d
children cd29673cebdb
files mercurial/hgweb/webutil.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/webutil.py	Fri Mar 03 17:20:11 2017 +0100
+++ b/mercurial/hgweb/webutil.py	Mon Mar 06 09:44:39 2017 +0100
@@ -420,8 +420,8 @@
 
     blockcount = countgen()
     def prettyprintlines(diff, blockno):
-        for lineno, l in enumerate(diff.splitlines(True)):
-            difflineno = "%d.%d" % (blockno, lineno + 1)
+        for lineno, l in enumerate(diff.splitlines(True), 1):
+            difflineno = "%d.%d" % (blockno, lineno)
             if l.startswith('+'):
                 ltype = "difflineplus"
             elif l.startswith('-'):
@@ -432,7 +432,7 @@
                 ltype = "diffline"
             yield tmpl(ltype,
                        line=l,
-                       lineno=lineno + 1,
+                       lineno=lineno,
                        lineid="l%s" % difflineno,
                        linenumber="% 8s" % difflineno)