Adding Branch/Files Content in Atom Feed
Matt Mackall
mpm at selenic.com
Wed Apr 2 17:44:59 UTC 2014
On Wed, 2014-04-02 at 17:15 +0000, Jensen, Aaron wrote:
> > 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 />'
FYI, that's no longer needed with the current template engine. You can
do:
{somesymbol % "some inline {template}"}
> 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.
It is indeed. How horrible. Another legacy of the very limited
capabilities of our original templater. Perhaps we can fix that..
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list