You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Stephane Bortzmeyer <bo...@nic.fr> on 2005/11/25 16:07:48 UTC

Subversion commit to Atom syndication feeds

Based on a XSLT stylesheet originally written by Norman Walsh, here is
a small contrib, a XSLT stylesheet to produce an Atom
(http://www.atomenabled.org/) news feed from Subversion commits.

The main modification from the original work is that I believe it is
now fully parametrized which means you do not have to modify the
source code to adapt it to your environment.

I run it with xsltproc and from a Makefile which looks like:

NUMBER=75
HEAD=$(shell svnversion ${ROOT} | sed 's/M$$//')
START=$(shell echo ${HEAD} - ${NUMBER} | bc)

feed.atom: 
	svn log --xml --verbose -r ${START}:HEAD ${ROOT} | \
	xsltproc --stringparam repository_name CODEV-NIC \
		--stringparam url https://svn.generic-nic.net/ \
		--stringparam tag codev-nic.generic-nic.net,2005-01-01 \
		--stringparam maintainer subversion@generic-nic.net \
		--stringparam prefix 'https://viewcvs.generic-nic.net/viewcvs.cgi/?view=rev&amp;rev=' \
		--stringparam linktofiles https://viewcvs.generic-nic.net/viewcvs.cgi \
		--stringparam endlinktofiles '?rev=REVISION_NUM&amp;view=markup' \
		svnlog2atom.xsl - > $@

.PHONY: feed.atom

Running it from a post-commit hook is left as an exercice :-)