Subversion is easier to use than CVS

Source: Internet
Author: User
Tags subversion client svn update
For a long time, in the Open Source world, CVS (Concurrent Versions System) has always been the first choice for version control. But now the user has another option: subversion. Subversion is the next generation of version control system, can replace CVs, the project home page is http://subversion.tigris.org.

Subversion is a free and open source version control system. It is a common system that can be used to manage any type of files, including program source code.

It has a clear initial goal to implement most of the existing functions of CVS. It fully considers the existing CVS users, imitates CVS in usage, and develops a series of tools, this allows the CVS-based project to be smoothly migrated to the subversion. Compared with CVS, it has many advantages, such as directory version control, inseparable submission, consistent data processing methods, and more efficient branch and tag.

Installation and initialization

The Subversion is created on a portable APR (Apache Portable Runtime, Link Library. This allows the Subversion to work on any operating system that can execute Apache.

Subversion can be used in two ways. One is that it can be used as a module of Apache 2.0 and be connected to the outside world using the WebDAV/DeltaV Protocol. In addition, you can also use a small server program that comes with subversion. The program uses its own communication protocol, which can be easily used through SSH in tunnel mode.

The simplest way to install subversion is to use the binary version provided by subversion (files in rpm, Deb, and ports formats are downloaded on the project website ). Select the desired file to download according to the system. Here the red hat is used, so the RPM format is selected.


     
      #rpm -Uvh apr-0.9.5-0.2.i386.rpm#rpm -Uvh apr-devel-0.9.5-0.2.i386.rpm#rpm -Uvh apr-util-0.9.5-0.1.i386.rpm#rpm -Uvh apr-util-devel-0.9.5-0.1.i386.rpm#rpm -Uvh neon-0.24.4-1.i386.rpm#rpm -Uvh neon-devel-0.24.4-1.i386.rpm#rpm -Uvh subversion-1.0.0-1.rh90.i386.rpm#rpm -Uvh subversion-devel-1.0.0-1.rh90.i386.rpm#rpm -Uvh subversion-server-1.0.0-1.rh90.i386.rpm#rpm -Uvh subversion-tools-1.0.0-1.rh90.i386.rpm
     

Run the following command to set environment variables: # export editor = vi

To create a file library, run the following command: # svnadmin create/opt/proj/Fox

Import the contents of the Directory Doc directly to the fox directory of the file library. The command is as follows: # SVN import/root/DOC file: // opt/proj/Fox

Subversion component

After the Subversion is installed, there will be several different tools, mainly divided into client components and server components.

Client components are used by users. They mainly include the following two components:
SVN is a command line client program used to manage data.
Svnversion is used to view the mixed version status of a work copy.

Server components are used by administrators, including the following components:
Svnlook is a tool used to view the Subversion file library.
Svnadmin is a tool used to create and adjust the Subversion file library.
Mod_dav_svn is a module used by apache2.0 Web server. It can be used to open your file library to the outside through the network.

Svnserve an independent server program that can be executed as a server process or started by SSH, allowing the user's file library to be accessible to others on the network.

Advantages

Subversion is similar to CVS in usage, but some new features are different from the design and CVS. Next we will talk about the differences between the two, so that users can feel the advantages of subversion.

Different revision numbers
In CVs, each file revision number is different. This is because CVS is based on RCS. Each file has a corresponding RC file in the file library, and the structure of the file library is roughly expanded according to the directory structure.

Directory version
The Subversion also tracks the file tree structure, not just the file content. The Subversion directory also has a revision number like a file. The "SVN Add" and "svn rm" commands can be used in directories, just like in files. The same is true for "SVN copy" and "SVN move. However, these directories will not immediately change the file library. On the contrary, work items are only "scheduled" to be added or deleted. Unless the user executes "SVN commit", the file library will not change. This is a bit like deleting files in windows. It only marks the deletion in the fat table but does not actually delete the files.

Offline Functions
The working copy of the Subversion is optimized for network bandwidth bottlenecks .. Like the CVS directory, SVN is a management directory, but SVN also stores original copies of files. This allows users to perform many tasks offline, for example:
"SVN status" displays local updates;
"SVN diff" displays detailed update details;
"SVN revert" removes the user's local updates.
In addition, the Subversion client only transfers the difference when submitting the file copy. This is not available in CVS.

Differentiate status and update
In subversion, we try to solve the issue of ambiguity between the "CVS status" and "CVS Update" commands. The "CVS status" command has two purposes: one is to display local changes made by the user in the work copy; the other is to display outdated files by the user. However, the content displayed by CVS is not easy to understand. Many CVS users cannot make full use of this command. Instead, execute "CVS up" to view their updates.
Subversion tries to make the data output by "SVN status" easy to understand and solve the problem above. In addition, "SVN Update" only displays the updated file information, rather than local updates.

Attribute
A new feature of subversion is that users can attach any data to files and directories. These materials are called attributes. To set or obtain the attribute name, you can run the "SVN propset" and "SVN propget" commands. to list all attributes of an object, run the "SVN proplist" command.

Conflict Resolution
CVs will place a "Conflict mark" in the file to mark the conflict, but CVS does not do enough. Many users cannot remember (or cannot see clearly) the conflicting code that quickly flashed on the terminal.
The Subversion solves this problem by explicitly marking the conflict. It will remember that the file is in a conflict state. Unless the user executes the "SVN resolved" command, it will not allow the user to submit the file.

Binary and text files
Subversion is better at processing binary files than CVs. Because CVS uses the relationship of the RCS, it stores each updated copy of a binary file in a change. However, no matter whether the file is of the text or binary type, the Subversion internally uses the binary difference comparison algorithm to represent the update part of the file. This indicates that all files are stored in different file libraries. In addition, all files transmitted over the network are slightly different.
The CVS user must mark the binary file as "-kb. Subversion does not convert any keywords or column-end symbols unless required by the user. The Subversion internally maintains the record of whether the file is a "text" or "binary" file and saves it in a working copy. When "SVN Update" is executed, subversion merges the content of local text files, but does not perform such operations on binary files.

Summary

Subversion has a good document-Version Control with subversion (http://svnbook.red-bean.com /). It provides various subversion-related content, such as usage, Management, and Development.

After several years of development, we finally achieved version 1.0 to replace the subversion of CVS. I believe that, with its powerful functions, it will certainly develop well for the strong inheritance of CVS.

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.