How Visual SourceSafe's Merge Process Works

Last reviewed: November 14, 1996
Article ID: Q159270
The information in this article applies to:
  • Microsoft Visual SourceSafe, 16-bit and 32-bit, for Windows, versions 4.0, 4.0a
  • Microsoft Visual SourceSafe, 32-bit, for Windows, version 5.0

SUMMARY

This article explains how the merge process works in Visual SourceSafe. The merge process requires three files: an original, and two modified versions of the original. During the merge process, Visual SourceSafe makes two comparisons: one between the original file and the first modified version, and another between the original file and the second modified version. If a change is made in only one file, the change is inserted into the merged file. If there are changes in both files in the same location, then a conflict exists. The user must resolve a conflict manually.

MORE INFORMATION

The first file is a snapshot of the file at the point it was branched. This file is maintained by Visual SourceSafe. The second and third files are the current versions of the original file that are located in the two branches that you want to merge, for example:

Branch1     Branch2
-------     -------

 A           A
 B           B
 C           D
 D           E
 E

Visual SourceSafe determines whether "C" was added to Branch1 or deleted from Branch2 by looking at the first file and determining whether a deletion or addition occurred.

To understand how the merge process works, assume that the file looked like the following when it was branched:

Original

A B C D E

If you merge Branch1 into Branch2, the result is as follows:

Branch1     Branch2
-------     -------

 A           A
 B           B
 C           D
 D           E
 E

During the merge, Visual SourceSafe moves any changes in Branch1 into Branch2. No changes were made in Branch1. Therefore, both files remain unchanged.

If you merge Branch2 into Branch1, the result is as follows:

Branch1      Branch2
-------      -------

 A            A
 B            B
 D            D
 E            E

During the merge, Visual SourceSafe moves any changes in Branch2 into Branch1. "C" was deleted from Branch2. Therefore, the change is reflected in Branch1.

Note that Visual SourceSafe assumes incremental changes were made to both of the changed files. When you merge files that are entirely different, you might get unexpected results.

REFERENCES

"Microsoft Visual SourceSafe User's Guide," versions 4 and 5, Chapter 6.


KBCategory: kbusage kbhowto
KBSubcategory: ssother
Additional reference words: 4.00 4.00a 5.00 kbdss



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 14, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.