Use keywords of CVS to maintain code information

Source: Internet
Author: User

Generally, when writing code, we will write some help information in the Code header, such as the following file date, version number, author, etc.

/**
* $ Date: 2005/07/18 08:49:35 $
*
* @ Author cap
* @ Version $ revision: 1.7 $
*/

If you are using CVS to maintain your code, you can use the keyword replacement function of CVS to help maintain this information, because they are dynamically updated, so it is very convenient to maintain, for example, $ revision $ indicates the version number on CVs. In fact, this version number can also be used as the version number of our file. All we need to do is to write the following keyword mark.

/**
* $ Date $
* @ Version $ revision $
*/

After CVS is submitted, the file is automatically updated

/**
* $ Date: 08:49:35 $
* @ Version $ revision: 1.7 $
*/

It is very convenient. These keywords can be placed in the comments of Java code. At the same time, you should avoid such variables in Java code. Otherwise, they will be replaced, resulting in unexpected results. Below is a list of these keywords.

$ Author $ User Name
$ Data $ registration time
$ Header $ Standard Header, including the full path name, date, and author of the RCS
$ ID $ except for incomplete names of the RFM file, it is the same as $ header $.
$ Log $ contains the full path name, version number, date, author, and log information provided at the time of submission of the RCS.
$ Rcsfile $ name of the file that contains the RCs, excluding the path name
$ Revision $ assigned version number
$ Source $ full name of the RCS File
$ State $ status of the allocated version, which is allocated by CVS admin-s.

These are all useful keywords. Of course there are more. You can view them here. If you want to disable the keyword replacement function, refer to here

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.