Adding Branch/Files Content in Atom Feed
Jensen, Aaron
ajensen at webmd.net
Tue Apr 1 19:52:20 UTC 2014
We'd like to show branch and file info (adds/mods/deletes) in our repository's atom feed. I've updated the templates/atom/changelogentry.tmpl [1], but the branch name nor any of the file lists are showing up [2]. Is this an optimization? Is there a way to tell Mercurial that I'm OK with the performance hit?
Also, I would prefer not to much with Mercurial's internal templates. Is there a way to tell HgWeb to use a custom style when formatting the Atom feed?
[1] My customized changelogentry.tmpl:
<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>{branch|escape|nonempty}</td>
</tr>
<tr>
<th style="text-align:left;">description</th>
<td>{desc|escape|nonempty}</td>
</tr>
<tr>
<th style="text-align:left;">modifications</th>
<td>{file_mods % '{file|escape|nonempty}<br />'}</td>
</tr>
<tr>
<th style="text-align:left;">adds</th>
<td>{file_adds % '{file|escape|nonempty}<br />'}</td>
</tr>
<tr>
<th style="text-align:left;">deletes</th>
<td>{file_dels % '{file|escape|nonempty}<br />'}</td>
</tr>
</table>
</content>
</entry>
[2] The resulting XML:
<table xmlns="http://www.w3.org/1999/xhtml">
<tr>
<th style="text-align:left;">changeset</th>
<td>168b90fdb16e</td>
</tr>
<tr>
<th style="text-align:left;">branch</th>
<td>(none)</td>
</tr>
<tr>
<th style="text-align:left;">description</th>
<td>merge branch</td>
</tr>
<tr>
<th style="text-align:left;">modifications</th>
<td></td>
</tr>
<tr>
<th style="text-align:left;">adds</th>
<td></td>
</tr>
<tr>
<th style="text-align:left;">deletes</th>
<td></td>
</tr>
</table>
More information about the Mercurial
mailing list