gitweb: handle "patch" query parameter in filelog view
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 13 Apr 2017 10:04:09 +0200
changeset 31948 7a3fc3f3e89a
parent 31947 6c08dfd19e0b
child 31949 eaf3819631c2
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
mercurial/templates/gitweb/map
--- a/mercurial/templates/gitweb/map	Thu Apr 13 09:59:58 2017 +0200
+++ b/mercurial/templates/gitweb/map	Thu Apr 13 10:04:09 2017 +0200
@@ -282,7 +282,7 @@
     </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 @@
       <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}">