Click here to Skip to main content
15,885,216 members
Articles / Programming Languages / XSLT

Subversion RSS Logs

Rate me:
Please Sign up or sign in to vote.
4.69/5 (7 votes)
19 Jun 2008CPOL4 min read 32.9K   116   27   5
An application to interact with a Subversion repository and produce logs in a few different formats; TXT, XML, XML with XSL, and RSS.

Introduction

Every developer, whether working alone or within a group, should use a form of source control. It is an essential part of effective programming and collaboration. A popular source control system is Subversion. I have been developing with source control systems for a few years. I have found that there are some things they all do great; but there are usually a few things they all do not do so great. In my time, one thing that I have found that they usually don't do so great at is communication. It is important to know if another developer has made a change to a region of code that could impact what you are working on. There are also other key players that are not developers that need to be kept in the know. While there is no substitution to direct communications, a solution to this that I have found is using RSS feeds to keep everyone updated.

Background

While there are many different ways to get Subversion to produce an RSS feed, most of them involve using having direct access to the Subversion server and using hook scripts. This may not be possible in all situations. My solution does not use any hook scripts or require code to be running on the Subversion server. My solution utilizes the ability to retrieve the logs from the Subversion client. I recently came across SharpSvn, a binding of the Subversion Client API for .NET 2.0 applications. I use the SharpSvn API to interact with a Subversion repository to retrieve the list of changes and report them back as an RSS feed that can be consumed by end users.

To generate the RSS feed, I have included a custom component that I have written, myRSS. It is pretty easy to create a RSS feed with it and I have been using it for quite some time. Built into it is the ability to write RSS feeds and read RSS feeds. The output can be to either a stream or to a file. I have been using the stream output in an ASP.NET project to write to the Response stream. It has worked very well so far. I also have built an RSS reader using myRSS as the engine. Both projects have been used in production environments for quite some time without issue. If there is interest, I will post an article about it.

Using the Code

The configuration of the application is pretty simple. The settings are stored in an Application Configuration file. The settings are as follows:

  • repository_location
  • last_revision
    • The revision of the Subversion repository that the next run of the application will retrieve data for. This gets updated to the last revision every time the application runs and finds changes.
  • output_type
    • Console
      • Outputs all data to the console.
    • RSS
      • A standard RSS feed. The feed is set to maintain the past days worth of data.
    • TXT
      • A flat text file containing the data. If the file exists, it will append the new data to the end.
    • XML
      • An XML file containing the raw data. If the file exists, it will append the new data to the end.
    • XLMTransform
      • A transformation of the raw XML data.
      • Not fully tested and implemented. This is currently a work in progress.
  • service_interval
    • When the application is running in Service Mode, this controls the interval (in minutes) the service retrieves the logs.

The application can run as either a console application or as a Windows service. I came up with the idea from this Code Project article. To run it as a console application, run the application without any arguments. To run the application as a service, run it with a –service argument. To remove the service from the system, run the application with a –removeservice argument.

To install, extract the compiled binaries and the application configuration file to a directory. Set up the application configuration file as needed. Install the application as a service (run once with a –service argument) or setup a Task Scheduler task to execute the application without any arguments. Setup a Virtual Directory with IIS to point to the directory where you extracted the files and installed the service.

Points of Interest

None really yet. Comments and criticisms are welcome.

History

  • 19th June, 2008: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
All around cool guy.

Comments and Discussions

 
QuestionAre you using VS2008? Pin
supweb7-Nov-08 11:50
supweb7-Nov-08 11:50 
GeneralGreat Idea, and a few pointers Pin
thomasswilliams19-Jun-08 19:22
thomasswilliams19-Jun-08 19:22 
Wow Matt, this is a great idea. I have been looking around for a way to report on recent commits to my Subversion repository, and this looks like it fits the bill.

I have a few comments:
* I don't think you need to include the SharpSvn debug (*.pdb) files. Taking them out might reduce the size of the ZIP file.
* There's no compiled files in the download, which you reference in your article. Possibly you could include an additional download ZIP called "demo", renaming the current one to "source" for those who are interested in your source
* This last one is my personal preference, I think it would be handy to have Console.Write statements for people who run it from the command line without browsing the source, for errors and other things.

You've got my 5 vote Matt, well done!

Thomas Williams
http://dotnetjunkies.com/WebLog/thomasswilliams[^]
GeneralRe: Great Idea, and a few pointers Pin
matts_junk20-Jun-08 4:00
matts_junk20-Jun-08 4:00 
GeneralRe: Great Idea, and a few pointers Pin
thomasswilliams22-Jun-08 20:47
thomasswilliams22-Jun-08 20:47 
GeneralCommitMonitor Pin
SteveKing19-Jun-08 19:17
SteveKing19-Jun-08 19:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.