문제

The RSS feeds are a very good way to keep people updated about the latest changes in a repo. Unfortunately, the default RSS feeds include only the commit message in the body.

This similar question has information on how to customize the feed, but unfortunately there is no mention of adding a diff. Is it at all possible? How can I do it?

도움이 되었습니까?

해결책

As it turns out, not only the {diff} is not passed to the changelogentry.tmpl for RSS, but the RSS template set itself is lacking some templates needed to display diffs.

I've done a quick-and-dirty patch adding raw diffs to the Mercurial RSS template set. The patch is based on the version 2.2.1 of Mercurial. It modifies the Mercurial source (webcommands.py) in addition to the RSS template set, so you'll end up using a patched version of Mercurial itself, not only the templates.

The patch can be found on the so-10796514 branch in my copy of the Hg repo on Bitbucket. Feel free to use it.

Here's how the modified changelog looks like on my machine:

Screenshot of the RSS changelog with diffs, in Safari

I guess it can be improved from this point on.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top