Using Visual SourceSafe - Add operation of SourceSafe
This article is a part of SourceSafe / VSS Tutorial
Navigation Links: Add introduction Differences between SourceSafe 6 and 2005 Store only latest version File type filter Binary or not
A file must be added in a VSS database first before you can do check in, check out and other operations. To add one or more files, you can click Add File on the File menu or use drag and drop from Windows Explorer to SourceSafe Explorer.
You can also add a whole folder into SourceSafe recursively. If there are some files or sub projects in VSS already, VSS keeps the existing files and sub projects and only adds the ones not in VSS.
Differences between SourceSafe 6 and 2005
- Different interface The dialog boxes of Add File in SourceSafe 6 and 2005 are quite different:
(Add File dialog box in VSS 6)
(Add File dialog box in VSS 2005)
- Folder cannot be added in the VSS 2005 Add File dialog box. You can use Drag and Drop to add folders to VSS.
- The files already under version control are not filtered in the VSS 2005 Add File dialog box. In the VSS 6 Add File dialog box, only the files not in the VSS database are shown. But in VSS 2005, all the files are shown. This is very inconvenient if you have tens of or even hundreds of files. For example, if you have 100 files in the VSS database already and newly added 2 files. To add the 2 new files into VSS, in VSS 6, you will see only 2 files in the Add File dialog box. But in VSS 2005, you will see 102 files and you must find the 2 new files.
The Microsoft Visual SourceSafe team is aware of this issue and they have an undocumented secret feature. By pressing the Shift button and then launch Add File dialog box, the classical VSS 6 style Add File dialog box will be brought up.
Store only latest version
There is a Store Only Latest Version option in the Add File option dialog box:
(Store only latest version option)
If this option is selected, only the file content of the latest version is stored. Even though the history information is stored as usual, when you want to retrieve the file content of the previous version, a “File [%filename] does not retain old versions of itself” error will be shown.
Since only the file content of the latest version is stored when this option is selected, the VSS database is smaller and the operations can be faster.
This option is useful when we use VSS to store files but do not care about the previous versions. For example, every time when we build a new release for our test team, we add the executable file to VSS. For this executable file, it may be desirable that we select the Store only latest version option.
You can use the following dialog box to change the option:
(File property – Store only latest version)
File type filter
In the Add File dialog box, you can use File Type combo box to filter the files, which makes it easier to find the files you are looking for:
(File type filter in VSS 2005)
(File type filter in VSS 6)
You can manage the file type group through SourceSafe Administration tool and SourceSafe Explorer. The settings specified in the SourceSafe Administration tool affect all users. The settings in the SourceSafe Explorer affect only the current user. To set file type group, select Tools -> Options menu and go to File Types tab:
(File type group)
Binary or not
In the Add File dialog box, you can specify that the file is binary:
There are two kinds of files: binary file or not-binary file (also called mergeable file). There are two important differences between binary files and mergeable files:
- Binary files cannot be checked out by multiple users. Even if the Allow multiple checkouts option is enabled, VSS always places exclusive lock on binary files. For mergeable files, if the Allow multiple checkouts option is enabled, multiple users can check out the files. Usually, all the program files are mergeable.
- Binary files cannot be visually diffed. For binary files, when you do a diff, SourceSafe only tells you if the files are the same or not. For mergeable files, SourceSafe tell you which lines are untouched, which lines are changed:
You can also choose Auto-Detect to let SourceSafe decide if a file is binary or not. When you choose Auto-Detect, VSS does the following to determine if a file is binary:
- If the file type is in the binary file extension list, the file is a binary file. Or else, go to step 2. The binary file extension list can be specified in the following interface:
(Binary file type)
- If the file contains a byte with a value of 0, the file is a binary one. Or else, go to step 3
- The file is mergeable. You can also change the file type after the file was added into VSS database:
(File type in file property dialog box)
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 ««: Working folder in SourceSafe / VSS Next article »»: Get Latest in SourceSafe / VSS SourceSafe How To series home page: VSS / SourceSafe Tutorial