What is VSS?
Source code version control mechanism is one of the essential management mechanisms in modern software development, which is usually realized by means of version control software, that is, source code management (SCM) system or version control system. The important functions of version control in software development are as follows:

1), as a code warehouse, can effectively manage different versions of source code and documents in software development, occupying less space and facilitating the acquisition of different versions of codes and documents.

2) Effectively coordinate the access to source code in the development team (different versions of control software adopt different coordination strategies).

Commonly used version control software includes Microsoft Clearcase, CVS, PVCS and Visual SourceSafe (VSS). Here is a brief introduction to Visual SourceSafe 6.0, which is the most commonly used in the development of Windows platform.

Runtime environment

The typical environment of VSS development under Windows platform is based on C/S architecture, that is, each developer of the development team uses development tools (such as VC) to develop each module in the project under his own Windows platform, and is equipped with a special server to centrally control the documents and codes in the development process. The server and the developer's client are respectively equipped with VSS server and client program.

fixed

Install VSS6.0 server

Step 1, put the CD 1 of Visual Studio6.0 into the CD, automatically enter the installation program, and select the second item "server applications and tools (add only)";

Step 2, then select "Visua l Source Safe Server" in "Server Components" of "Server Settings", press "Install" button, and insert CD2 according to the prompt;

Step 3, according to the prompts of the installation wizard, continue the installation process and select the installation path, and restart the computer until the restart is prompted.

Install VSS6.0 client

After installing VSS6.0 server, you can install client software under the guidance of VSS administrator. Since we are in the subnet of Windows environment, every PC client can access VSS server through online neighbors. After the VSS administrator points out the location of the installation program "Netsetup.exe" of VSS client software for the user (under the installation directory of VSS server), the user can directly find the program in the online neighborhood through the resource manager "Resource Manager" and double-click to run it. After Netsetup.exe started, he entered the installation of VSS client. Enter the user name and workgroup name in the prompt box, select the installation path of VSS, and click the installation icon to enter the actual installation steps. The future work will be completed automatically by the system.

explain

VSS should follow the lock-modify-unlock process, rather than the copy-modify-merge process (such as CVS), that is, the developer first checks out the source code and documents he wants to modify from the main backup file of VSS server, and locks them locally (except in the case of multi-checkout), then checks them out to the server and unlocks the files on the server at the same time. The server centrally controls all source programs and documents.

Concepts involved in the use of VSS

1) project, the so-called project is a set of files (of any type) stored in VSS, which can be added, deleted, edited and * * * enjoyed within or between projects. A project has many similarities with folders in the operating system, but it better supports file merging, history and version control. All files are stored in the project of VSS database. Members of the development team cannot operate the server master backup file in VSS (except for special cases such as checking and version comparison), but VSS will provide each member with a copy in their respective workfolder for work use. Although you can view files without a working directory, if you really want to work under VSS management, you must create a working directory.

2) workfolder is the place where users really debug and modify project files. When a user checks out a file, VSS copies the file to the user's working directory. When a user modifies files and checks them in, VSS copies them from the user's working directory back to the VSS database. When the user checks out, VSS will automatically manage his working directory, such as creating necessary subdirectories. And you can create or modify the working directory at any time.

3) Version tracking. VSS provides version control and historical services, and can retrieve old versions of programs and documents for error tracking or other purposes. VSS uses date/timestamp to record the check-out or modification time of files. There are three main ways to track the versions of files and projects:

Version number: This is an internal number maintained by VSS, and the user has no control over it. Each version of each file and project has a version number, which is always an integer and is increasing.

Label: a character string assigned by a user to a certain version of a project or file. It can be a character string in any format, and the length does not exceed 3 1 character. Recommended use.

Date/Time Stamp: It gives information about the time when the file was last modified or checked in. VSS supports 12 hours and 24 hours.

Configuration and management of VSS6.0 server

After the installation of VSS6.0 server is completed, the VSS server can be configured and managed for the development project, which needs the VSS administrator to complete.

The first step is to create a VSS database for the whole project (a default public database was created when the VSS server was installed). Start Visual SourceSafe 6.0admin (Start/Program/Microsoft Visual Studio 6.0/Microsoft Visual SourceSafe 6.0admin) and jump out of the dialogue window. Click the menu item "Create Database" ... In the tool drop-down menu, a dialog window will appear. Select the path of the new database, for example, create a MyApp database, and then click OK to finish the creation.

Step 2: To create a user for a newly created database (such as MyApp), first open the database, click the drop-down menu Users/Open SourceSafe Database ..., then select the database MyApp and open it. Then select the menu item "Add User" ... and enter the user name and password. Then create other users in turn. You can set different project folder access rights for different users. There are two ways: 1) Use the function provided by VSS. In the Tools/Options ... dialog box, select the Enable Project Security check box of the Theme Security property page, and then select Tools/Project Permissions ... or Tools/User Permissions Assignment ... to set it; 2) Use the cacls command of windows operating system.

Step 3, create a project in the newly created database. Start Microsoft visual sourcesafe 6.0 (Start/Programs/Microsoft Visual Studio 6.0/Microsoft Visual SourceSafe/Microsoft Visual SourceSafe 6.0), and a dialog window will appear. Click open SourceSafe database in the drop-down menu file to pop up a dialog box, select a database (such as MyApp), and double-click or press the open button to open it; A project is a collection of related documents or files. VSS allows you to store and organize projects in any hierarchy. In VSS database, you can create one or more projects. Click the command "Create Project" ... to create a project in the menu file, such as MyProject;; After creating the project MyProject, you need to add files to MyProject. Click the Add File command in the file to open a dialog box, select the corresponding file or directory, and click the Add button to add it to my project.

So far, the configuration of VSS server has been basically completed, and databases and projects have been created, and corresponding users have been established for them. Users can log in to VSS server directly at the client and carry out development work under the control and management of VSS.

Note: The directory structure of the server master backup file should be determined before the project development and agreed by all developers. In practice, if the directory structure of server master backup files is unreasonable or some files need to be added or deleted temporarily, VSS administrators have the responsibility to deal with them centrally.

Using VSS6.0 client

The following illustrates the steps of using VSS client through a specific example of a laboratory data warehouse project.

The first step is to log in to the VSS server. Start the Microsoft Visual SourceSafe6.0 client (Start/Programs/Microsoft Visual Studio 6.0/Microsoft Visual SourceSafe/Microsoft Visual SourceSafe 6.0), and the following login window will appear;

Click Browse … to open the following dialog box;

Click Browse… and select the directory shown below (* * * shared directory on the DBGROUP server, and fill in VSS/VSS); If prompted for the password of the database group server account, enter it separately);

Click the Open button, and then click OK and Open in the two subsequent dialog boxes;

Return to the login dialog box;

Enter the user name and password specified by the administrator, that is, log in to VSS server.

Note: Different users and password settings have different access rights to different projects.

Step 2: When logging in to VSS server for the first time, you need to set the working directory first, otherwise you can't check out.

The setting of the working directory is shown in the figure below. Select the folder of related modules, right-click and select Set Working Folder.

Select the working directory you set in the pop-up dialog box, and click OK;

Note: After setting the working directory, all files on the server will be put into the working directory after being checked out, so it is necessary to protect the working directory on the local machine from being deleted and moved at will.

Step 3, check out the file to the local working directory. Select the relevant folder, right-click and select "Check out ...";

The system pops up the following checkout dialog box. After clicking OK, all files and subfolders in this directory will be checked out to the local working directory. At the same time, the files on the server are locked in red, and other users can no longer check out the folder (the server is set to not allow multiple checkouts).

Note: Be sure to select the Recursive check box to ensure that all subfolders are checked out.

The fourth step is to modify and debug the files in the local working directory.

Step 5, check in the files in the working directory. If the modified file is not checked in, then the modification of the file in the fourth step cannot be reflected in the master backup of the project file on the server, and it is very likely that the local file will be overwritten by the old version file after the next check out. Select the folder to check in in the VSS client window, right-click and select "Check in …" to pop up the check-in dialog box. Click OK, the files in the local working directory will be checked in to the server, and the files on the server will be unlocked (blackened).

Note: Make sure that the Recursive check box is selected to ensure that all subfolders are checked in.

Suggestion 1

In the actual use process, developers or administrators have the responsibility to mark the source programs and documents on the server regularly or irregularly, so as to manage the version history of the source programs and documents. VSS can easily obtain the version history according to the tag (there are other ways to obtain the version history, and this article recommends using the tag method).

Add a tag. Select the item to be tagged, and right-click to select the tag …;

Fill in the label name and related comments in the set label dialog box, as shown in the figure below;

If you want to obtain the version history, please select the corresponding item and select Show History .............................................................................................................................................................

VSS pops up the following dialog box, listing all labels made by administrators, selecting the corresponding labels, and then clicking the Get button to make the corresponding version of labels and check them out to the local working directory. For the usage of other buttons, please refer to the help;

Recommendation 2

Developers should not arbitrarily change the structure of the project on the VSS server, do not add or delete files in the project, and do not access other people's projects and files. If the project structure on the server really needs to be changed, please contact the administrator.

Recommendation 3

Strictly abide by the usage rules of VSS to prevent the loss of programs or files due to misoperation. If two people need to modify the unified directory (project) or file at the same time, please process it serially instead of checking out more to reduce the chance of mistakes.

Bi Ran

2003-4- 15