Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subversion auto-props woes

This is driving me nuts so any advice from fellow users would be welcome. I am using Subversion, with a copy of VisualSVN 1.6.1 installed on a Windows server. On my PC I am using a combination of TortoiseSVN and the wonderful AnkhSVN Visual Studio plugin. Everything works like a dream, but now I am trying use the svn:keywords feature so I can include $Id$ at the top of all my source files. Now, for existing files I can edit the SVN properties and add this keyword and it all works fine, but I want this done automatically for new files - and I cannot make it work.

According to the documentation you need to edit a special Subversion Config file located in your C:\Documents and Settings\<user>\Application Data\Subversion folder. My PC already had a copy of this file, so I changed it to look like this:

[miscellany]
enable-auto-props = yes

[auto-props]
*.cpp = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.hpp = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.rc = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.rc2 = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.cc = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.c = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.h = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.wsf = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.js = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.htm = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.html = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.css = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision

I then added a new file to an existing Visual Studio project (from within Visual Studio), added $Id$ to the top and committed it - but, alas, the svn:keywords property is not being set.

Does anyone know how to get this working? I even tried adding settings to the registry (in HKEY_CURRENT_USER\Software\Tigris.org\Subversion\Config) but still no joy. I then tried messing with Config files on the SVN server itself, but nothing seems to work.

I have obviously missed something blindingly obvious!

like image 829
Rob Avatar asked Nov 27 '08 10:11

Rob


2 Answers

It seems that the answer is just some silly quotes around the actual keywords :)

[auto-props]
*.cpp = svn:eol-style=native;svn:keywords="Author Date Id HeadURL Revision"
like image 156
LenW Avatar answered Nov 15 '22 13:11

LenW


If you want to be sure you've picked the correct config file, use TortoiseSVN's edit button: Subversion Wiki.

The only similar problem I could find was a user complaining about this not working with uppercase file extensions, but this is for Fedora, not for Windows: link

like image 38
schnaader Avatar answered Nov 15 '22 12:11

schnaader