Using Visual SourceSafe – Lock-Modify-Unlock or Copy-Modify-Merge

This article is a part of SourceSafe / VSS Tutorial

VSS supports two modes of work, Lock-Modify-Unlock and Copy-Modify-Merge. Lock-Modify-Unlock is the default style.

The details of Lock-Modify-Unlock mode:

Under this mode, only one developer can check out a file and work on it. Other developers need to wait for the file to be checked in.

  1. Developer A checks out a file, exclusively. An exclusive lock is placed on the file by VSS.
  2. Developer A works on the file.
  3. If Developer B wants to edit the same file, according to the behavior of SourceSafe, he/she needs to check the file out first. Since the file is exclusive checked out (locked) by Developer A, it cannot be checked out by Developer B.
  4. After Developer A is done with the file, he/she checks the file back in. The file is unlocked.
  5. Other developers can check out the file and work on it.

The details of Copy-Modify-Merge

Under this mode, multiple developers can check out a text file not-exclusively and work on it at the same time, which is also called parallel development.

  1. Developer A checks out a file, not-exclusively.
  2. Developer A works on the file.
  3. Developer B wants to edit the same file, according to the behavior of SourceSafe, he/she needs to check the file out first. Since the file is NOT exclusively checked out (locked) by Developer A, the file can also be checked out by Developer B not-exclusively.
  4. If Developer C wants to edit the same file, he/she can also check out the file not-exclusively.
  5. When someone checks in the file, VSS checks if the current version number is the same as the version number when the file was checked out by the current user.
    • If the current version number is the same as the version number when the file was checked out by the user, a regular check in is performed by VSS.
    • If the current version number in the database is bigger than the version number when the file was checked out by the user (which means that someone else has checked in the file after the current user checked out the file), VSS will try to merge the file content first and check in the merged file content into the database.

Icons for different checkout modes

SourceSafe uses different icon for different check out modes as shown in the following screen shot:

  1. Exclusive check out: . In this icon, there is a red box surrounding the icon;
  2. Not-exclusive check out by single user: . In this icon, there is no red box surrounding the icon;
  3. Not-exclusive check out by multiple-user: . In this icon, there is no red box surrounding the icon and there are two ticks in the icon.

How to choose the Lock-Modify-Unlock or Copy-Modify-Merge mode

    1. Multiple check out needs to be enabled at the database side. To enable multiple check out:
      • Start SourceSafe Administrator;
      • Choose menu Tools -> Options, and click the General tab;
      • Check the Allow multiple checkouts checkbox.

The interface is shown as follows:

Enabling multiple checkouts
(Enabling multiple checkouts)

  • After the Allow multiple checkouts option is enabled on the server side, we can choose that if we want to check out a file exclusively on the client side. Please note that binary file can only be checked out exclusively no matter if the Allow multiple checkouts option is enabled or not.

    Allow multiple checkouts at the client side
    (Allow multiple checkouts at the client side)

 

 

SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based Source Control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

 

Links:
Previous article <<<<: Check out in SourceSafe / VSS
Next article >>>>: File Diff in SourceSafe / VSS
SourceSafe How To series home page: VSS / SourceSafe Tutorial

One thought on “Using Visual SourceSafe – Lock-Modify-Unlock or Copy-Modify-Merge

Comments are closed.