How to use custom keywords in SVN

耗尽温柔 提交于 2019-12-04 01:20:47

问题


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?


回答1:


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




回答2:


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




回答3:


I think that keywords are case sensitive. Try this:

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


来源:https://stackoverflow.com/questions/1410029/how-to-use-custom-keywords-in-svn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!