CVS training Handouts

Source: Internet
Author: User

1. Introduction to CVS (Concurrent Version System)

1. CVS Mechanism
CVS is a front-end tool of RCS and is a version control tool for multi-user parallel development, it uses the "copy-modify-merge" mechanism instead of "lock-modify-unlock ". Use CVS to generate a repository for storing files. Each directory stored in the repository is called a module ), during the modification, the corresponding module is checked out to the working directory to generate the corresponding directory. All the modifications are completed in the working directory, after the modification is complete, submit it to the repository to generate a new version number and save it.
CVS stores files in a place named repository. The files saved in the repository are not copies of each version,
Instead, you can trace back to the master information of some code in the initial version from any version, which saves a lot of storage space.
LINUX operating systems that are popular all over the world are successfully developed on large-scale distributed CVS systems.
ClearCase of Rational Sofdtware, the world's most famous software engineering software provider, is an alternative product of CVS, which is slightly enhanced than CVS.

2. Version Number of CVS
It can be divided into system numbers and user numbers.
The system number is the number automatically assigned by CVS to the version. The ID of the automatic CVS management system. The single branch version is evolved in the order of 1.0-> 1.1-> 1.2.
The User ID is the number specified by the user for a specific version to control the version number or unify the version number.
 
2. Development process recommended for CVS

To avoid compilation failures caused by updates by others, we recommend that you first develop the SDK in the development environment and put the SDK into CVS for management without any major changes, and then released to the test and production environments.
Take the company website development as an example. The process is as follows:
Development Environment (192.168.16.33)-> CVS (192.168.16.38)-> production environment (192.168.16.34)

Iii. Use of wincvs

1. How to set a local working directory
Admin-> preference-> WinCvs-> HOME folder

2. How to list the modules on the CVS server?
Admin-> Macros admin-> Get the cvs modules
The file modules in the CVSROOT module controls the display of modules, which is managed by the system administrator.

3. How to obtain the modules on the CVS server to the local working directory?
Choose module> Create> Checkout modules...> enter the modules Name> OK.

4. How to incorporate new programs or documents into CVS management?
Copy the new program or document to the local working directory of CVS-> right-click-> Add selection or Add selection binary (determined by the document type)-> Commit selection (it is recommended that the file be modified, add a brief description of this modification to commit, so that you can view the history in the log later .)

5. How to modify an existing program or document?
Right-click & gt; Edit selection & gt; modification completed & gt; Commit selection

6. How can I discard the modification?
If no commit exists, right-click and choose Unedit selection.

7. How can I add a newly created Module to the cvs server?
1) copy the directory to be stored in the database to the working directory.
2) input module Create-> Import module
3) in the pop-up file dialog box, select the top-level directory of the project directory you want to enter and enable the folder icon.
4) in the pop-up window, make sure that the submitted file is correctly set to text or binary.
5) Click OK, wincvs, and input the entire directory structure to the CVS server.

8. How to update the newly created modules
1) Remove your original directory locally
2) Fetch the modules on the CVS server to the local working directory (see step 1 above)

9. How to resolve conflicts?
A conflict occurs when two or more users modify the same file. You can open the problematic file and search for rows starting with <>. The price of the conflict zone is as follows:
<File name
Your modifications
==========
Code merged from the library
>>>>>>> Revision
You need to determine what the code should be, make necessary modifications, delete the CVS price, and submit your modifications to the database.
Suggestion: Update selection before modifying files in CVS.
 
10. How can I retrieve previous versions?
Graph selection-> right-click-> tag selection.

11. How can I see the local working directory of CVS in the modules window?
View-> Browse Location-> select the local working directory in the pop-up window-> OK

12. check who is modifying the file.
Right-click and choose Editors of selection. List users who are editing files.

13. How can I view the historical modification records of an object?
Right-click and choose Log Selection.

14. Under what circumstances do I need to lock the logout )?
For binary files such as Word documents and function libraries, the check box should be selected to lock logout because they cannot be merged by CVS.
Right-click and choose Lock Selection.
Unreserved checkouts is the method of saving CVS, allowing other users to modify the file to be logged out
CVS will not tell the First Login whether another user is modifying the file.
Others will receive an error message when they log on. They must first merge with the latest version in the repository before they can wait.
For source code and so on, you should select non-locked logout; otherwise, the software productivity will be greatly reduced.
If non-locked logout causes a serious opening conflict, there was a serious shortage of developers' communication at that time.

Note:
Simple non-lock logout is feasible for many projects.
Locking and logout control is too strict, which is not conducive to improving software productivity.
The combination of non-locked logout and monitoring mechanisms is the best choice for many groups.

Iv. CVs Addendum

1. How to delete a directory?
You must first delete the files in the directory to make the directory an empty directory, and then run cvs update-P to clear the empty directory from the warehouse.
 
2. How to rename a file?
Rename the old file in the working directory as a new file.
-Mv old new
Notify CVS to delete old files
-Cvs remove old
Notify CVS to add a new file
-Cvs add new
Delete old files and add new files from the CVS Repository
-CVS ci-M "name old to new" Old New

3. CVs cannot compare and merge versions of binary files. Therefore, version branches should be avoided.

4. CVs cannot identify binary files based on the file content, but it can identify files that are binary files based on the file extension, which is defined by the cvswrappers configuration file.

5. Set read-only users
Grant permissions to some users to read files from the CVS repository, but do not allow them to modify the files.
Name the username in the $ cvsroot/readers file, for example:
Xuys
Huyj
Zousj
Anonymous

V. Summary of Development points

1. Update the selection before modifying the files in CVS.
2. For source code modification, select non-lock logout.
3. For binary files such as Word documents, you should choose to lock and log out because they cannot be merged by CVS.
4. After the file is modified, it is best to add a brief description of the modification during commit, so that you can view the historical records in the log later.
5. strengthen communication among group members.

6. Free questions, answers, and discussions

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.