Enabling Keyword Expansion
Keyword expansion and EOL conversion work correctly for UTF-8 unicode files, which previously could be corrupted on check-in. However, EOL conversion is not supported for UTF-16 or UTF-32 unicode files. The Cross-Platform Client allows you to select a file encoding as you check out a file.
StarTeam supports Log and History Keywords from the StarTeam Server and from the MPX Cache Agent.
Caution: Never use a keyword in a revision comment, as it will be expanded during the keyword expansion process.
To enable keyword expansion, do the following:
-
Choose Project > Properties.
The Project Properties dialog box opens.
- Click the Options tab.
-
Check the Keyword Expansion check box to enable keyword expansion and use keywords in your text files.
This check box applies to files added or checked in from StarTeam or from StarTeam integrations with third-party applications.
-
In Expand Keywords for These File Extensions field, type the file extensions (for example, .bat, .cpp) for which you want to use keywords.
You can use a space, comma, or semicolon as keyword delimiters. The file extensions list can contain a maximum of 254 characters. If you leave this text box blank, no keywords will be expanded.
StarTeam Keywords
By enabling keyword expansion for a project, you can embed keywords within text files. These keywords are automatically expanded during file check-outs, to provide file and revision information within the file. You should use only one keyword per line.
The following table provides descriptions of keywords for use in keyword expansion.
Item | Description |
---|---|
$Author$
|
User who checked in the revision. |
$Date$ and
$DateUTC$ |
Date and time stamps for the revision.
|
$Header$ and
$HeaderUTC$ |
Combinations of Workfile, Revision, Date, and Author.
For Java users,
Even though this header is contained in a Java comment, the Java compiler always looks for \u. The second time you compile foo.java, a compiler error occurs. |
$History$
|
Added to the source file, typically within a comment field. The
// ... // $History // 1 YourProject 1.0 2011-11-19 00:06:57Z Joe Smith // This is a revision comment. // $ StarTeam adds the history information to the file and places it outside of the “$” signs so that it becomes a versioned part of the file. Since the history records become part of the versioned file content, you can delete extra or excessive history records at any time. If this file is modified and checked-in, any subsequent check-out adds one additional record immediately after the
// $History // 2 YourProject 1.0 2012-06-01 00:06:57Z Joe Smith // This is a another revision comment. // $ // 1 YourProject 1.0 2011-11-19 00:06:57Z Joe Smith // This is a revision comment. StarTeam uses the MD5 and local file timestamp of the post-expanded file for sync records. Accordingly, when you check-out a tip revision, StarTeam reports a current status for the file even though a compare tool would show an additional history record in the locally-stored file as compared to the version of the file saved on the StarTeam Server. Important:
Do not delete the standalone
|
$Id$
|
Similar to
|
$Locker$
|
User who has the file exclusively locked (if any). |
$Log$ ,
$Log[x]$ ,
$LogUTC$ , and
$LogUTC[x]$ |
File change history.
Use
Use
|
$NoKeywords$
|
Turn off keyword expansion for the rest of the file. |
$Project$
|
Name of the project. |
$Revision$
|
Revision number (an integer). |
$Folder$
|
Name of the folder. |
$Workfile$
|
Unqualified name of the working file (for example, foo.cpp). |
Caution: Never use a keyword in a revision comment, as it will be expanded during the keyword expansion process.