How To Add Revision Number, ID Automatically To Subversion Files in Two Simple Steps如何添加修订编号,编号自动颠覆文件在两个简单的步骤
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日由用户莎莉。
Filed under提起下 Headline News头条新闻 , , How To如何 , , Open Source Software开放源码软件 , , Tech Note技术说明 , , Technology技术 | |
| |
RSS 2.0 2.0 | |
Trackback Trackback跟踪 this Article |此文章|
Email this Article电子邮件此文章
You may also like to read您也可以想读 |




