Microsoft KB Archive/814680

= BUG: The contents of a file are not replaced if you use the Replace option when you undo a checkout in Visual SourceSafe =

Article ID: 814680

Article Last Modified on 5/11/2007

-

APPLIES TO


 * Microsoft Visual SourceSafe 4.0 Standard Edition

-





SYMPTOMS
In Microsoft Visual SourceSafe, when you use the Undo Check Out option to cancel the changes that you made to a file, you can select Replace in the Local copy box. However, you may notice that the contents of the local file in your working folder are not replaced with the original contents. You may also notice that the time that the local file was modified is different from the current time.

Note You notice this behavior only if you compare the times on the files and then try to set the dates and the times on the files to the current date and time.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to reproduce the behavior
 Create a folder and a file on your computer:  In the root folder of drive C on your computer, create a folder that is named Test. In the Test folder that you created, create a text file that is named Example1.txt. Type some text in the Example1.txt file, and then save the changes to the file.  Start Microsoft Visual SourceSafe.</li> In the Visual SourceSafe Login dialog box, do the following:  In the Username box, type your user name.</li> In the Password box, type your password.</li> Click OK.</li></ol> </li> Create a project in Visual SourceSafe:  In the All Projects pane, click $/.</li> On the File menu, click Create Project. The Create Project in $/ dialog box appears.</li> In the Project box, type MyProject, and then click OK.</li> In the All Projects pane, click MyProject.</li></ol> </li> Add a file to your Visual SourceSafe project:  On the File menu of Visual SourceSafe, click Add Files. The Add File to $/MyProject dialog box appears.</li> Locate and then click the Test folder that you created in step 1, and then click Add. The Add Folder C:\TEST dialog box appears.</li> Click OK. You receive the following message:

Set C:\TEST as your personal working folder for the project $/MyProject/TEST?

</li> <li>Click Yes, and then click Close. The folder is added to the project in Visual SourceSafe.</li></ol> </li> <li>Set the Visual SourceSafe options: <ol style="list-style-type: lower-alpha;"> <li>On the Tools menu, click Options. The SourceSafe Options dialog box appears.</li> <li>Click the Local Files tab.</li> <li>In the Compare files by box, click Time.</li> <li>In the Set date/time on local files box, click Current.</li> <li>Click OK.</li></ol> </li> <li>Edit the file in Visual SourceSafe: <ol style="list-style-type: lower-alpha;"> <li>In the All Projects pane, click MyProject.</li> <li>In the Contents of $/MyProject/TEST pane, click Example1.txt.</li> <li>On the Edit menu, click Edit File. The File $/MyProject/TEST/Example1.txt dialog box appears.</li> <li>Click the Check out this file and edit it in your working folder option, and then click OK. The Check Out Example1.txt dialog box appears.</li> <li>Click OK. The Example1.txt file opens.</li> <li>Modify the contents of the file, and then save the file.</li> <li>Close the file.</li></ol> </li> <li>Wait for a couple of minutes to make sure that the time that the local file was modified is different from the time on the Date-Time tab in Visual SourceSafe.</li> <li>Right-click Example1.txt, and then click Undo Check Out. The Undo Check Out for Example1.txt dialog box appears.</li> <li>In the Local copy box, click Replace, and then click OK. You receive the following message:

C:\TEST\Example1.txt has changed. Undo check out and lose changes?

</li> <li>Click Yes All.</li> <li>Locate the C:\Test folder, and then open the Example1.txt file.</li></ol>

Notice that the file contains the modified contents. Additionally, notice that the time that the local file was modified is different from the current time.

<div class="references_section">