CVS server with Linux
Http://www.lelew.com/ 2004-05-22 09:17:28
LINUX as a CVS server Author: sunmoon 1 version control and labeling Introduction 1.1 version of the source file as well as several version control tools concept of source files is the most important concept of a constituent unit a software, management software but also the entire source file The most important ring in the management is the key to high-efficiency software development. Management of source files must be launched for source files. It is usually considered to require only file names. And actually, under a version maintenance tool The indication of the source file includes two parts: file name and version. That is: source file can be used to represent {filename, version}; so-called version, the general software developers have an intuitive understanding, but it is difficult Make an accurate definition. Version refers to the potential existence of a specific instance of a particular object. A particular object here is a software composition unit that is managed by the version maintenance tool. Specific instance means Software developers have a real copy of the software constituent unit recovered from the software storage room. Define the version into a potential existence is based on the following considerations: the version is part of the source file, the software personnel Its reference actually wants to get different source files corresponding to different versions, so the version is an abstraction. It is used to define a specific instance to have content and properties. That is, the version is a potential existence of a specific instance, is The source file is abstract. With the above 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 screen storage method, development Personnel does not need to understand what source files in the software repository, just need to explain what kind of source files and what kind of source file to store, version maintenance tools automatically complete all the work. The theory of version maintenance also includes: version Space, dimension, version representation, storage, merge, etc., because we mainly explain the CVS Linux server, so everything is from simple, interested friends can read related books This chapter is the CVS said that this is a powerful Tool. In order to tell CVS, we will introduce several other version maintenance tools. 1.2 Introduction to several version maintenance tools 1.2..1 SCCS SCCS's full name is Source Code Control System. Define the concept of work file before introducing. So-called work The file refers to the source file that has a "write" permission obtained from the software storage room. SCCS is a basic source file version control tool that is suitable for version maintenance of any text file. It is based on the version of a single file, usually Its software storage room and the file to be maintained under the same directory. When SCCS works, there is a special SCCS format file that retains the code version of its source file, Record enough information to generate a new version, and record the "lock" of the file with this version. The use process is generally as follows: (Figure 1) SCCS version of the good event is a four-way group, namely: The release number, grade number, branch number, serial number (Release, Level, Banch, Sequence) The version tree structure is as follows: (Figure 2) 1.2.2 RCS RCS is another basic source of source code management tool, which is Walter.f. Tichy was developed in 1980. RCS and SCCS developed in Indina, also, is also a single file-based version maintenance system. RSC performs file management through the RSC file; the process of maintaining maintenance using RCS is similar, but also in recovery Submit mode Although the RCS files have been described, it 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 is usually used. V is the structure of which is the following: • RCS header, this section records the version number of the version of the corresponding file, version description: This section describes the properties properties of each node on the RCS tree? Initial information: one is Expression content when creating the first RCS version? File content RCS is similar to SCCS, RCS organizes the maintained version into a tree structure. But RCS allows multiple branches, ie, RCS version number is not like SCCS. Yuan group. Form is;
The release number, gradation number, [branch number, serial number]. Version tree is as follows (Figure 3) 1.2.3 Summary: The commonality of these two version maintenance tools is: use "lock" way, the current questioning " The user has the right to modify the file. The mechanism they use is the so-called "Lock-modify-unlock". It is only one well-known weak point, that is, the use of more users. 2 in Linux Constructing CVS Server 2.1 CVS Introduction and Basic Principle CVS's full name 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 explicitly opens the storage of the source file and the user's workspace, and has extended the recovery of the RCS in a certain mode. And make it beneficial to the parallel development. CVS put the source file RCS file according to its source tree The level is concentrated in a directory, the absolute path of the directory is defined by environment variables, as shown in Figure 4, can be divided into two parts: a part is $ {cvsroot} / cvsroot, which contains some of the management required by CVS Document. The other part is the RCS file formed by the source file and consists of the structure of the source tree development. See Figure 5: About the file under CVSROOT, in the subsequent chapter, there is a detailed explanation, and the source code directory The working spatial structure is shown below: (Figure 6); CVS is subjected to source code management: 1. Source code space is separated from user space. The CVS system puts the source code file under Repository, the user wants to modify The file must make a copy of the file under Repository to make, 2, and send the CVS system to allow multiple developers to get the same version of the same version of the same file at the same time. Of course, this is also the main reason for CVS to obtain wide application. When the developer extracts a document, it will establish a copy of the other developers independently of its 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 permanent upgrade of the version. At this time, other users can use the undate command to be the same as "the latest header version number".: If the user discovers the header version after Checkout, it is available. The RCSMERGE command of the RCS system forms a new file, this new file, including the original content, and the content of the user's modification. This show is a conflict with other developers modified by the same file, you can notify them to make handmade modifications The CVS system is a copy-modify-merge algorithm rather than the above-mentioned Lock-Modify-Unlockj mechanism that the two systems used in the two systems is the benefit of this algorithm that software developers can get a copy of the source file. (COPY) does not "lock" on the file, so it is possible to provide parallel development, after obtaining a copy, developers can modify (modify in their own development environment, then submit their own modified files) Merger with the source file. Form a new version, 3, source file sharing CVS to $ {cvsroot} is different users can copy different templates by their own needs, modify the carrier to $ {cvsroot This is the user can share the source file. This is of course the 4, the independent work environment, the independent work environment, has been revised in its own working environment, naturally there is a separate working environment, it is worth mentioning. CVS Support "lock" mechanism. Allow users to lock the template copy of them 5, marking CVS In order to facilitate the user, introduce a Tag file, the file is located in the user's working directory, with the CVS directory that is tagged by him Under the specific TAG file operation, that is, the operation of the corresponding version, even if this version is modified. 2.2.CVS has a default installation in the general Linux release. If your system is not installed Relationship, CVS can be easily obtained on the intenet. Its source code is in ftp://202.113.29.4/pub1/unix/cvs its description document in ftp://202.113.29.4/doc/cvs. No one can be very Convenient download. His latest version is 2..10.8 .. The installation process is approximately as follows: 1. Unwave the downloaded compressed file in any directory. 2 Take the installation tool in the file package, complete the installation, Documentation). Usually: make config make install (unlivied version, the installation method may be different, please refer to the installation document, the installation document included) 2.3 The installation of the server is installed after installation CVS system, we can start CVS warehouse The library is installed. In the Linux environment, the use of CVS is generally in a command line, and there are also some GUI front-end tools such as TKCVS. Here we will apply CVS general commands, cvs [CVS options] CVS-Command [Command Options] Method Complete the configuration of the server. 2.3.1 Administration of the Software Warehouse 1 Create a CVSRoot root directory first edit the relevant environment variables. (Several important environment variables of CVS are as follows: CVSRoot warehouse root directory full path name CVSRead If set, it indicates that all files when checkout operations are restreaded. The read-only CVSBIN CVS uses a lot of RCS commands, the path of the specified music RCS tool CVSEDITOR specifies the editor CVS_RSH used by the user writing log information to start a remote CVS server The name of the shell used CVS_Server determines the name of "CVS Server". The default is the CVS CVSWrapPers Cvswrapper script, which is used to specify the packaging file name.) The important thing is CVSROOT, which indicates the location where the warehouse is located, found new When the warehouse is essential. Therefore, it is generally necessary to add the definition of environment variable cvsroot. For example, add the following two lines of cvsroot = / cvsroot export cvsroot or execute $ export cvsroot directly on the command line.
/ cvsroot then start creating CVSROOT $ mkdir cvsRoot $ cvs inIt in the appropriate location If you do not define variables CvsRoot, this prompt appears: cvs init: no cvsroot specified! please use the '-d' Option CVS [Initn Aborted]: Or SET THE CvsRoot Environemnt Variable If you do not want to define environment variables, you can use this command: cvs -d / cvroot init, even if you define cvsroot, the contents of parameter -D will overwrite it. If there is no error, congratulations Your CVS Software Library has been established. The remaining problem is how to use this repository to use this warehouse to perform parallel software development and version control. And as a CVS administrator, you should set your user's permissions. This When you have a cvsroot subdirectory under your cvsroot. The configuration files of the CVS when he will use LS / CVSROOT / CVSROOT, and their uses are: checkoutList supports other management files of the cvsroot directory, allowing for a variety of The CVS command is set when the CVS Commit command is executed, this file specifies the command cvswrappers when the music file is submitted, and the CVSWrapPers define a package when the file is registered or checked. EditInfo allows you to launch before log information before the commit command The script History, which is recorded, traces all the command loginfo that affects the warehouse is similar to COIMMITINFO, just after the file is submitted, execute Modules to define a symbol for a set of files, otherwise the file name of the CVS warehouse must be specified for each file ($ Cvsroot) Nitify Controls Notifications from "Watch". "Watch" is set by "CVS Watch Add" and "CVS Edit" Set RCSINFO to the commit log. Tag. TagInfo defines the programs executed after any "tag" operation. Passwd defaults. Store file settings for user passWorld: Source administrator should control access to files and directories under the warehouse to control access. All RCS files (with, V end) is read-only, warehouse The directory should be written to the user to allow it to be changed. 3.2.2 multiple software The establishment of the library If you have several development groups, their work is not coheed, you can build a few different software libraries. You have to do just redefine the environment variable cvsroot, or use -d to set up The advantage of using multiple software libraries is that they can use a command to remove files from different software libraries in different SEVERs. In her later versions, you can put different sever Source code takes place to your work directory. The following is an example of how to build a work directory under multiple software libraries: CVS -D Server1: / CVS Co Dir1 CD Dir1 CVS -D Server2: / root co sdir cvs update 1 command A work directory is built, and files with files on Sever1 will take some files in the Soft library on Sever2. Then use all files to upgrade the files on Sever2. 3.2.3 Software library backup and movement There is no different files in the backup software library, but you need a backup tool to lock CVS. This way, you must first register a user who can read the software library, open the CVS software library, you need to edit`
# cvs.rfl 'file. When you want to use a backup soft library, restore the original library, if the original library has made changes after you back up. CVS will report an error. You must follow the following steps? Get a new one Work catalog? Copy the previous submission failed file (, of course, can not copy the CVS directory file)? Work in the new directory, use CVS Update or CVS DIFF, indicate those changes, and save the change to the software with CVS Commit Library. If you want to move a software library to other places, it is very simple. The easiest way is to create a new directory to the directory you want to move. If you want to reuse the original directory, you can only modify it. `Cvs / repository 'and` cvs / root' unless you are fine, it is not recommended. 3.2.4 Remote Use of Software Library We put in detail in detail in detail 3.3CVS remote user management as a CVS The server should satisfy two points. First, ensure that the software library has enough space. Secondly, there is no memory that is not less than 32M, the server generates two processes for each connected to its users, which is small on the child process. But If the network bandwidth is not enough, the cost of the parent process is huge. Another big flower pin is a DIFF file. When the source file is large, the cost of verifying or detecting him is also very large. 3.3.1 Our universally used RSH is remotely logged in as an example, talk about the remote user's login authentication method: CVS server uses RSH to allow user to configure .rshosts, assuming that users Tom.ExSample.com on the remote host Tom.exSample.com needs to connect to Funame.SIMPLE.COM works on this CVS server. You should edit the Bach directory of the server-side Bach directory. RSHOSTS in which Tom.exSample.com Tom client can run RSH -L Bach funame.simple.com 'echo @path to determine yourself You can connect to the CVS server and the customer should write the path displayed. Bashrc or CSHRC (not .logiin or .profile.) In addition to this, the client can define environment variables CVS_SEVER. To define the position of the host To tell the server, modify the /etc/ineted.conf file to tell the server, run the cvssever when getting a specific port connection. This port number default is: 2041. Of course, in order to do not do every time you use it. Setting, you can use on the client by defining environment variables CVS_AUTH_PORT. If the client's ineted is allowed Originally called, just add the following sentence to the /etc/ineted.conf file 2401 stream TCP NOWAIT ROOT / USR / local / bin / cvs cvs -f -allow -root = / cvsroot pserver can also be used Options To define buffers. -Ualow - root defines a software library that is available for users. If there are more software libraries on the server to reuse this sentence. In addition, internal users can define environment variables CVSROOT: Pseve: usr @ Funam.SIMPLE.COM:/cvsroot where USR is the username (Linux system) funam.simple.com is a CVS server and assumes that / cvsroot is a directory name for a software library. Remote users can use the following form:: etX: psever: usr @
Funam.silple.com:/cvsroot: etX: Defines the remote user, the rest of the same. If the customer's inete is generally called, simply add this sentence in / etc / seveice: CVSPSEVER 2401 / TCP restart ineted makes it Read the initialization file. CVS is managed by the user. In the default, you can use the same username and password with the Linux system. Name: As long as you log in to the Linux system, you have $ cvsroot Read-only privileges .. Of course, the developer of a software must have the read and write permission of the corresponding directory to complete the upgrade of the source code. Therefore, CVS also provides its own user authentication system to more convenient Manage users. You can have a passwd file (you can use environment variable cvs_passfile) to record CVS user information. The same organizational form is the same as Linux etc / passwd. Similarly, it The PassWold is also encrypted by Linux standard. Below is a passwd content Anyone: Tom: XYZKUE MARY: YUIO: Pubcvs The first line of the first line is that when logging in with Anyone, no password is required. Even if you get empty Skewers can also. Of course, in this way you may get only read only. The second line means that Tom is required to type Passwold. This passWorld encryption is XYZKUE. After logging in this way. Generally Get high permissions. The third line means that when Mary is logged in, you need to type password. Enter the same software library in the system user. This purpose is because .cvs will record its users in the software library. Action. Definitions and system users different identities. Use CVS. For example, use the user TOM to log in with the following ways: $ cunam.simple.com: / cvsroot login (if Tom users) The name can be inside the distal end, then TOM @ can also omitly) at the same time, you can use CVS Loginout to cancel all environment variables. 3.3.2, using the GASSAPI access CVS also supports direct access using GASSAPI. Before using the rotation, you need to recompile CVS to get GASSAPI support. Use -with -gassapi to connect, or use -a orientation to connect. Use GassAPi authentication, etc. There is room for a way. But when logging in. You need to redefine $ CVSROOT such as: $ cvs -d: gsever: usr@cvssever.com: / CVSROOT LOGIN 3.3.3 Using Kerberos Direct connection The simplest use RSH method Say. The main feature of this method is that all data passes through an additional program. Very expensive. If Kerberos is installed. You can use the TCP connection directly. The same CVS needs to recompile to get Keberos support available --with-kRB4 Connection. The data transmitted is not encrypted. If you want to get secure. You must use it on the server and the client.
--enable-encryption to connect. At this time, you apply universal variable -X to require encryption. You need to edit inetd.conf to run CVS KServer. The default port number of the client is 1999. If you want to use other port numbers The login command to be defined at the user end should be CVS -D: KServer: Faun.example.org: / usr / local / cvsroot Checkout Foo 3.3.4 Use this way with this way, can be connected to the local protocol Hard disk software library. In other words, he can and: local: There is the same function to use this way the login command is cvs -d: fork: / usr / local / cvsroot login and: etX: The same. Default Host name is CVS 4 CVS Server Rack and Application Example 4.1 Server Installation Configuration Hypothesis Currently, there is a work item, you need to use CVS to manage program code. This development group is internal 3 people, and the IP IP is: 192.168..1.2 (user name T1 ), 192.168.1.3) (user name T3), 193.168.1.3 (user name T3), a remote user is Tom.Example.com. (User name is Tom) If you have already installed CVS, establish a The CVS host is very simple for CVS.Exam.org. Steps are as follows: 1) Log in as root. Create a software library (Repository) $ export cvsroot = / CVSROOT $ MKDIR / CVSROOT $ CD / CVSROOT $ CVS INIT 2) Setting Permission $ ChMOD / CVSROOT / CVSROOT 744 (/ ccvsroo / cvsoot Set to read-only) $ ChMOD / CVSROOT 764 (/ cvsroot to read and write) 3) Modifying files to use people, because developing group people It is a system user, so it is better to use the system's username and password. First edit. RHOSTS is as follows: Tom.Example.com. Tom.Example.com. Tom.Example.com. Tom.Example.com. Tom.Example.com, add the following sentence 2401 stream TCP NOWAIT ROOT / USR / local / bin / cvs cvs -f --allow-root = / usr / cvsroot pserver, one basic CVS server It will be built. We just provide a basic application. The true details of CVS are very complicated. We only conduct some introductions of the brick jade. With interest friends, you can read its installation documentation. 4.2 Application examples (using the host The CVS system, you can Telnet to the host, then use, and this machine has no difference, so this article has not been mentioned) Assume that Tom in the above example wants to use the CVS system on the CVS host to develop. First of all, Configure some of your own environment variables. First Edit / etc / services' join: CVSPSERVER 2401 / TCP and add the following code cvsroot =: etX: Psever: Tom @profile file
Cvs.exam.org:/cvsroot Export Cvsroot This can be logged in using $ cvs login. Below we use Tom's specific use as an example. Like other Linux commands. CVS also has a lot of parameters. I will be a list in the next section. Tom has the following files in the / usr / test directory eCample.c exampl2.c Tes1.c Test2.c utimel.c TTY.C If you want to build your own directory in the software library $ CD / usr / test ~ test $ cvs import -m "Tom first Creation" TomDir Tom TomWork n Tomdit / Example.c n Tomdit / Example2.c n TomDIR / TEST1.C N TomDir / Test2.c n TomDir / utmel.c n TomDit / TTY.C No Conflicts Creat By This Import Command Description Import Submit Command -M After adding the .TOM publisher Tomwork is the issuance label. If you prompt cvsroot, you can use - -d plus cvsroot Note: All CVS commands can be used CVS Command -H to get help. At this time, there is a TomDir subdirectory in the server-side / CVS directory. Under the content: Example.c, v exampl2.c, v Test1.c, v Test2.c, v TTY.c, v utimel.c, v to this first submission completion. This is an accidentally deleted Test directory. Don't worry. Use the following command to check the backup of the source file from the software library $ / cd usr `usr $ / cvs Checkout TEST TOMDIR-R 1.1 U Test / Exsample.c u test / example1.c u test / test1.c u test / test2.c u test / tty.c u test / ulnem.c cvs checkout Command is the latest version We can also get an old version, this command is taken out of the code of TomDir's version 1.1. After the recovery, the Test directory adds a CVS directory to manage, so that when you submit or modify it, and the server The management file is connected to the interface, and the version is good. This Examples are very small, the reality is very likely that the file is very possible, so you can restore the CVSROOT module ~ USR / $ CVS Checkout cvsroot / mouldes ~ / usr / $ vi cvsroot / mouldes editing module name, such as we add SRC Project / Src Print Project / Src / Print CVS Commit We can use CVS Checkout Print to replace CVS Checkout Project / Src / Print to submit files ~ USR / $ cvs commit -m "edit of mouldes name" cvsroot In addition to the entire directory, you can also resume a single file or module ~ USR / TEST / $ CVS Checkout -m "NEWER FILE" TTY.C After the file is restored, TOM can use various editors, for the source file After modification, you can submit its work results after the completion of the modification is completed ~ / usr / cvs commit test TomDir. In this way, TOM completed the upgrade of a source file. The other configuration can be 4..3 in management Technical 4.3.1 A technology called "Keyword replace" in the management source file. Perform "CVS Commit"
Some keywords of the post source file will be replaced with the Item $ Author $ User Name $ Data $ Register Time $ Header $ The head of the standard, the full path name, date, the date, the author $ ID $ In addition to RCS The file name is incomplete to $ Header $. $ Log $ contains the full path name, version number, date, author and log information provided when submitted. $ RCSFILE $ contains RCS file name, not including path name $ Revision $ The full name $ SOURCE $ RCS file full name $ State $ assigned version of the version of the version, allocated by cvs admin -s. Example: Before CVS Commit, there is static char * rcsid = "$ ID. $ "; MAIN.C changes to: static char * rcsid =" $ ID: main.c, v 1.2 1999/04/29 15:10:14 Trimblef Exp $ "; Of course, here is just one Demo. In actual program development, this technology has a very useful role, there will be no more details. Interested friends can refer to related books. 4.3.2 Creating a branch allows users to modify some files using the command commits Will not affect the main trunk. Creating a branch should first create a label (TAG) for those files that are modified. The tag is a symbol that is paid to a file or a set of files. In the life cycle of the source code, the file that makes up a set of modules Follow the same label. Once the working directory is executed ~ USR / TEAT / $ CVS TAG RELEASE-1-0 label is created, you can create a branch for it: ~ USR / TEAT / $ cvs RTAG -B -R RELEASE- 1-0 Release-1-0-Path Print -b: Create a branch -R release-1-0: Specify the existing tag RelevaS-1-0-Patch: Branch print: Module name Use the CVS Update -j option to branch The change in changes with the local files. ~ USR / teAT / $ cvs update -j release-1-0 Print.c After the source file is necessary to modify the source file, you can use CVS Release to delete local work copies and inform Other developers this module. No longer used. ~ Use / $ cvs release -d test 4.3.3 Conflict Solution When there are multiple users to modify the same file, if the same part is modified And if there is a different content, the conflict is inevitable. For example, in the CVS file repository has a file Test.c, its version is 1.4, user A first detects the file for modification, and later has user b to detect the file for modification, and submit into 1.5 in advance, so A conflict occurs when User A is submitted, and the CVS will prompt to resolve manually.
For example, version 1.4 in the file warehouse is: #include main () {INT i; for (i = 0; i <100; i ) Printf ("count:% d / n", i);} User B 1.5: #include main () {INT i; for (i = 0; i <10; i ) Printf ("count:% d / n", i); printf ("over / n");} User A: #include main () {INT i; for (i = 0; i <50; i ) Printf ("count:% d / n", i); return;} will prompt conflict when submitting, this requires manual editing, At this time, if User A is running $ cvs update, edit Test.c, you will see that the content of Test.c is this: #include main () {INT i; <<<<<<< Test.c for (i = 0; i <50; i ) ======= for (i = 0; i <10; i ) >>>>>>> 1.5 Printf ("count:% d / n", I ); <<<<<<< ================================================================================================================================================ Modify, this is trouble, so in real collaborative development, few, for the same file, many people are the same. 4.3.4 File version management version management system, the most important thing is to file Version management, system default version upgrade is certain. If you define your file version number if you have special needs, you can use the command: cvs log [-lr] [- r REV] [ -d Date] [Files ...], the meaning of the parameters is as follows: -L Do not proceed with the subdirectory -R pair sub-directory to do the same processing -r specified version number -D specified time -w Specify the login name using the following The command can refer to all historical version information of the current module version or the specified file. CVS Annotate [-lr] Files, the meaning of the parameters is as follows: -L Do not proceed with the subdirectory -R pair subdirectory Do the same processing -R Specify version number Using the following command to see the specified file All modifications to (after detecting).
$ CVS Annotate Cvstest / C / Test.c output is: Version Modifier Modify Time Source Code 1.1 (TANG 18-JAN-00): #include 1.1 (TANG 18-JAN-00): #include 1.1 (TANG 18- JAN-00): 1.1 (TANG 18-JAN-00): Main () 1.1 (TANG 18-JAN-00): {1.1 (TANG 18-JAN-00): INT i = 0; 1.1 (TANG 18-Jan -00): 1.1 (TANG 18-JAN-00): for (i = 0; i <20; i ) 1.1 (TANG 18-JAN-00): Printf ("COUNT:% D / N", I); 1.1 (TANG 18-JAN-00): 1.3 (TANG 18-JAN-00): Printf ("222222 / n"); 1.4 (TANG 18-JAN-00): Printf ("333333 / N"); 1.1 ( TANG 18-JAN-00):} Use the following command to generate a branch version relative to a designated host version: CVS RTAG -B -R Rev_Root Rev_branch file_name, the meaning of the parameters is as follows: -b Specifies a branch version -R Specifies the branch version number Rev_Root Branked version number ref_branch branch version number file_name specified file, using "." Means that all files in the current directory use the following command to generate a branch version of the corresponding version number, because the CVS version number is used Digital representation, and the version of different files in the same module may be completely different, so the use of the identity will be more convenient. Example: $ CVS RTAG -B -R 1.2 TLB-1 Source After you want to access the branch version, you can use the "-r" option $ CVS Checkout -r TLB-1 Source Switch from the current version of the version to a branch version: $ CVS Update -R TLB-1 Source Use the following command to view the version information: cvs status [-vlr] FILES, the meaning of the parameters is as follows: -v Display all information -L does not display sub-directory information -R display subdirectory information command : CVS Update -j Rev Module merges the currently modified file with the specified version. Such as: Carne 1.1 1.2 1.3 1.4 1.5 1.6 ↓ Branch TLB-1 1.2.2.1 1.2.2.2 1.2.2.3 If you want to merge the version of the branch TLB-1: $ cvs update -j 1.2.2.3 -j TLB-1 Test.c The 1.2.2.3 can generate an identifier that is easy to remember through the TAG command.
If you want to merge branches TLB-1 to the trunk 1.2: $ cvs update -j tlb-1 test.c If you want to merge different versions on the trunk (note order is important, all modifications between the specified version will be discarded) : $ Cvs update -j 1.5 -J 1.2 Test.c If the files in different versions are increased, they can: $ cvs update -a $ cvs updata -jbranch_name 5, the command set is in this chapter, A lot of detailed usage of commands, most of which is analyzed by the application, actually. CVS has, a large number of orders. If the GCC is the same, the CVS is not a lot, in this section, we list Some commonly used orders. Tap that the payment is related to the above sections. Of course, it is limited to time and level, it is impossible to list all the commands of CVS. Interested friends. Can, reference, CVS documentation With Linux's Man Document, learn more, you can also make guidance (1) detection source file cvs checkout [-r rev] [- D Date] [- D Dir] [- j merg1] [-j Merg2 ] Modules, the meaning of the parameters is as follows: -r Detecting the specified version of the module -D detecting the specified date of the module -D detects the specified directory instead of the module -j merged current version and the specified version using the following command to detect the just now The generated module and generates the entire directory structure in the current directory: USR $ CVS Checkout Project USR $ CVS Checkout Project / Src / Main CVS Checkout's Detailed usage CVS -H Checkout output. 2) CVS After completing the modification of the file, the commit command is submitted to the warehouse with CVS Commit. cvs commit -m "update by xxxxx" Project cvs commit -m "update main.c" main.c submitted, the current version number will be updated If it is 1.1, it is 1.2. These two versions are on the maintrunk. The -m option can record the commented on the submit. If you do not specify the -m option, the editor specified in the environment variable cvseditor Called (VI is default), prompt to type text, modify the record comment. 3) Delete, increase, rename files and directory CVS Add [-k kflags] [- M Messa GE] FILES ... The meaning of the parameters is as follows: -k Specifies the default detection directory -m of the file after the specified Directory - M. The above command adds a new file to the file warehouse, but until the submission command It really updates the file warehouse. CVS Remove [Options] files The above command removes files from the file repository, but it is necessary to have a role. Example 1: Add File $ CVS Checkout Source $ CD CVSTEST / C $ TOUCH TEST.C $ CVS Add Test.c $ CVS Commit -m "Add Test.c" Example 2: Delete File $ CVS Checkout Source $ CD CVSTEST / C $ RM TEST.C $ CVS Remove Test.c Use the -f option to work above two steps. $ CVS Remove -f Test.c If you want to resume the file just deleted before commit, you can follow the following method to recover only the first step (RM), you can recover the following method: $ cvs Update Test.c For renamed files, you can delete it first.