This documentation is archived and is not being maintained.

How to: Enable Keyword Expansion

Visual Studio 2005

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.

Caution noteCaution

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:

  1. In Visual SourceSafe Administrator, on the Tools menu, click Options.

  2. In the SourceSafe Options dialog box, click the General tab.

  3. 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.

  4. Click OK.

  5. 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:

  1. Access the Srcsafe.ini file for the database.

  2. Find the first occurrence of a section header, for example, [$/MyProj].

  3. Before this header, add Keyword_Masks = *.<extension>. If you use more than one extension, separate the entries with commas. See Keyword_Masks Initialization Variable.

  4. 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.

Example

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 = "//"

See Also

Show: