Die Versionsverwaltung Subversion bietet durch Keywords die Möglichkeit im SourceCode Metadaten von Subversion selbst einzufügen. Folgende Keywords sind möglich:
Date
-
This keyword describes the last time the file was known to have been changed in the repository, and looks something like $Date: 2002-07-22 21:42:37 -0700 (Mon, 22 Jul 2002) $. It may also be specified as LastChangedDate.
Revision
-
This keyword describes the last known revision in which this file changed in the repository, and looks something like $Revision: 144 $. It may also be specified as LastChangedRevision or Rev.
Author
-
This keyword describes the last known user to change this file in the repository, and looks something like $Author: harry $. It may also be specified as LastChangedBy.
HeadURL
-
This keyword describes the full URL to the latest version of the file in the repository, and looks something like $HeadURL: http://svn.collab.net/repos/trunk/README $. It may be abbreviated as URL.
Id
-
This keyword is a compressed combination of the other keywords. Its substitution looks something like $Id: calc.c 148 2002-07-28 21:30:43Z sally $, and is interpreted to mean that the file calc.c was last changed in revision 148 on the evening of July 28, 2002 by the user sally.
Das Setzen der Keywords erfolgt entweder mittels
svn propset svn:keywords “Date Author” weather.txtoder über TortoiseSVN im Eigenschaftendialog des Explorers (siehe Bild).
Damit auch neue Dateien mit den korrekten Keywords versehen werden, muss die Konfigurationsdatei für Subversion (über TortoiseSVN Settings – Edit configuration file) angepasst werden. Zuerst ist dabei folgende Einstellung zu setzen:
enable-auto-props = yesund anschliessend können default Eigenschaften für bestimmte Dateitypen definiert werden:
*.cs = svn:keywords=HeadURL LastChangedBy LastChangedRevision LastChangedDate*.aspx = svn:keywords=HeadURL LastChangedBy LastChangedRevision LastChangedDateIm Source Code selbst müssen an der gewünschten Stelle die entsprechenden Keywords mit $-Zeichen umgeben platziert werden:
$HeadURL$ $LastChangedDate$ $LastChangedRevision$ $LastChangedBy$
Subversion