Automatically add svn keyword properties for new files (server-side)

jochem picture jochem · Feb 23, 2010 · Viewed 9k times · Source

I want to add svn properties (like svn:keyword=Id Date Rev Author) to files upon commits of new files.

For this to work there may be two main options:

  1. Client-side: altering the autoprops in the svn client configuration
  2. Server-side: do some magic with commit-hooks

The client side is not always desirable, as control over the client set up is needed. I want to solve this on the server. How can this be done.

Answer

Dave Bacher picture Dave Bacher · Feb 24, 2010

The Subversion docs say it's a bad idea to modify a commit on the server side.

Instead, you could do something like a customized version of the svn_apply_autoprops script periodically through cron (or even on the server triggered by a commit). The svn_apply_autoprops script is a little more general than what you need, but it should be straighforward to set up the appropriate config file.

As of this post, the subversion web site is migrating under apache.org, and I couldn't find the docs for the contrib tools.