Microsoft KB Archive/157813

= FIX: Branch or Rollback of Shared File May Cause Corruption =

Article ID: 157813

Article Last Modified on 10/20/2003

-

APPLIES TO


 * Microsoft Visual SourceSafe 4.0 Standard Edition
 * Microsoft Visual SourceSafe 4.0 Standard Edition

-



This article was previously published under Q157813



SYMPTOMS
When you Branch or Rollback a shared file that uses Keyword Expansion, previous versions of that file may become corrupt. The corruption will be seen in all versions two or more behind the current version of the file. For example, if you have a shared file that uses Keyword Expansion that contains 10 versions and you Rollback that file to version 8, versions 1 through 5 may be corrupted.



CAUSE
This problem occurs when a Branch is executed on a file that uses Keyword Expansion. When you Rollback a shared file, Visual SourceSafe actually performs a branch in conjunction with the Rollback. It is this Branch that results in the problem, not the Rollback itself.



RESOLUTION
Do not use Keyword Expansion or do not Rollback a file that uses Keyword Expansion in versions prior to 4.0.



STATUS
Microsoft has confirmed this to be a problem in Visual SourceSafe version 4.0 and 4.0a for Windows. This problem was corrected Visual SourceSafe for Windows, version 5.0.



Steps to Reproduce Problem
 Use an ASCII text editor, such as Notepad, to create a new text file.  Add the following text to the beginning of line 1: $History:: $   Add the following text to the beginning of line 2: This is my entry for version 2  Save the file and add it to a Visual SourceSafe project. Share the file with another Visual SourceSafe project or subproject.</li> Check out the file from Visual SourceSafe.</li>  Add a new line to the checked out file that reads: This is my entry for version 3 </li> Save the changes and check the file back into Visual SourceSafe.</li> Repeat steps 6 through 8 until you have added a total of 6 versions of comments in the file.</li> Branch off the shared copy of the file.</li> Right-click on the branched copy of the file, and then choose Show History.</li> Do a View on any version two or more versions behind the branched version. For example, if version 6 is the branched version, note that version 4 or earlier of the file has missing data.</li></ol>

NOTE: The problem would also occur if you were to replace step 10 above with a Rollback because Visual SourceSafe would perform a Branch at this point.

<div class="references_section">