Subversion auto-props woes

Rob picture Rob · Nov 27, 2008 · Viewed 7.5k times · Source

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!

Answer

LenW picture LenW · Nov 27, 2008

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"