Auto-properties in Subversion
I'm a big fan of Subversion and use it for nearly every project I work on. I work on our software projects in several ways: On the Linux development server directly, which I access from a Windows desktop using UltraEdit (Load/Save via SFTP), WinSCP, PuTTY, and the command line svn client. On my Windows PC, with Apache 2, PHP5, MySQL 4 and PostgreSQL 8 installed, using TortoiseSVN. On my Windows Laptop, also with Apache 2, PHP5 and MySQL 4, and TortoiseSVN installed, so I can develop and test anywhere I am.
Not too long ago I noticed that the auto-properties in Subversion weren't applied when adding new files in TortoiseSVN on my windows machines.
On the development server where I work some of the time the /etc/subversion/config file looks like this:
[miscellany] enable-auto-props = yes [auto-props] *.php = svn:keywords=Id *.phtml = svn:keywords=Id *.lx = svn:keywords=Id *.mysql4 = svn:keywords=Id *.sql = svn:keywords=Id *.tlx = svn:keywords=Id *.txt = svn:keywords=Id *.css = svn:keywords=Id *.js = svn:keywords=Id
That config file is used by the commandline svn client and makes sure that all file with the listed extensions have their svn:keywords property set to Id.
On Windows, however, the equivalent (actually, the per-user configuration) file is located at C:/Documents and Settings/<username>/Application Data/Subversion/config. This file has the same format as the UNIX equivalent.
If you're not familiar with keyword substitution or the svn:keyword feature at all, you may want to read up on it. I typically stick the following header into every file:
/*
User Signup page
User Management module
Copyright 2004 Lucidix, Inc. All rights reserved.
$Id: signup.lx 2341 2004-11-01 18:04:01Z marcus $
*/
Print This Post