1

I want the functionality of this (SVN Tortoise keyword substitution)

$Rev $

in each and every file of the repository without manually adding the keyword in them.

Is there a way to get the revision number appear in each file without doing all that?

SHPstr
  • 91
  • 9

1 Answers1

1

No. The only way to have keyword substitution on files in Subversion is to:

  • Include the keyword, properly formatted, in each file
  • Set the svn:keywords property appropriately on each file.

If you do not do both of these things, Subversion does not know where to expand the keyword, nor that it has to expand it at all.

alroc
  • 27,574
  • 6
  • 51
  • 97
  • I read somewhere that there is a way to automate this with ANT, but I am not really sure on how to do that. – SHPstr Feb 21 '17 at 12:24
  • Are you referring to this: http://subversion.apache.org/faq.html#version-value-in-source? That's not a Subversion feature, it's something you have to do outside of Subversion's built in functions/features. – alroc Feb 21 '17 at 12:33
  • It doesn't actually have to be a Subversion feature, I just want to get that feature in every file of the repository without the need of manually writing the keyword in each one. This is the comment that I was [referencing](http://stackoverflow.com/a/2329058/6756124) and it goes like this: ` ` Also I would be interested in the negative impact that this could havem if there is any. – SHPstr Feb 21 '17 at 13:29
  • Per the link you provided, you *still* have to do a token replacement, which means you're halfway to just using `svn:keywords` anyway. – alroc Feb 21 '17 at 13:41
  • How about a script to get with the working copy the Rev#? is that doable? – SHPstr Feb 21 '17 at 14:16
  • You tell me - are you capable of creating a script that can do that? Bear in mind that you *still* have to exert some control over *where* in the file(s) your revision number goes, else you run the risk of making the files unusable. – alroc Feb 21 '17 at 20:32