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.
- Developer A checks out a file, exclusively. An exclusive lock is placed on the file by VSS.
- Developer A works on the file.
- 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.
- After Developer A is done with the file, he/she checks the file back in. The file is unlocked.
- 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.
- Developer A checks out a file, not-exclusively.
- Developer A works on the file.
- 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.
- If Developer C wants to edit the same file, he/she can also check out the file not-exclusively.
- 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:
- Exclusive check out: . In this icon, there is a red box surrounding the icon;
- Not-exclusive check out by single user: . In this icon, there is no red box surrounding the icon;
- 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
- 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)
-
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)
The SQL Server-based Source Control Software Designed to be a SourceSafe Replacement
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