Revision number of a file is an important information.修訂編號的文件,是一個重要的信息。 Two most common uses are in serialization and in making version specific database upgrades for an application.兩個最常見的用途是在系列化,並在作出特定的數據庫版本升級為一的應用。 I am using it for the later.我用它為以後。 Here is a simple way how you can add revision number (Id, Date, Author and HeadURL) automatically to your source files.這裡是一個簡單的方式如何,您可以添加修訂編號(編號,日期,作者和headurl )自動下載到您的源文件。

First you need to add the keyword anchor at the desired location in the file.首先您需要添加關鍵字停泊在理想的位置,在該文件。 For example to get Revision information you must add $Rev$ or $Revision$ to your chosen location.例如,以獲得修改的資料,您必須添加元,馮智活元或美元,修訂為您選擇的位置。

Note: The keywords are case sensitive.注:關鍵詞是區分大小寫的。

Then you need to inform Subversion that these keyword(s) need to be substituted in your chosen file.然後您需要通知顛覆這些關鍵字( )需要加以取代,在您所選擇的文件。 For example if you have added the $Rev$ keyword to translator.php.例如,如果您有補充, 美元馮智活元關鍵字translator.php 。 Then you run propset command as follows:然後運行propset命令如下:
svn propset svn:keywords “Revision” translator.php svn propset svn :關鍵字“修訂” translator.php

You are done!你這樣做!
Now, after commit, your $Rev$ keyword will be automatically replaced with something like:現在,經過承諾,您的馮智活元元的關鍵字將自動取代的東西,例如:

$Rev: 130 $元,馮智活: 130元

Note: The number will be automatically updated whenever anyone commits a new revision.注:數目將自動更新時,任何人犯下了新的修訂。

The list of keywords (from Subversion documentation) along with their alternatives are:關鍵字清單(由顛覆文件)隨著他們的選擇是:

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) $.這個關鍵字描述了最後一次的檔案被稱為已改變,在存放,並期待像元日期: 2002年7月22日21時42分37秒-0700 (星期一, 2002年7月22日)美元。 It may also be specified as LastChangedDate .它也可以被指定為lastchangeddate

Revision修訂

This keyword describes the last known revision in which this file changed in the repository, and looks something like $Revision: 144 $ .這個關鍵字描述了最後為人所知的修訂,在此文件的改變,在存放,並期待的東西一樣, 元版次: 144元 It may also be specified as LastChangedRevision or Rev .它也可以被指定為lastchangedrevision馮智活

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 .它也可以被指定為lastchangedby

HeadURL 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 $ .這個關鍵字描述了完整的URL到最新版本的文件,在存放,並期待像元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.其替代看起來像元編號: calc.c 148 2002年7月28日21時30分43秒z薩利元,並解釋為意味著該文件calc.c的最後修改,在修改148對日晚2002年7月28日由用戶莎莉。