[Reserved] CVS

xiaoxiao2021-03-06  41

Author: Cha Dong chedong@bigfoot.com Last updated: 2002-10-29 13:50:00 Disclaimer: can be reproduced, reprint, please be sure to indicate the original source and author information reprinted Keywords: CVS CVSWeb CVSTrac WinCVS CVSROOT Overview: CVS It is a C / S system, multiple developers record file versions through a central version control system, thereby achieving the purpose of ensuring the synchronization of the file. The working mode is as follows: CVS server (file version library) / | / (version synchronization) / | / developer 1 Developer 2 Developer 3 Main content: Developer entry can be mainly selected 2, 6 can be, CVS The administrator needs more need more, and finally introduces some of the CVS clients under Windows, the selection of remote user authentication, and integration issues with the BUG tracking system. CVS Environment Initialization: CVS Environment Construction Administrator CVS Daily Use: The most common CVS command in daily development, the development of the developer admin CVS, the project is used by different progress and target, and the administrator CVS user authentication: through SSH Remote user authentication, security, simple administrator CVSWeb: CVS's web access interface greatly improves the efficiency Administrator CVS Tag: Add $ Header $ Add to Code Comments, Convenient Development Process Tracking Developers CVS VS VSS: CVS And Virsual SourceSafe's comparison developer WinCVS: Group Collaborative Development of CVS via SSH-certified WinCVS authentication: Development of the development of the group-level development environment, implements the CVS user management and integrated bug tracking of the web interface through CVSTRAC. A system 20% of the system is often capable of meeting 80% of the demand, and CVS is no exception. The following is the most common function of CVS, may not reach 20% of its all command options, more features experience in the actual application process, How much do you want to use, you will look back from time to look at the unexpected gain. CVS environment initialization ============ Environment settings: Specify the path of the CVS library CVSROOTTCSHSETENV CVSROOT / PATH / TO / CVSROOTBASHCVSROOT = / path / to / cvsroot; Export CVSROOT also refers to the settings of the remote CVS server : Cvsroot =: ext: $us@test.server.address#port: / path / to / cvsroot cvs_rsh = SSH; Export CvsRoot CVS_RSH Initialization: The initialization of the CVS version library. CVS INIT's first imported CVS import -m "write some" process_name vendor_tag release_tag executed: will import all source files and directories to / path / to / cvsroot / project_name directory Vender_TAG: Development trademark Release_tag: version Publishing Tag Project Export: Export Code from CVS CVS Checkout Project_nameCVS will create a Project_name directory and export the latest version of the source code to the corresponding directory.

This Checkout and VirVual SourceSafe are not a concept. Check out is CVS Update, Check IN is CVS Commit relative to the Check Out of VirVual SourceSafe. CVS daily use ============= Note: After the first export, it is not synchronized by CVS Checkout, but to enter the project_name directory exported by CVS Checkout Project_name. The version of the file is synchronized (add, modify, delete) operation. Synchronize files to the latest version CVS Update does not set file names, CVS will synchronize files in all subdirectory, or make a file name / directory to synchronize cvs update file_name is best before you start working or import your work. Before the CVS reservoir, you must have a habit of "first synchronization after modifying", and VirVual SourceSafe, there is no concept of file lock in CVS, all conflicts are solved before commit, if you modify the process, There are other people modified and commit to the CVS library, and CVS will inform you of the file conflict and automatically use the conflict part >>>>> Content on CVS Server <<<<<< Content in your file >>>>>> Mark comes out, by your conflict content. Version conflicts are generally caused by multiple individuals to modify a file, but the problem on this project management should not be expected to be solved by CVS. Confirmation Modification Writing to CVS CVS Commit_name Note: Many of CVS is confirmed by CVS Commit, and it is best to modify one file each time. Before confirming, users need to fill in the modified comments to help other developers understand the causes of modifications. If you don't need to write -m "comments", please confirm the `cvs commit file_name`, CVS automatically call the system default text editor (generally VI) to request you to write a comment.

The quality of the comment is very important: so we must not only write, but must write some meaningful content: so that other developers can understand bad annotations, it is difficult to let other developers quickly understand: such as: -m "bug mixed" or even -m "" Good note, even in Chinese: -m "to add Email Address Calibration during user registration" to modify a version annotation: only one file to the CVS library each time It is a good habit, but it is inevitable that sometimes I forgot to specify the file name, put multiple files in the same comment to CVS library. The following command can allow you to modify a version of a file: CVS Admin - m 1.3: "Write Some Comments Here" File_name Adding a file After creating a new file, such as: touch new_filecvs add new_file Note: For the image, Word document, etc., you need to use the CVS Add -b option to press 2 credit Import, otherwise there may be a case where file is broken, such as: cvs add -b new_file.gifcvs add -b readme.doc and confirm the modification and comment CVS CI -M "Write Some Comments" delete files to physical files After delete, such as: rm file_namecvs rm file_name then confirm the modification and comment CVS Ci -m "Write Some Comments Here" Method for the top 2 steps above: CVS RM -F File_namecvs Ci -m "why delete file" Note: A lot of CVS Command has an abbreviation form: commit => Ci; Update => Up; checkout => co / get; remove => rm; add directory cvs add dir_name View modified history cvs log file_namecvs history file_name View CVS Diff -r1.3 -r1.5 file_name View the current file (may have been modified) and the difference between the corresponding file in the library CVS Diff file_namecvs provides more convenient location file modification and comparison version difference, specific installation settings Looking back in CVSWeb Using the correct way to restore the old version through CVS: If you use the cvs update -r1.2 file.name, you add a Stick Tag: "1.2", although your book It is just that it is just to recover it to 1.2 version of the correct recovery version of the version is: cvs update -p -r1.2 file_name> file_name If you accidentally add Stick Tag: Solve the mobile file / file rename with CVS Update -a There is no CVS Move or CVS Rename in CVS, because the two operations can be implemented by first cvs remove ly_file_name, then CVS add new_file_name.

The most convenient way to delete / move the directory is to let the administrator move directly, delete the corresponding directory in cvsroot (because the subdirectories under the CVS project are independent, can be used as a new independent project as a new independent project: better than one The tree, in fact, it can be cut off independently), and after modifying the catalog, it is required to re-export project CVS Checkout Project_Name or synchronize with CVS Update -DP. Project release export You may notice when you have developed source files with a CVS directory, and CVS created a CVS / directory under each development directory. There is a file to record the corresponding information between the current directory and the CVS library. But when the project is released, you generally don't want to put the file directory with a CVS directory containing CVS information. This one-time export process uses the cvs export command, but Export can only export for a TAG or date, such as: CVS Export - r release1 project_name cvs export -d 20021023 project_namecvs export -d now project_namecvs branch: Project multi-branch synchronous development ============================= Confirmation version milestones: Multiple files are different, projects to a certain stage, you can assign a phase milestone version number to all files, which is convenient to export projects in this stage milestone, and multiple branches developed by the project. basis. CVS Tag Release_1_0 starts a new milestone: CVS commit -r 2 tag all files start entering 2.x Development Note: The release version of the Revsion and package in CVS can have no direct relationship. However, all files use and publish version of the version number contribute to maintenance.

When the version branch is established, it is found that there is a problem when the 2.x version of the development project is found, but 2.x does not dare to use, from the previous tagmason: release_1_0 Export a branch release_1_0_patchcvs RTAG -B -R release_1_0 release_1_0_patch proj_dir Some people first export Release_1_0_patch in another directory: Solution 1.0 urgent problems, cvs checkout -r release_1_0_patch, other people are still developing on the main branch 2.x of the project to fix an error after fixing the error on the Release_1_0_patch, marked a 1.0 Error Correction version number CVS Tag Release_1_0_patch_1 If 2.0 Think these error modifications are also required in 2.0, it is also possible to combine the modifications in Release_1_0_patch_1 in the 2.0 development directory: CVS Update -j release_1_0_ps Update -j release_1_0_patch_1cvs remote authentication: remote access by SSH CVS ================================ Using CVS itself based on PServer remote authentication is cumbersome, you need to define server and user groups , User name, setting password, etc., and unsafe, so that the system local account authentication is certified and passed through SSH transmission, by setting the content in the client / etc / profile: cvsroot =: ext: $ user @ Test.server.address # port: / path / to / cvsroot CVS_RSH = SSH; Export CvsRoot CVS_RSH All client All local users can map to the CVS server corresponding to the same name account.

If the SSH port of the CVS is not in the default 22, or and the client is inconsistent with the CVS server SSH default port, sometimes it is set :: ext: $ uTest.server.address#port: / path / to / cvsroot is still not, such as the following error message: ssh: test.server.address # port: name or service not know [checkout bromorted]: End of File from Server (Consult Above Messages if any) Solving a script Specify port steering (can not use Alias, you can not find file error): Create a / usr / bin / ssh_cvs file: #! / Usr / bin / sh / path / to / ssh -p 34567 "$ @" then: CHMOD X / USR / BIN / SSH_CVS and CVS_RSH = SSH_CVS; Export CVS_RSH Note: Port refers to the port of the corresponding server SSH, not the port of CVS PServer CVSWeb: Improve file browsing ============ =========== CVSWeb is the web interface of the CVS, which can greatly improve the efficiency of programmers positioning modifications: Use the sample to see: http://www.freebsd.org/cgi/cvsweb.cgicvsWeb Download: CvsWeb has evolved a lot of function interfaces from the initial version, this is my personal feeling installation settings easier: http://www.spaghetti-code.de/software/linux/cvsweb/ download solution Package: TAR ZXF CVSWeb.tgz puts the configuration file cvsWeb.conf to a safe place (such as the same directory in the same directory), modify: cvsWeb.cgi let CGI find profile: $ config = $ env {' CvsWeb_config '} ||' /Path/to/apache/conf/cvsweb.conf '; Go to / Path / TO / Apache / Conf and modify cvsWeb.conf: Modify CVSROOT Path Settings:% cvsroot = (' develop "= > '/ path / to / cvsroot', # <== Modify points to local cvsroot; default does not display documents that have been deleted: "hideattic" => "1 ", # <== default, the deleted document can also be customized in the profile cvsWeb.conf, you can modify $ long_intro to become the text CVSWeb you need, can not be open to all users, so Need to use Web User Certification: Mr. Chengwd: / Path / To / Apache / Bin / Htpasswd -c CVSWeb.Passwd User Modify httpd.conf: Add Authname "CVS Authorization"

Authtype BasicauthuserFile /Path/to/cvsweb.passwdrequire valid-user cvs tags: who? ==================== will add $ ID $ $ In the comments of the program file, it is a good habit. CVs can automatically interpret the contents of the update: file_name version time user_name format, such as: cvs_card.txt, v 1.1 2002/04/05 04:24:12 Chedong Exp However, you can learn about the final modification of the file and several commonly used default files: default.php ==== ================================ DEFAULT.JAVA: Pay attention to the file header Note Use / * Start Javadoc Note / * * Start / ** Copyright (c) 2002 mycompany name. * $ Header $ * / package com.mycompany; import java.; / *** Comments here * / public class default {/ *** comments here * @ PARAM * @ Return * / public toString () {}} ============================================== DEFAULT .pl: #! / usr / bin / perl -w # copyright (c) 2002 Company name. # $ # # file comments here =================== CVS no file lock Mode, VSS at Check Out, and records the file is locked by the exporter. CVS's Update and Commit, VSS is Get_lastest_Version and Check IN CHECK OUT / undo check out's CVS in the CVS of EDIT and UNEDIT in CVS, tag automatic update features are open, which also brings a potential problem If you don't have to add a binary file without the -kb method, you may cause file failure when CVS is automatically updated.

This feature in Virsual SourceSafe is called Keyword Explaination, the default is off, you need to open through OPition, and specify the type of source file keyword scanning: *. Txt, *. Java, *. Html ... for Virsual SourceSafe and CVS are common TAGs are: $ Header $$ Author $$ Date $ $ Revision $ Try to use General Keywords to ensure that the code can be tracked in CVS and VSS. WinCVS ====== Download: CVS Windows client: Currently stable version is 1.2http: //www.wincvs.org/ssh windows client http://www.networksimplicity.com/openssh/ Installed above 2 After the software: WinCVS client's admin ===> Preference Setting 1 Set cvsroot in the General menu: username@192.168.0.123: / home / cvsroot Setup Authorization: Select SSH Server2 Port Splable Hook: Check for Alternate RSH Name and set SSH The path of .exe, the default is installed in C: / Program files / networksImplicity / ssh / ssh.exe then you can use WinCVS to perform CVS operation, all operations will jump out of the command line window to enter the authentication password of the server. Of course, if you feel so annoying, there is another way to generate a public key / private key pair without a password, and set the CVS using the public key / private key SSH certification (in the general menu). You can choose the DIFF tool: http://www.prestosoft.com/examdiff/examdiff.htm or in the WinCVS menu admin ==> Preference's WinCVS menu option: Externel Diff Program and set the path to the DIFF tool, For example,: c: / program files / ed16i / examdiff.exe When the file is sent to the file, the first time you need to select the USE EXTERNEL DIFF in the lower right corner of the window. CVS-based group development environment built ======================== as a group-level development environment, version control system and BUG tracking system, etc. User authentication section. How to easily integrate these systems is a very interesting thing, after all, we can't count on the version control / bug tracking integrated system with high integration as Source OFFSITE. I personally oppose remote user authentication using the PServer mode, but if most of the group members develop by using the Windows client, generally use cvsroot / passwd certifications or difficult to avoid, but CVS users are more troublesome. Originally, I planked to write a management interface with Perl until I found CVSTRAC, a web-based BUG tracking system, which hangs on the CVS system, including the management of the cvsroot / passwd file of the web interface, and even Integrated Wikiwiki feature.

Here first, the user authentication in the CVS PSERVER mode is based on inetd: CVSPServer Stream TCP NOWAIT NOBOWDY / USERVERVERVS - ALLOW-ROOT = / home / cvsroot PServer is generally at 2401 Port CVS User Database is based on cvsroot / passwd file, file format: [username]: [mapping_ssword]: [mapping_system_user] Since the password is used by the Unix standard Crypt encryption, this Passwd file format is basically Apache's htpasswd format. Extended (one system user mapping field than Apache), so the simplest method of this file can be created with apache / bin / htpasswd -b myname mypassword. Note: The file created by HTPasswd will not map the field of the system user, for example: new: gebvosup / zkl2setup: aisqunaoy3qwtest: hWEPZ / BX.REDu mapping system user's purpose is: You can create a special CVS service account, such as CVS And give all permissions in the / home / cvsroot directory to this user, then create different development user accounts in the Passwd file, but develop user account last file read and write permissions are mapped to CVS users, avoiding in SSH mode Multiple development users read and write permission issues for other users after new files. Further, you can map the user to 2 groups, using 2 users' permissions settings to avoid access to each other with each other. New: Gebvosup / zkl2: Proj1setup: AisqunaAoy3QW: Proj2test: hwez / bx.redu: Proj1 Cvstrac Very good to solve the management problem of cvsroot / passwd, and contain bug tracking reporting system and integrated Wikiwiki communication function, using CGI mode Installation, and Based on GNU public license: installation process download: http://www.cvstrac.org/ Unpack, copy into / usr / bin / cvstrac on the already installed CVS server (assuming CVS library has been used with CVS init Initializing over / home / cvsroot, running cvstrac init / home / cvsroot myproj running, there is a default MyProj.db library in / home / cvsroot in the APCHE / CGI-BIN directory CVSTRAC: #! / bin / sh / usr / bin / cvstrac CGI / HOME / CVSROOT Settings CVSTRAC can be executed. From http: //cvs.server.address/cgi-bin/cvstrac/myproj to the management interface, the default login: SETUP password setup Add CVSPServer service in inetd: CVSPSERVER Stream TCP NOWAIT NOBODY / USR / BIN / CVS CVS - -ualow-root = / home / cvsroot pserver Note: The user is set to Nobody's purpose is to consistent with Apache's running users and must let this user initialize the cvsroot / passwd and cvstrac initialization MyProj on / home / cvsroot / CVSROOT / PASSWD and CVSTRAC. .db has read and write permissions.

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

New Post(0)