Linux CVS Server + JCVS-5.3.2 Client Distributed Development (1)

zhaozj2021-02-08  369

Linux CVS Server JCVS-5.3.2 Client Distributed Development

I. Concept of version control and introduction of several version control tools

1. The concept of the source file and the version of the version

Source file is a software most important component unit, so the management of the source file is also the most important part of the entire software composition management. It is the key to high-efficiency software development. To manage the source file, you must perform the source file Name. It is usually considered to require only file name. In fact, the label for the source file under a version maintenance tool consists of two parts: file name and version. That is: the source file can be used to represent {filename, version} ;

The so-called version, the general software developers have an intuitive understanding, but it is difficult to make accurate definitions. Version refers to the potential existence of specific instances of a particular object. A particular object here is versions Maintenance tool management, such as software constituent units, generally referring to source files. The specific example refers to a real copy of the software developer's software constituent unit recovered from the software storage room with certain content and properties.

Define the version into a potential existence is based on the following considerations: the version as a representation of the source file, the software personnel actually wants the different versions of different source files, so the version is an abstraction. It uses To define a specific instance of content and properties. That is to say, the version is a potential existence of a specific instance, which is an abstraction of the source files.

With the understanding of the version concept. Everyone has a certain understanding of the version maintenance tool: version maintenance tool should be transparent to the developer's storage method to developers, the developer does not need to understand the software repository In the source file, only what kind of source file is needed and what kind of source file to store, the version maintenance tool is automatically completed. The theory of version maintenance also includes: version of space, dimension, version Representation, storage, merge, etc., because we mainly explain the CVS Linux server, so everything is from simple, interested friends, you can read the relevant books.

The CVS mentioned in this chapter is such a powerful tool. We will introduce several other version maintenance tools before telling CVS.

2. Introduction to Several Version Maintenance Tools

2.1 SCCS

The full name of SCCS is Source Code Control System. Define the concept of work file before introducing the concept. The so-called work file refers to the source file that is "write" authority obtained from the software storage room.

SCCS is a basic source file version control tool that applies to version maintenance of any body file. It is based on a single file version control, usually, its software storage room and the file to be maintained in the same directory.

When SCCS is working, there is a special SCCS format file that retains its source file encoding version, which records enough information to generate a new version, and records who has the right to modify the file and own the "lock" of this version.

SCCS version is a four-way group, namely: issuance number, grade number, branch number, serial number (Release, Level, Banch, Sequence)

2.2 RCS

RCS is another basic source code management tool, which is Walter.f.Tichy developed in 1980 in Indina's Purdue University. RCS and SCCS are similar, and is also based on a single file version maintenance system. RSC performs file management through the RSC file The process of maintaining maintenance using RCS is similar to SCCS, but also in the recovery submission mode, do not

The RCS file is a storage room for the source file in the RCS system. It is a special coding file that contains the developer to restore the old version of the source file for the development of sufficient information. It usually uses .v for a suffix

Its structure is as follows:

* RCS header, this part records the header number of the version of the corresponding file,

* Release Description: This section describes attribute properties of each node on the RCS tree

* Initial information: One part is the expression when creating the first RCS version

* document content

RCS is similar to SCCS, and RCS will organize the maintained version into a tree structure. But RCS allows multiple branches, ie, RCS version number is not like SCCS, form; issue number, grade number, [ Branch number, serial number]. Version tree is as follows

2.3 review

The common point of these two version maintenance tools is: the "lock" method is used, and users who have a "lock" have the right to modify the file. The mechanism they use is the so-called "Lock-modify-unlock" ". It is only one well-known weaknesses that use this, that is, the use of multiple users.

Second, build a CVS server under Linux

1. Introduction to CVS and basic principles

The full name of CVS is CURRENT VERSION CONTROL. CVS is a GNU package. Developed by INTERSOLV, the latest version is 1.10.8. It is a RCS system-based maintenance tool. It expresses the storage and user of the source file Spaces are independently open, and there is an extended submission function of RCS in a certain mode. And make it beneficial to develop. CVS put the RCS files of the source file in a directory according to the level of its source tree, this directory The absolute path is defined by environment variable cvsroot.

It can be seen that this directory can be divided into two parts: a part is $ {cvsroot} / cvsroot, which contains some of the management files required for CVS. The other part is the RCS file formed by the source file, and is constituted by the structure of the source tree developed.

2. Characteristics of CVS during source code management

2.1 Source code space is separated from user space.

The CVS system places the source code file in the Repository, and the user must modify the file to make the file under Repository before making a copy.

2.2 Concurrent Access

The CVS system allows multiple developers to obtain the same version of the same version of the same file. Of course, this is also the main reason for CVS to obtain wide application. When the developer extracts a file, it will establish a copy of the other developers in their own work space. The version number of this file is the same as the file "head" version, unless he uses the commit command to complete the version of the permanent upgrade. At this point, other users can use the undate command to be consistent with the "latest header number".: If the user discovers the header change after Checkout, the RCS system's rcsmerge command can be used to form a new file, this new file And including the original content, including the content modified. This is weak to other developers modified by the same file, you can inform them to make handmade modifications

Therefore, the CVS system is a Copy-Modify-Merge algorithm rather than the two systems we mentioned by the two systems used by the two systems in this algorithm that software developers can get a source file. Copy (COPY) does not "lock" on the file, so it is possible to provide parallel development, after obtaining a copy, developers can modify in their own development environment, then submit their own modifications Files, combine with the source file. Form a new version.

CVS basic use introduction

CVS is a version control system. Simply put, he can record the process of modifying the program code, there is a complete history, when you modify the program code, accidentally wrote a bug, but you may have discovered more than a long time. BUG, this time, CVS can help you, find this bug in which one is changed, and this bug appears.

Before you have a version control system, developers are packaged for all the original code of the program, which is very wasted. The CVS is different. When he is changed, only the original code is reserved as a change in the original code, so that many spaces can be saved, two is more able to show each other when developing software together. Coordination.

CVS supports remote access, users can add edited Flag to the file he want to modify, so that others know that he wants to modify this file.

Terminology:

Repository: Means a warehouse. In CVS, it is where the version history is stored.

PSERVER: This is CVS CVS Command for CVS to accept Remote. CVS has two modes, one is LOCAL, one is Remote.

CVSROOT: When you use CVS, you must set the cvsroot environment variable, or use -d this option to specify.

转载请注明原文地址:https://www.9cbs.com/read-639.html

New Post(0)