How to use custom keywords in SVN
Asked Answered
L

3

8

I'm using a VisualSVN server and TortoiseSVN client. I have set the properties

svn:keywords = Author Id Revision LastChangedDate Copyright
copyright = (c) 2009 Foo Company.

Then, when I try to use these properties in the header file (including the custom property Copyright), I do it like:

/******************************************************************************
* $Id$
* 
* $Author$
*
* $Revision$
*
* $LastChangedDate$
*
* $Copyright$
******************************************************************************/

Every property is getting substituted right, except for the Copyright. What am I still missing?

Lowerclassman answered 11/9, 2009 at 9:50 Comment(0)
B
11

Prior to SVN 1.8, custom keywords were unsupported by SVN.

Here are the supported keywords, and how they work. http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.keywords.html

Custom keywords had been a feature request for some time. http://subversion.tigris.org/issues/show_bug.cgi?id=890

The feature was finally added as of SVN 1.8 (thanks MarkusSchaber). https://subversion.apache.org/docs/release-notes/1.8#custom-keywords

Boggle answered 11/9, 2009 at 15:10 Comment(3)
Thanks for the information. It seems that there are patches that allow to do that, so perhaps this will work in future releases.Lowerclassman
It works in SVN 1.8, see subversion.apache.org/docs/release-notes/1.8#custom-keywordsUxorial
@Uxorial Thanks for pointing that out. Updated my answer accordingly.Boggle
S
1

You need the correct syntax. i.e. it's not $Id$, you need $Id: $. Then the value gets put here: $Id: value $

Saks answered 14/6, 2011 at 11:5 Comment(1)
Seems you're right and I was wrong. I'm sure I used to have trouble with $Id$ etc. Maybe I had a dodgy SVN client.Saks
S
-1

I think that keywords are case sensitive. Try this:

svn:keywords = Author Id Revision LastChangedDate Copyright
Copyright = (c) 2009 Foo Company.
Sweater answered 11/9, 2009 at 10:2 Comment(1)
I'm missing something else because it still doesn't work. Thanks!Lowerclassman

© 2022 - 2024 — McMap. All rights reserved.