[PATCH] hgweb: file count consistency

Ben benoit.allard at gmx.de
Thu Mar 27 13:47:57 CDT 2008


Somehow breaks some old links like
http://selenic.com/hg/index.cgi/rev/bae2e9c838e9#l23 into
http://selenic.com/hg/index.cgi/rev/bae2e9c838e9#l0.23

And some old links like
http://selenic.com/hg/index.cgi/rev/8bc876e03143#l14 (where any file
count indication is not relevant because of only one file) will also
be brocken ...

# HG changeset patch
# User Benoît Allard <benoit at aeteurope.nl>
# Date 1206643032 -3600
# Node ID bd6cd9296a7225af71f695097f2ccbdf37569eb6
# Parent  1e4ddc9ac9f7abbaeaefc79995fc6abc8e43236f
hgweb: Always print file number before line number

diff -r 1e4ddc9ac9f7 -r bd6cd9296a72 mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Mon Mar 24 18:05:30 2008 -0500
+++ b/mercurial/hgweb/hgweb_mod.py	Thu Mar 27 19:37:12 2008 +0100
@@ -425,10 +425,7 @@
         def prettyprintlines(diff):
             blockno = blockcount.next()
             for lineno, l in enumerate(diff.splitlines(1)):
-                if blockno == 0:
-                    lineno = lineno + 1
-                else:
-                    lineno = "%d.%d" % (blockno, lineno + 1)
+                lineno = "%d.%d" % (blockno, lineno + 1)
                 if l.startswith('+'):
                     ltype = "difflineplus"
                 elif l.startswith('-'):



More information about the Mercurial-devel mailing list