Getting started with Windows Environment CVS Client
V0.1
Created by Cao Xiao Gang, 2002/01/03 Last Updated by $ Author $, $ DATE $
This article is purely "entry" nature, please refer to the CVS manual for the specific and in-depth command.
This article first introduces the basics of CVS, and then gives a process instance for popular tools.
table of Contents
CVS Client You must understand the basic concept of the CVS command line MFC Wind Windows platform CVS graphics interface - WinCVS (unfinished) Direct CHECKOUT in Windows Explorer ---- TortoiseCVS Confidential Process Instance Based on NetBeans Java Class Library Gui ---- SmartCVS (unfinished) Visual Age for Java IDE integrated plugin --- Vaj2cvs (unfinished) JBuilder Built-in CVS Support (unfinished), leading work platform --- Eclipse and built-in CVS support ( Unfinished) Visual Studio IDE integrated plugin - CVSIN (unfinished)
Basic concepts must be understood before use before using CVS Client
1, CVS
CVS (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 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, Repository, Module
On the CVS server, a source warehouse is called a repository, and multiple repository can be run on a server, each repository is completely independent, and there are 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, cvsroot
CVS 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 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, Revision
Revision refers to the version information of each file. When you add a file to repository for the first time, it will have an initial revision that is 1.1, and will increase to 1.2, 1.3 ...
In a branch file, there is a version number relative to this branch. 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, Branch
Branch 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, TAG
TAG 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 here
CVS command line
After getting CVSROOT and your password, you can try to log in.
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 programs, from www.cvsnt.org you can get a CVSNT download connection, which contains a command line's 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 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
The correct login will not have any output, otherwise you will tell you the reason.
cvs
3. Let's take a look at what Module in this CVS Server.
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 new file newfile.txt,
Then, execute in this directory:
You need a commit that it can 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 Reserve online computer bookstore Order http://www.huachu.com.cn/asp/book/brow.asp?lbbh=b99112091
Windows platform CVS graphical interface written with MFC - 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.
Please go to www.cvsgui.org, there is the latest version.
After opening the start menu, what you see is this interface:
The interface consists of three major regions. It is a directory structure. The upper right corner is the detailed content of the folder. 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.
CHECKOUT directly in Windows Explorer ---- TortoiseCVS
TortoiseCVS is already a quite mature CVS interface, which 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.
Click here to enter a detailed description of using TortoiseCVS
Beautiful GUI based on NetBeans Java class library ---- SmartCVS
The CVS GUI written in Java has been greatly developed in the past year or two. Worship JDK1.3, now there is a great improvement of the execution of the Java program. NetBeans is an open IDE sponsored by Sun, which contains CVS's underlying class libraries. A commercial GUI, SmartCVS is written on the stable CVS core of NetBeans. Although SmartCVS's commercial version is charged, its base version is completely free, and this foundation is enough to be most applications.
SmartCVS You can download at www.regnis.de.
SMARTCVS starts to introduce SmartCommit from the 1.2beta version, no longer distinguishing Add and Checkin, uniformly use commits.
With SmartCVS, you can also see the history of a file, as well as each branch of graphical representation.
Summary: SmartCVS is just like his name, is a quite smart, exquisite, beautiful CVS client. It is completely competent as a daily job. If you combine with Tortoiescvs, you can give you a quite ideal CVS work platform.
At the same time, it can also be run in all JDK environments, not only to Windows platforms.
IDE integration
For programmers, when you are coding, IDE is the most touching environment every day. If you can use CVS in the familiar IDE, of course, the practicality has a lot of practicality. Visual Source Safe integrates quite good in Microsoft's development tools products VB, VC, and greatly improves the use of Microsoft development platforms.
Let's take a look at how to use CVS in the popular Java development tool.
IBM Visual Age for Java IDE Integrated Plugin --- Vajcvs (unfinished)
Visual Age for Java supports an open Tool API, Cvsin is such a TOOL.
download link:
Install to see its internal ReadMe file.
Borland JBuilder Built-in CVS Support
JBuilder has long built-in CVS support in 3.0, and CVS is the only officially supported source code management tool at that time. In the latest Builder 6, of course, it is also very good for CVS.
Perfect design, leading power platform --- Eclipse and built-in CVS support
IBM's new open integrated development environment will be the next platform for IBM Visual Age Series Development Tools. It provides CVS as part of the foundation. Accessing CVS in Eclipse is a fairly relaxing thing, Eclipse encapsulates CVS according to your needs, you can see, and other access methods are completely different, Eclipse is the most powerful CVS work platform now. Visual Studio IDE integrated plugin - CVSIN (unfinished)
This is a CVS plug-in for Visual Studio, you can use it without leaving the IDE integration environment.