[PATCH 2 of 3] gitweb: handle "patch" query parameter in filelog view

Denis Laxalde denis at laxalde.org
Thu Apr 13 05:05:20 EDT 2017


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1492070649 -7200
#      Thu Apr 13 10:04:09 2017 +0200
# Node ID c2e6e944113633a3051c78e773d2b09656a80718
# Parent  9696387c1d02ac29d3c9384ec37419aed2924f53
# Available At http://hg.logilab.org/users/dlaxalde/hg
#              hg pull http://hg.logilab.org/users/dlaxalde/hg -r c2e6e9441136
# EXP-Topic followlines/gitweb
gitweb: handle "patch" query parameter in filelog view

As for paper style, in f36dc643ffdc, we display "diff" data as an additional
row in the table of revision entries for the gitweb template.
Also, as these additional diff rows have a white background, they may be
confused with log entry rows ("age", "author", "description", "links") of even
parity (parity0 also have a white background). So we disable parity colors for
log entry rows when diff is displayed and fix the color to the
"dark" parity (i.e. parity1 #f6f6f0) so that it's always distinguishable from
diff rows.

diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map
--- a/mercurial/templates/gitweb/map
+++ b/mercurial/templates/gitweb/map
@@ -282,7 +282,7 @@ shortlogentry = '
     </td>
   </tr>'
 filelogentry = '
-  <tr class="parity{parity}">
+  <tr class="parity{if(patch, '1', '{parity}')}">
     <td class="age"><i class="age">{date|rfc822date}</i></td>
     <td><i>{author|person}</i></td>
     <td>
@@ -297,7 +297,8 @@ filelogentry = '
       <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
       {rename%filelogrename}
     </td>
-  </tr>'
+  </tr>
+  {if(patch, '<tr><td colspan="4">{diff}</td></tr>')}'
 archiveentry = ' | <a href="{url|urlescape}archive/{symrev}{extension}{ifeq(path,'/','',path|urlescape)}">{type|escape}</a> '
 indexentry = '
   <tr class="parity{parity}">


More information about the Mercurial-devel mailing list