51CMM.COM of finishing: CAO steel [2004/04/29]
CVS Client must understand the basic concept 1, CVSCVS (Cuncurrent Versions System) is a version control tool based on TCP / IP protocol, and is also one of the most important development tools in the Open Source. It turned out that under the UNIX platform, many GUI tools have also appeared on the Windows platform. For its origin, development, please refer to http://www.redsaga.com/cvs_newbie_win32/www.cvshome.org. The CVS is the same as most version control software, is of the Client / Server structure. You must prepare a directory for CVS Repository locally, and synchronize source code. And the CVS is mainly due to two differences compared to Visual Source Safe (VSS) with a large user base in the Windows development platform. First, the VSS provides services on a shared directory on the server, and each client must be able to access this shared directory. This also determines that Source Safe is difficult in TCP / IP environments. For the distribution of working groups across several cities and even the country, only VPN can access the Source Safe database safely. (SourceGear (www.sourcegear.com) Offers a commercial package called SourceOffSite, US $ 239 Per User, can also provide remote users to access Source Safe data through TCP / IP.) And CVS rely on TCP / IP connection Service, so it is naturally designed to work together on the Internet. Although basic PServer connection security is not very high, high security can be obtained by using SSH. The second is the mechanism against the CVS against the lock. VSS and many other traditional version control tools require a file to have only one user, it must first check out the exclusive power of editing files until checkin. However, for CVs that geographically unlimited user locations, waiting for a user Checkin is a painful thing, while each other is more difficult than working with a close job. CVS takes multiple users to edit a file at the same time, and then solve this problem. Assume that due to insufficient communication, the user must handle the conflict after handling the CommT. In this case, the developers of conflict must work to communicate sufficient communication to avoid conflict again. The CVS server can be configured to automatically post the commit record to the newsgroup or the developer's Email mailbox. Note that these auxiliary records will help cooperate between developers. 2, on the Repository, ModuleCVS server, a source code repository is called a repository, and multiple repository can usually run on a server, each repository is completely independent, can have different user lists and access rules. Under a repository, the file is organized according to the Module, each module is equivalent to a project, which is substantially equivalent to the Project in Source Safe. VSS will list all Project after you connect the server. But not all CVS Server will provide a list of Module. In fact, which module is disclosed is controlled by the administrator. If you know a hidden Module name, you can still access this module normally. 3, CVSROTCVS provides TCP / IP connection with a service program running on the server. In order to access a CVS database, you must know the protocol you use, the server's address, the name of the server, and the name of your username and password. There are several protocols available. The CVS on the UNIX / Linux machine typically uses the PServer protocol, which is an unaccompagical protocol, but if you have additional security requirements, you can enhance it through SSH.
In addition, the NT machine also supports the NTServer protocol, which is access control through the NT user table of the host (but this is an unavailable method on the INTERNET). The Kserver and Gserve Agreements are relatively small, and they provide additional security in Kerboses. You need to know the parameters of cvsroot. CVSROOT is a string that starts and separated by each part with ":", which contains protocol, username, server address, and repository name. For the user, CVSROOT is like a URL, which is a way to access a Server. A typical cvsroot =: Perser: cao@61.155.107.187: / cvs. Here, PServer is the name of the protocol, and CAO is user ID, 61.155.107.187 is the host IP, / cvs is the name of Repository. NT host's repository generally takes a format such as D: / CVSROOT. Another example is: PServer: anonymous@jivesoftware.com: / CVS, this is the cvsRoot of the open source Java technology forum provided by Jivesoftware. Use the command line in Windows, this parameter can be used through an environment variable. In the Windows 2000 / XP system, you can enter this environment variable by selecting Advanced in the 'My Computer' Properties, then select 'Enviroment Variables'. 4, Checkout, Update In order to get the source code below Module, you only need to use the Checkout instruction. And Visual Source Safe is different, Checkout just obtains files, not lock files. If you already have a local file, you need to make an UPDATE operation in order to keep synchronization with Server. Update automatically takes the new content on the server to this unit, if your local file has changed, it will help you merge work. Checkout and Update can either a specific file or a directory or entire Module. 5, Commit If you make any modifications to your local code, or add a file, remove a file, whenever you need to submit your changes to the Server, you will need to do your COMMIT action. Suppose two people have changed the same file locally, then they are like a competition, if you are fast, then you have won. After Commit people will be refused by Server and have to merge your modification again. Commits can either a specific file or for a directory or entire Module. 6. RevisionRevision refers to the version information of each file. When you first add a file to the repository, it will have an initial revision to be 1.1. After each submission, it will increase to 1.2, 1.3 ... in a branch file, there is relative to this Branch version number. If you make Tags for the file, then you will see the revision into a form of 1.1.1.1. The specific meaning we describe when Branch and TAG. 7. Branchbranch is a branch in a normal growth code tree. At start, any Module has a primary branch called 'head'. A Branch is ultimately either merged into the backbone or is either ended. Branch is usually used to debug. If this bug is fixed, the code to modify the bug should be merged to the main branch. A Branch may also experience the merger of multiple branches. 8, tagtag is used to mark the necessary information. You need to mark the main branch "Release 1.0" when you make an open release.
This way you can return to this version in the future. // to do: Please perfect the description of the CVS command line here After getting cvsroot and your password, you can try it. First, because all of the other GUI tools are based on CVS basic protocol, and they may provide the CVS command line or equivalent form as part of the display, so you should understand the command line operation. If you have no CVS yet. EXE command line program, from http://www.redsaga.com/cvs_newbie_win32/www.cvsnt.org you can get a CVSNT download connection, which contains a command line CVS.exe program. Let's start with it (for use as a client, you don't need to install CVSNT Server Components). CVSNT's cvs.exe is specifically written for Windows, you need to put cvs.exe inside your PATH. 1. Enter the command line method. Like VSS, you also need to have a working directory locally in a repository. Assume that this directory is 'D: / Works / Sandbox'. Please switch to this directory. Enter "CVS". You will see: These prompt information tells you about the basic syntax of CVS. The CVS followed by the global parameter, then the command, the final is the parameter of the command. 2.Login's correct login will not have any output, otherwise you will tell you the reason. CVS 3. Let's take a look at which of this CVS Server is Module. 4. Suppose the project we work now is ProjectX, below we need to get all the files below. Let us look at what we have gotten. In the D: / Works / Sandbox directory, you can see there is a projectx directory. This is all the documents you get. You will find a directory called CVS in this directory. Danger! Please don't delete this directory, or change your name, or change any files, unless you know what you are doing. This directory is the control directory of CVS. If you have used Source Safe, you must be very familiar. SCC This file, the role of the CVS directory is the same as this control file, is used to record the parameters of your access server. Here we need to explain the noun differences in CVS and VSS. In VSS, Checkout means you will get a file modification, and the meaning of Checkout in CVS is canceled, refers to the new version of the file. Many CVS Server will have an Anonymous user, and he has only Checkout permissions, which means it read only. 5. Let's try to join a file: Under D: / Works / Sandbox / ProjectX, create a file newfile.txt, then execute in this directory: You need commit to be accepted by Sever. A NotePad window pops up, please enter a comment. This is the result of Commit completion. The current version number is 1.1. 6. Ok, now suppose you need to change the content of this file. CVS can help you compare what you are now different from your version and repository. Ok, now you can submit your new file. CVS will help you keep your versions. After commit, let's take a look at all versions of history. 7. Finally, in order to complete this test, please delete this newfile file. We now know some of the most basic CVS entry-level instructions. In fact, CVS is very powerful. We don't use some more complex features, please refer to CVS manual to get more detailed help. When multiplayer is developed, the conflict sometimes cannot be avoided. // TO DO: Add some part of processing CVS Update and processing Merge. For more information, please refer to the book of "Open Source Development with CVS" of Karl Fogel.
The book's Chinese translation "CVS open source software development technology" is published by Machinery Industry Press (ISBN 7-111-08891-3 / TP.1885, RMB 35.00). Click here to connect to Warm Online Computer Bookstore Order http://www.huachu.com.cn/asp/book/brow.asp?lbbh=b99112091 Write the Windows Platform CVS Graphics Interface --- WinCVS (Unfinished) Ok, just like a black and white movie will always transition to color movies. Since the CVS protocol is open, you can write one as long as your programming language supports Socket communication. There are several attempts in this world, and WinCVS is one of them. It is developed with MFC on the Win32 platform. From my own experience, this is a useful trial, but it is far from fine. This Windows interface is still very rough and the PVC's interface is compared to the interface of the VSS and Source Off Source, and the PVCS interface. But we can still start our work from it. Downloads Please go to http://www.redsaga.com/cvs_newbie_win32/www.cvsgui.org, where there is the latest version. After opening the start menu, you see such an interface: the interface consists of 3 main areas, sitting on the directory structure, the upper right corner is the folder details, the lower right is the log of the CVS command. You can learn more about the CVS run from the LOG below. First of all, what you have to do is tell WinCvs your cvsroot. This dialog is slightly different in various versions of WinCVS 1.2 and 1.3, but does not hinder the details of your CVS server. The next step is login. Ok, now we can get a JIVE2 source code. You can see that WinCVS will add compressed parameters by default, which reduces network traffic and speeds up speed. Similarly, it is also very convenient to modify file modification with WinCVS. The above is the brief operation guide of WinCVS. For further complex operations, please refer to its help. Evaluation: It is worth paying attention, but it is not recommended. In Windows Explorer directly Checkout ---- TortoiseCvStorToiseCVS is already a quite mature CVS interface, and its work is also very interesting. TortoiseCVS is a concise and effective CVS interface. You can use it to replace WinCVS to do everyday work. His unique way of operation is very charming, in some commercial configuration management tools, such as Rational ClearCase, you can also see such a Windows Explorer extension work mode. Disadvantages: 1. TortoiseCVS will never release some of its CVS files and folders that it operate. You may have trouble when trying to delete a directory under CVS control. The Windows system thinks that there is another process that is turning it (obviously TortoiseCvs), I didn't find how to kill the TortoiseCVS executed in the background. In this case, use TortoiseCVS to Update to the other Module help. Or please restart your Explorer. 2, if you need to do Checkout on two different Server or Repository, TortoiseCVS has a bug. It will use the first repository's cvsRoot when you enter CVSROOT information, Checkout second Module. But then the same operation will succeed in your goal. Evaluation: Recommended.