Subversion and the tag $Id$
1. Subversion and the $Id$ keyword.
This file hopes to help you on the configuration of the subversion for updating the $Id$ keyword on the existing files and the new ones you will create.
1.1. Requirements
Having the subversion client installed.
1.2. Subversion Configuration
Edit your ~/.subversion/config and type something like this:
[miscellany]
...
enable-auto-props = yes
[auto-props]
*.java = svn:keywords=Id
*.cfg = svn:keywords=Id
*.sh = svn:keywords=Id
*.xml = svn:keywords=Id
*.txt = svn:keywords=Id
*.gnp = svn:keywords=Id
You can add at the end of the line, separated by blanks, other keywords: Rev Date Author
1.4. Commiting new files
The above configuration is sufficient for expanding the $Id$ tag. Nothing else is required. For committing changes already in Subversion where the tag is not expanded, see Section 1.5.
1.5. Committing Changes
Whenever you commit your changes to the subversion repository, the $Id$ field will be updated accordingly. You do NOT need to do anything else.
If you want to use the $Id$ tag in files already in Subversion, you need to do a step before committing your changes:
$ svn pset svn:keywords "Id"
or
$ svn -R pset svn:keywords "Id"
for set the keywork 'Id' on the given file, or directory. You can also use wildcards, like:
$ svn pset svn:keywords "Id" *.txt
or
$ svn pset svn:keywords "Id" src/*.java
to update the corresponding files by extension.
Example of expansion:
$Id: A_FILE.txt 61 2008-11-25 09:51:32Z jordi $
