Adding Branch/Files Content in Atom Feed

Jensen, Aaron ajensen at webmd.net
Wed Apr 2 17:15:27 UTC 2014


> I bet. There's no such symbol available in hgweb templates. See how it's done in templates/gitweb/changelogentry.tmpl and map.

Good to know.  Looks like there are different fields available in hgweb templates.  I did not know that.

Here is what changelogentry.tmpl ended up looking like:

     <entry>
      <title>{desc|strip|firstline|strip|escape|nonempty}</title>
      <id>{urlbase}{url|urlescape}#changeset-{node}</id>
      <link href="{urlbase}{url|urlescape}rev/{node|short}"/>
      <author>
       <name>{author|person|escape}</name>
       <email>{author|email|obfuscate}</email>
      </author>
      <updated>{date|rfc3339date}</updated>
      <published>{date|rfc3339date}</published>
      <content type="xhtml">
    	<table xmlns="http://www.w3.org/1999/xhtml">
    	<tr>
    		<th style="text-align:left;">changeset</th>
    		<td>{node|short}</td>
    	</tr>
    	<tr>
    		<th style="text-align:left;">branch</th>
    		<td>{branches%branchname}</td>
    	</tr>
    	<tr>
    		<th style="text-align:left;">description</th>
    		<td>{desc|escape|nonempty}</td>
    	</tr>
    	<tr>
    		<th style="text-align:left;">files</th>
    		<td>{files}</td>
    	</tr>
    	</table>
      </content>
     </entry>

I had to add a branchname and filedifflink template to the map file:

    branchname = '{name|escape}'
    filedifflink = '{file|escape}<br />'

Thanks for the help.    I don't understand why hgweb is using the filedifflink template when I specify {files}.  Sounds like it is because of something in the Mercurial code.

I plan on contributing this change back to you.  Hopefully they'll get accepted.  I'll make similar changes to the RSS templates.  




More information about the Mercurial mailing list