It is currently 07 Sep 2025, 22:53
   
Text Size

Subversion expansion tag

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Subversion expansion tag

Postby spr » 06 Aug 2013, 01:22

There is a very useful expansion tag I have noticed in the code -

Code: Select all
 * @version $Id: CardFactoryUtil.java 22806 2013-08-05 18:02:21Z Sloth $
I added it to some new code I recently committed as "@version $Id$" but it does not seem to have expanded. If someone can confirm what the correct syntax is that would be awesome!

Cheers,
Steve
User avatar
spr
 
Posts: 213
Joined: 06 Jul 2013, 19:31
Has thanked: 28 times
Been thanked: 60 times

Re: Subversion expansion tag

Postby friarsol » 06 Aug 2013, 01:44

I believe it's $Id:
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Subversion expansion tag

Postby spr » 06 Aug 2013, 18:11

friarsol wrote:I believe it's $Id:
Nope. Tried "$Id:" and "$Id:$". Remains resolutely unexpanded. :?

Cheers,
Steve
User avatar
spr
 
Posts: 213
Joined: 06 Jul 2013, 19:31
Has thanked: 28 times
Been thanked: 60 times

Re: Subversion expansion tag

Postby friarsol » 06 Aug 2013, 18:26

spr wrote:
friarsol wrote:I believe it's $Id:
Nope. Tried "$Id:" and "$Id:$". Remains resolutely unexpanded. :?
It only expands when you commit, and you need to make sure the files have their svn:keywords set appropriately for that file.

http://svnbook.red-bean.com/en/1.4/svn. ... words.html

You do need the ending $ as well.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Subversion expansion tag

Postby spr » 06 Aug 2013, 18:44

Thanks for the link. I just assumed it would be some server setting but it looks like I will need to run the following for each file I want substitution to take place in. I will give it a go next time I commit.

Code: Select all
svn propset svn:keywords "Id" <filename>.java

EDIT: and for this to work <filename>.java must have been checked into subversion at least once. It will fail if the file does not yet exist in subversion.
EDIT: and it works! Finally! :D
EDIT: just to confirm the tag is "$Id:$".

Cheers,
Steve
User avatar
spr
 
Posts: 213
Joined: 06 Jul 2013, 19:31
Has thanked: 28 times
Been thanked: 60 times


Return to Developer's Corner

Who is online

Users browsing this forum: Google [Bot] and 25 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 26 users online :: 1 registered, 0 hidden and 25 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: Google [Bot] and 25 guests

Login Form