Mercurial > hg
view mercurial/templates/gitweb/index.tmpl @ 31276:cd29673cebdb
hgweb: use patch.diffhunks in webutil.diffs to simplify the algorithm
Function patch.diffhunks yields items for a "block" (i.e. a file) as a whole
so take advantage of this to simplify the algorithm and avoid parsing diff
lines to determine whether we're starting a new "block" or not. Thus we drop
to external block counter and rely on diffhunks iterations instead.
We also take advantage of the fact that patch.diffhunks() yields *lines* of
hunks (instead of a string) to avoid building a list that is ''.join-ed into a
string that is then split.
As lines in 'header' returned by patch.diffhunks() have no trailing new line,
we need to insert it ourselves to match template expectations.
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Mon, 06 Mar 2017 09:28:33 +0100 |
parents | eb7de21b15be |
children |
line wrap: on
line source
{header} <title>Mercurial repositories index</title> </head> <body> <div class="page_header"> <a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a> <a href="/">Mercurial</a> {pathdef%breadcrumb} </div> <table cellspacing="0"> <tr> <td><a href="?sort={sort_name}">Name</a></td> <td><a href="?sort={sort_description}">Description</a></td> <td><a href="?sort={sort_contact}">Contact</a></td> <td><a href="?sort={sort_lastchange}">Last modified</a></td> <td> </td> <td> </td> </tr> {entries%indexentry} </table> <div class="page_footer"> {motd} </div> </body> </html>