How to: Enable Keyword Expansion
Keyword expansion is a process that Visual SourceSafe uses to replace a keyword with meaningful header information when you use the Check In and Add Files commands. For example, the string "$Revision: $" tells Visual SourceSafe to expand the Revision keyword automatically with the current file version number.
Keyword expansion is by default disabled for all files. As Visual SourceSafe database administrator, you must enable keyword expansion from the Visual SourceSafe Administrator program or the Srcsafe.ini file for the database. Make sure to enable keyword expansion for standard text and HTML files only. Keyword expansion used in a binary file will corrupt the file.
Because keyword expansion requires Visual SourceSafe to scan each file for keywords, it can considerably slow down the Check In and Add Files commands.
To enable keyword expansion from Visual SourceSafe Administrator:
In Visual SourceSafe Administrator, on the Tools menu, click Options.
In the SourceSafe Options dialog box, click the General tab.
In the Expand Keywords in Files of Type box, enter the types of files in which you want keyword expansion to occur, for example, *.txt. If you use more than one extension, separate the entries with commas, for example, *.txt, *.c, *.vb.
Quit Visual SourceSafe Administrator and tell your users to close and restart Visual SourceSafe Explorer for the changes to take effect.
To enable keyword expansion from Srcsafe.ini:
Access the Srcsafe.ini file for the database.
Find the first occurrence of a section header, for example, [$/MyProj].
Before this header, add Keyword_Masks = *.<extension>. If you use more than one extension, separate the entries with commas. See Keyword_Masks Initialization Variable.
Add a [Keyword Comments] block to the Srcsafe.ini file to identify the comment characters that Visual SourceSafe will place before and after the History and Log keywords used in text and HTML files. You can find general information about these comments in Keyword Expansion Support.
The following example shows a code block for a Srcsafe.ini file that identifies the comment characters for use with .cpp and .cs files. For an example Srcsafe.ini file, see Database Design.
[Keyword Comments] *.cpp = "//" *.cs = "//"