Latest web development tutorials

SVN Profile

Subversion (SVN) is an open source version control system, which means that Subversion manages the data changes over time. The data is placed in a central repository (repository) in. The archive much like an ordinary file server, but it remembers every change in the file. So you can restore the file to change the history of the old version, or browse files.


Some concepts of SVN

  • repository (source code repository): Source unified storage areas
  • Checkout (extract): When you do not have the source code, you need to copy from the repository checkout
  • Commit (submission): When you have modified the code, you'll need to Commit to the repository
  • Update (Update): When you have a Checkout the source code, Update what you can and source code synchronization on the Repository, your hand will have the latest code changes

Daily development process is actually like this (assuming you've Checkout been working for several days): Update (get the latest code) -> make their own changes and the successful commissioning -> Commit (you can see your changes a).

If two programmers to modify the same file at the same time it, you can merge the two programmers SVN changes actually SVN source code based on behavior management units, that if not two programmers to modify the same line program, SVN will automatically modify either merger. If it is the same line, SVN will be prompted to file Confict, conflict, need to manually confirm.

The main function of SVN

  • (1) directory under version control

    CVS can trace the history of individual files, but Subversion implements a a "virtual" version of the Control file system, the ability to track changes in the entire directory by time. Directories and files can be versioned.

  • (2) real version history

    Since CVS version limits the record file, CVS does not support that may occur in the document, but it will affect the operation of the directory contents, like copying and renaming. In addition, the CVS where you can not have the same name but a replacement has been included in the file system did not inherit the history of older versions of files or no relationship. In Subversion, you can add (add), delete (delete), copy (copy) and rename (rename), whether it is a file or directory. All newly added files are from a new, clean version begins.

  • (3) automatically submitted

    A submission actions, not all updates to the repository is completely updated. This allows developers to create and submit a logical interval changes, to prevent part of the submission is successful when the problem.

  • (4) Control versioned metadata

    Each file and directory are accompanied by a set of keywords and attributes and attribute values ​​associated. You can create and store anything you want Key / Value pairs. Property over time to make versions of Control, just like file contents.

  • (5) to select a different network layer

    Subversion repository access abstract concept, people can easily implement new network mechanisms. Subversion can be used as an extension module embedded Apache HTTP server. This is Subversion provides a very advanced stability and ability to work together, in addition to providing a number of important functions: for example, identity authentication, authorization, wire compression, and repository browsing, file. There is also a lightweight standalone Subversion server, use a custom communications protocol, it can easily be done by using ssh to tunnel mode.

  • (6) the same data processing

    Subversion using a binary differencing algorithm to represent differences in different file, its text (humanity understandable) and binary files (beyond human understanding) types of files are treated equally. These two types of files are stored in compressed form in the same manner in the archive, and the file is a difference between the two directions of transmission on the network.

  • (7) Effective branch (branch) with a label (tag)

    On a branch with the label and do not have to consume is proportional to the project size. Subversion creates branches and tags approach, just copy it, the method used is similar to hard links (hard-link). Therefore, these operations take only a very small, but is a fixed period of time.

  • (8) Hackability

    Subversion has no historical baggage; it is primarily a group of shared C libraries with well-defined API. This makes Subversion easy to maintain, and can be used by other applications and programming languages.

Place better than CVS

1, atomic commit. Commit either single or multiple files are submitted as a whole. Among these accidents happen, for example, transmission is interrupted, the database will not cause data corruption and incomplete.

2, rename, copy, delete files and other movements are stored in the version history of them.

3. For binary files, the use of space-saving method of preservation. (Simple to understand, and that is only stored on a different version of a place)

4, the directory also has a version history. The entire directory tree can be moved or copied, the operation is very simple, and can retain all version records.

5, the overhead branch is very small.

6, optimized database access, so some operations can be done without accessing the database. This reduces network traffic between a lot of unnecessary and database host.