RSS page for tags (and other pages)

Angel Ezquerra angel.ezquerra at gmail.com
Thu Nov 29 17:37:51 CST 2012


On Thu, Nov 29, 2012 at 8:53 PM, Matt Mackall <mpm at selenic.com> wrote:
> On Thu, 2012-11-29 at 17:55 +0100, Angel Ezquerra wrote:
>> Hi,
>>
>> today, playing around with the rss web.style I noticed that it is
>> possible for hgweb to generate an RSS feed that only shows the tagged
>> the revisions for example, if you select the "rss" style.
>>
>> However, if you click on the RSS or Atom button that is located on the
>> tags page you get an RSS feed of all the revisions, not of the tagged
>> revisions as could be expected. That button links to {url}rss-log. I
>> tried manually going to {url}rss-log/tags or even {url}/tags/rss-log
>> but that does not work.
>>
>> I looked for "rss-log" on the mercurial source code but I did not find
>> any references to it except on the template files. I'd like to fix
>> this issue since I think it would be nice to be able to "subscribe" to
>> a tag page and get notifications whenever someone adds a new tag, for
>> example. You could even suscribe to a file and be notified when the
>> file is modified, etc, which I think would be really powerful.
>>
>> Does someone have an idea of where is the "rss-log" handled?
>> Alternatively, is there a way to ask the web server to serve a page as
>> if the "rss" web style had been selected?
>
> Internally, hgweb has no special support for RSS. It's simply a style.
> The rss-log/ link is in the form [<style>-]<page>/.
>
> Implementing RSS for tags is probably a matter of copying
> templates/rss/log.tmpl to tags.tmpl, fixing it up, and editing the other
> templates that link to it. Same for atom. Consult paper/tags.tmpl to see
> what sort of data is available in the tags page context.

Thank you Matt,

I was not aware of the "[<style>-]<page>" syntax, which is great.

One problem that I see is that the RSS and Atom links are created by
the footer template, which is not aware (AFAIK) of the name of the
current file (i.e. whether it is the "log", "tags" or "bookmarks"
page, for example). Is there some way to pass that information to the
footer.tmpl when it is inserted on tags.tmpl for example?

Cheers,

Angel


More information about the Mercurial-devel mailing list