How to use keywords in SVN (TortoiseSVN)

I cannot make a document using the Keyword Replacement tool to have only a few data: -Date -Revision Aut -HeadURL -Id

I am doing a test, but I cannot implement keyword substitution. I created a Txt document with the following information:

svn:keywords = Date Revision Author HeadURL Id $Id: $ $Revision: $ $Author: $ $HeadURL: $ $Date: $ 

I do not know if it should be implemented in a txt file or in another format.

I am using TortoiseSVN and Subversion Edge tools.

+7
source share
4 answers

You must use the correct workflow and syntax

  • Add svn property to file (as Ken noted)
  • Use the correct syntax for included keywords inside a text file

$Revision$ $Date$ $Author$

+7
source

You have done half what you need. Now you need to use svn propset to do the rest, as shown in the documentation , about halfway down the page:

You have done this part:

For example, let's say you have a versioned file called weather.txt that looks like this:

 Here is the latest report from the front lines. $LastChangedDate$ $Rev$ Cumulus clouds are appearing more frequently as summer approaches. 

Now you need to do the other half:

If the svn: Keywords property is not set for this file, Subversion will not do anything special. Now let me enable the LastChangedDate keyword replacement.

 $ svn propset svn:keywords "Date Author" weather.txt property 'svn:keywords' set on 'weather.txt' $ 

The easiest way to set these properties using TortoiseSVN is to right-click the file, select TortoiseSVN->Properties from the pop-up menu, and then configure it there. You can find this information on the Project Settings page of the project in the TortoiseSVN documentation ; see SVN keywords about 2/3 of the way down the page. (There is no binding, but you can search for the page as soon as you get there.)

+10
source

So, if you want the Author , Date , Rev i , to be part of the SVN version file, you need to add the SVN Key to this file. So my initial file is called example.xls , this is until the first commit !!!

With content

 <!-- $Rev:: $: Revision of last commit. $Author:: $: Author of last commit. $Date:: $: Date of last commit. --> <abv:container xmlns:abv="http://my_org/odel/common"> <abv:object xmln .... 
  • You must set the keyword substitution in your file, so for this purpose, if you are a user of Tourtoise SVN, right-click on the example.xsl file

enter image description here

  1. Choosing New Keywords enter image description here

  2. Choose option, date, author enter image description here

  3. So now, when you commit this file, if the comment <!-- SVN does not add the necessary values ​​after :: . So, after committing, the file will look like this:

     $Rev:: 938 $: Revision of last commit. $Author:: Xelian $: Author of last commit. $Date:: 2016-07-11 11:21:26#$: Date of last commit. 
+7
source

Today I ran into the same problem, but the syntax and properties were correct.

In my case, the problem was depending on the encoding of the file (it had UCS-2 LE BOM). I converted the file to ANSI and the keywords became replaced.

0
source

All Articles