Sunday 12 December 2010

SVN Keywords

I just realised that my townguide files are no longer automatically updating their SVN keywords to record the revision number of the files.
It turns out that this is because the keyword properties in svn is set by the client, not the repository, and worse still you can not apply keyword properties to directories - you have to do each file individually.
I got around this by using the find command to add keywords to all of the python files by doing:

find . -name \*.py -exec svn propset svn:keywords "LastChangedDate Rev Author" '{}' \; 
Of course for files that do not have keywords set you have to edit them to add $Rev$ etc. into the comments.

No comments: