Use CVS for version management

Source: Internet
Author: User
Article title: use CVS for version management. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Author: Per Cederqvist et al
  
Quick content index
1. overview ....................................... .................. 1
2. code Repository ...................................... ............... 7
3. use CVS to start a project ................................... ....... 29
4. main version (Revision )................................... ...... 33
5. branch and merge ..................................... .............. 41
6. recarsive behavior ...................................... ..... 49
7. add, delete, rename the file and directory ................................... 51
8. review the development history ..................................... ............ 57
9. place the binary file ..................................... .......... 59
More than 10 developers work at the same time ................................. ....... 61
11 Main version management .................................... ......... 71
12 keyword substitution ..................................... ........... 73
13. follow up with third-party code .................................... ........... 77
14. how does your system interact with CVS ................................ ........ 81
15 special files ..................................... ................ 83
16 Appendix
1) guide the CVS command ..................................... ............. 85
2) for details about the CVS command, see .................................... ........ 115
3) document management reference .................................. ....... 127
4) all environment variables that affect CVS .................................. .... 141
5) compatibility between different versions of CVS .................................. .... 143
6) the problem ..................................... ............ 145
7) credits ....................................... ............. 153
8) always deal with CVS and this manual ................................ .. 155
  
Directory ....................................... .................... 157
  
  
1 Overview
  
This chapter is written by people who have never used CVS, and may have never used any version control tools before.
  
1.1 What is CVS?
  
CVS is a version control system that records the history of your original code files.
For example, when the software is modified, problems may occur sometimes (* the bugs is translated as a problem here), and you may be doing this
These problems are not found for a long time after the next modification. With CVS, you can easily review old code versions
Which of the following changes has caused these problems. Sometimes this will be very helpful.
  
  
You may keep your code version every time, which may waste a lot of your code space. Use CVS 1
A smart way to save multiple versions in one file. It only retains different versions. If
You are a member of a project group, and CVS can also help you. Unless you are very careful, you can easily overwrite it
Others' work. Some editors, such as GNUEmacs, try to determine whether a file has been modified by both of them at the same time.
Unfortunately, this security method will no longer work if one uses another editor. Use CVS to make it different
Developers work independently to solve this problem. Every developer's work is in his own directory, and
CVS will be merged after each developer's work is completed.
  
CVS was created by Dick Grune as a branch of Shell scripts. in October 1986, it released 6th volumes
It is shipped to the newsgroup comp. soures. unix. However, the current CVS conflict algorithm does not contain any code from this
Some scripts.
  
In March 1989, Brian Berlinor designed and compiled the CVS code. Jett. Polk later helped Brian complete CVS
Model design and commercial version support.
  
You can obtain CVS in different ways, including free download on the Internet. If you want to download CVS and other CVS
For more information, see:
  
Http://www.cyxlic.com
Http://www.loria.fr /~ Molli/cvs-index.html.
  
  
There is a list of emails called info-cvs about CVS. Please send an email to subscribe to or Unsubscribe to this list
  
Info-cvs-request@gnu.org
  
If you prefer Usenet newsgroups, the CVS discussion group is
  
Comp. software. confg. mgmt.
  
In the future,
  
Comp. software. confg. mgmt. cvs
  
News Group,
  
However, it may be that Comp. software. confg. mgmt has been discussed too much.
  
You may want to subscribe to the bug-cvs email list, which contains more information in Appendix H [BUGS. Please send an Email to subscribe to it
  
Bug-cvs-reqnest@gnu.org.
  
1.2 What CVS cannot do
(Not translated)
2
  
  
3. start a project with CVS
  
Because changing file names and moving them to another directory does not happen frequently, you are starting a new project.
The first thing to do is to consider your file organization. It is not impossible to change the file name or move the file, but it is added
It is potentially confusing to understand, and CVS is sensitive to changing the name Directory. See Section 7.4 [move a file].
  
(* Note: in Unix, renaming and moving are the same ).
  
The next step depends on the situation in your hands.
  
3.1 create a file
  
The first step is to create a file in the repository. This can be done in a variety of ways.
  
3.1.1 create a directory tree
  
When you start using CVS, you may already have several projects that can be managed using CVS. In this case,
The easiest way is to use the "import" command. One example is the easiest way to explain how to use it. Assume that you
There are some files you want to put in CVS in "wdir" and you want them to be placed in the following directory in the Data Warehouse:
  
"$ CVSROOT/yoyodyne/rdir"
  
You can use the following command:
  
$ Cd wdir
$ Cvs inport-m "Inported Sources" yoyodyne/rdir yoyo start
  
If you do not use the "-m" parameter to record a log, CVS will call an editor (* Note: usually vi)
The system prompts you to enter information. The "yoyo" string is the developer's tab, and "start" is the release tab. They have nothing special
Only because of the need of CVS.
  
For more information, see Chapter 2 [tracking code.
  
Now you can check whether it is valid and then delete your original code directory.
  
$ Cd
$ Mv dir. orig
$ Cvs checkout yoyodyne/dir
$ Diff-r dir. orig yoyodyne/dir
$ Rm-r dir. orig.
  
To avoid accidental access to your original directory to edit files, it is a good idea to delete the original code. Of course, in
It is also wise to keep a backup to another place before deletion.
  
The "checkout" command can use the module name as a parameter (as in all previous examples) or a path relative to $ CVSROOT.
Path, as shown in the preceding example. You should check whether the permissions in the CVS directory are appropriate and make them belong to
A specific group. See Section 2.2.2 [file permissions].
  
If you want to "import" some files are binary code, you can use some special methods to indicate whether these files are
Is a binary file. See Section C.2 [Wrappers].
  
3.1.2 create files from other version control systems
  
If you have a project maintained by another version control system, such as the RCS, you may want to put these files in CVS,
And keep the history of these files. The following are some discussions.
  
From RCS:
If you use the RCS, find the RCS file ?? Generally, an object named "foo. c" contains the "RCS/foo. c, v"
. (However, it may be elsewhere. please refer to the documents of the RCS for relevant information ). If the file directory is not stored in CVS
In, create it in CVS. Then copy these files to the CVS warehouse Directory (the name in the warehouse must be
The original file of ", v". these files are directly stored in the directory of CVS, rather than in the "RCS" subdirectory ). This is in CVS
One of the few cases of direct operations into the CVS repository without using the CVS command. Then you can take them
In the new directory "checkout.
  
When you move an RfM file to CVS, it should be unlocked. otherwise, CVS will output
Some problems.
  
From other version control tools
  
Many version control tools can output standard documents in the "RCS" format. If your version control tool can do this
Point, directly output the RCS file, and then follow the example above.
  
If your version tool cannot output the RCS file, you must write a script file to retrieve a version each time.
Put it in CVS. The "sccsarcs" script mentioned below is a good example.
  
From SCCS:
  
There is a "sccsarcs" script file that can be used to convert the SCCS file into an RCS file. This file is placed in the original CVS code.
In the "contrib" directory. Note:
  
You must run it on a machine that has both the RCS and SCCS installed. And, as in the "contrib." directory
The same is true for other scripts. (Your method may be changeable)
  
(* Translator's note: I have not checked the contrib directory of CVS:-(, so I don't know what it is ).
  
From PVCS:
  
In "contrb", a script named "pves-to-rcs" can be used to convert PVCS to the RCS file. You must have
Run it on the PVCS and RCS machines.
  
See the notes in the script for more details.
  
3.1
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.