Jump to content

Apache Subversion

From Wikipedia, the free encyclopedia
Apache Subversion
Original author(s)CollabNet
Developer(s)Apache Software Foundation
Initial release20 October 2000; 24 years ago (2000-10-20)
Repository
Written inC
Operating system
TypeRevision control
LicenseApache-2.0[a]
Websitesubversion.apache.org Edit this on Wikidata

Apache Subversion (often abbreviated SVN, after its command name svn) is a version control system distributed as open source under the Apache License.[1] Software developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation. Its goal is to be a mostly compatible successor to the widely used Concurrent Versions System (CVS).

The open source community has used Subversion widely: for example, in projects such as Apache Software Foundation, FreeBSD, SourceForge, and from 2006 to 2019, GCC. CodePlex was previously a common host for Subversion repositories.

Subversion was created by CollabNet Inc. in 2000, and is now a top-level Apache project being built and used by a global community of contributors.[2]

History

[edit]

CollabNet founded the Subversion project in 2000 as an effort to write an open-source version-control system which operated much like CVS but which fixed the bugs and supplied some features missing in CVS.[3] By 2001, Subversion had advanced sufficiently to host its own source code,[3] and in February 2004, version 1.0 was released.[4] In November 2009, Subversion was accepted into Apache Incubator: this marked the beginning of the process to become a standard top-level Apache project.[5] It became a top-level Apache project on February 17, 2010.[6]

Version Original release date Latest version Latest release date Status
Old version, no longer maintained: 1.0 2004-02-23 1.0.9 2004-10-13 No longer supported
Old version, no longer maintained: 1.1 2004-09-29[7] 1.1.4 2005-04-01 No longer supported
Old version, no longer maintained: 1.2 2005-05-21[8] 1.2.3 2005-08-19 No longer supported
Old version, no longer maintained: 1.3 2005-12-30[9] 1.3.2 2006-05-23 No longer supported
Old version, no longer maintained: 1.4 2006-09-10[10] 1.4.6 2007-12-21 No longer supported
Old version, no longer maintained: 1.5 2008-06-19[11] 1.5.9 2010-12-06 No longer supported
Old version, no longer maintained: 1.6 2009-03-20[12] 1.6.23 2013-05-30 No longer supported
Old version, no longer maintained: 1.7 2011-10-11[13] 1.7.22 2015-08-12 No longer supported
Old version, no longer maintained: 1.8 2013-06-18[14] 1.8.19 2017-08-10 No longer supported
Old version, no longer maintained: 1.9 2015-08-05[15] 1.9.12 2019-07-24 No longer supported
Old version, no longer maintained: 1.10 2018-04-13[16] 1.10.8 2022-04-12 No longer supported
Old version, no longer maintained: 1.11 2018-10-30[17] 1.11.1 2019-01-11 No longer supported
Old version, no longer maintained: 1.12 2019-04-24[18] 1.12.2 2019-07-24 No longer supported
Old version, no longer maintained: 1.13 2019-10-30[19] 1.13.0 2019-10-30 No longer supported
Current stable version: 1.14 2020-05-27[20] 1.14.4[21][22][23] 2024-10-08 Fully supported, LTS
Future release: 1.15 20XX 1.15.0 (Not yet released) In development
Legend:
Old version, not maintained
Old version, still maintained
Latest version
Latest preview version
Future release

Release dates are extracted from Apache Subversion's CHANGES file,[24] which records all release history.

Features

[edit]
  • Commits as true atomic operations (interrupted commit operations in CVS would cause repository inconsistency or corruption).
  • The system maintains versioning for directories and some specific file metadata (see Properties). Users can move or copy files and entire directory-trees very quickly, while retaining full revision history (as being implemented by a reference to the original object).
  • Versioning of symbolic links.
  • Native support for binary files, with space-efficient binary-diff storage.
  • Apache HTTP Server as network server, WebDAV/Delta-V for protocol. There is also an independent server process called svnserve that uses a custom protocol over TCP/IP.
  • Branching is implemented by a copy of a directory, thus it is a cheap operation, independent of file size.
  • Natively client–server, layered library design.
  • Client/server protocol sends diffs in both directions.
  • Parsable output, including XML log output.
  • Open source licensedApache License since the 1.7 release; prior versions use a derivative of the Apache Software License 1.1.
  • Internationalized program messages.
  • File locking for unmergeable files ("reserved checkouts").
  • Path-based authorization.
  • Language bindings for C#, PHP, Python, Perl, Ruby, and Java.
  • Full MIME support – users can view or change the MIME type of each file, with the software knowing which MIME types can have their differences from previous versions shown.
  • Merge tracking – merges between branches will be tracked, this allows automatic merging between branches without telling Subversion what does and does not need to be merged.
  • Changelists to organize commits into commit groups.

Repository types

[edit]

Subversion offers two types of repository storage.

Berkeley DB (deprecated)

[edit]

The original development of Subversion used the Berkeley DB package. Subversion has some limitations with Berkeley DB usage when a program that accesses the database crashes or terminates forcibly. No data loss or corruption occurs, but the repository remains offline while Berkeley DB replays the journal and cleans up any outstanding locks. The safest way to use Subversion with a Berkeley DB repository involves a single server-process running as one user (instead of through a shared filesystem).[25] The Berkeley DB backend was deprecated in version 1.8.[26]

FSFS

[edit]

In 2004, a new storage subsystem was developed and named FSFS. It works faster than the Berkeley DB backend on directories with a large number of files and takes less disk space, due to less logging.[25]

Beginning with Subversion 1.2, FSFS became the default data store for new repositories.

The etymology of "FSFS" is based on Subversion's use of the term "filesystem" for its repository storage system. FSFS stores its contents directly within the operating system's filesystem, rather than a structured system like Berkeley DB. Thus, it is a "[Subversion] FileSystem atop the FileSystem".

FSX

[edit]

A new filesystem, called FSX, is under development to remove some limitations of FSFS. As of Version 1.9, it was not considered production-ready.[27]

Repository access

[edit]

Access to Subversion repositories can take place by:

  1. Local filesystem or network filesystem,[28] accessed by client directly. This mode uses the file:///path access scheme.
  2. WebDAV/Delta-V (over http or https) using the mod_dav_svn module for Apache 2. This mode uses the http://host/path access scheme or https://host/path for secure connections using ssl.
  3. Custom "svn" protocol (default port 3690), using plain text or over TCP/IP. This mode uses either the svn://host/path access scheme for unencrypted transport or svn+ssh://host/path scheme for tunneling over ssh.

All three means can access both FSFS and Berkeley DB repositories.

Any 1.x version of a client can work with any 1.x server. Newer clients and servers have additional features and performance capabilities, but have fallback support for older clients/servers.[29]

Layers

[edit]

Internally, a Subversion system comprises several libraries arranged as layers. Each performs a specific task and allows developers to create their own tools at the desired level of complexity and specificity.

Fs
The lowest level; it implements the versioned filesystem which stores the user data.
Repos
Concerned with the repository built up around the filesystem. It has many helper functions and handles the various "hooks" that a repository may have, e.g., scripts that run when an action is performed. Together, Fs and Repos constitute the "filesystem interface".
mod_dav_svn
Provides WebDAV/Delta-V access through Apache 2.
Ra
Handles "repository access", both local and remote. From this point on, repositories are referred to using URLs, e.g.
  • file:///path/ for local access,
  • http://host/path/ or https://host/path/ for WebDAV access, or
  • svn://host/path/ or svn+ssh://host/path/ for the SVN protocol.
Client, Wc
The highest level. It abstracts repository access and provides common client tasks, such as authenticating users or comparing versions. Subversion clients use the Wc library to manage the local working copy.

Filesystem

[edit]

One can view the Subversion filesystem as "two-dimensional".[30] Two coordinates are used to unambiguously address filesystem items:

Each revision in a Subversion filesystem has its own root, which is used to access contents at that revision. Files are stored as links to the most recent change; thus a Subversion repository is quite compact. The system consumes storage space proportional to the number of changes made, not to the number of revisions.

The Subversion filesystem uses transactions to keep changes atomic. A transaction operates on a specified revision of the filesystem, not necessarily the latest. The transaction has its own root, on which changes are made. It is then either committed and becomes the latest revision, or is aborted. The transaction is actually a long-lived filesystem object; a client does not need to commit or abort a transaction itself, rather it can also begin a transaction, exit, and then can re-open the transaction and continue using it. Potentially, multiple clients can access the same transaction and work together on an atomic change, though no existing clients expose this capability.

Properties

[edit]

One important feature of the Subversion filesystem is properties: simple name=value pairs of text. Most properties occur on filesystem entries (i.e., files and directories). These are versioned just like other changes to the filesystem. The Subversion client reserves the 'svn:' prefix for built-in properties, but other names can be used to define custom properties.

svn:executable
Makes a file on Unix-hosted working copies executable, when supported by the filesystem.
svn:mime-type
Stores the Internet media type ("MIME type") of a file. Affects the handling of diffs and merging.
svn:ignore
A list of filename patterns to ignore in a directory. Similar to CVS's .cvsignore file.
svn:keywords
A list of keywords to substitute into a file when changes are made. The file itself must also reference the keywords as $keyword$ or $keyword:...$. This is used to maintain certain information (e.g., author, date of last change, revision number) in a file without human intervention.
The keyword substitution mechanism originates from RCS and from CVS.[31]
svn:eol-style
Makes the client convert end-of-line characters in text files. Used when the working copy is needed with a specific EOL style. "native" is commonly used, so that EOLs match the user's OS EOL style. Repositories may require this property on all files to prevent inconsistent line endings, which can cause a problem in itself.
svn:externals
Allows parts of other repositories to be automatically checked out into a subdirectory.
svn:needs-lock
Specifies that a file is to be checked out with file permissions set to read-only. This is designed for use with the locking mechanism. The read-only permission reminds one to obtain a lock before modifying the file: obtaining a lock makes the file writable, and releasing the lock makes it read-only again. Locks are only enforced during a commit operation. Locks can be used without setting this property. However, that is not recommended, because it introduces the risk of someone modifying a locked file; they will only discover it has been locked when their commit fails.
svn:special
This property is not meant to be set or modified directly by users. As of 2010 it is only used for having symbolic links in the repository. When a symbolic link is added to the repository, a file containing the link target is created with this property set. When a Unix-like system checks out this file, the client converts it to a symbolic link.
svn:mergeinfo
Used to track merge data (revision numbers) in Subversion 1.5 (or later). This property is automatically maintained by the merge command, and it is not recommended to change its value manually.[32]

Subversion also uses properties on revisions themselves. Like the above properties on filesystem entries, the names are completely arbitrary, with the Subversion client using certain properties prefixed with 'svn:'. However, these properties are not versioned, and they can be changed later if allowed by a pre-revprop-change hook.[33]

svn:date
The date and time stamp of a revision.
svn:author
The name of the user that submitted the change(s).
svn:log
The user-supplied description of the change(s).

Branching and tagging

[edit]

Subversion uses the inter-file branching model from Perforce[34] to implement branches and tagging. A branch is a separate line of development.[35] Tagging refers to labeling the repository at a certain point in time so that it can be easily found in the future. In Subversion, the only difference between branches and tags is how they are used.

A new branch or tag is set up by using the "svn copy" command, which should be used in place of the native operating system mechanism. The copied directory is linked to the original in the repository to preserve its history, and the copy takes very little extra space in the repository.

All the versions in each branch maintain the history of the file up to the point of the copy, plus any changes made since. One can "merge" changes back into the trunk or between branches.

alt text
Visualization of a simple Subversion project

Limitations and problems

[edit]

A known problem in Subversion affects the implementation of the file and directory rename operation. As of 2014, Subversion implements the renaming of files and directories as a "copy" to the new name followed by a "delete" of the old name. Only the names change, all data relating to the edit history remains the same, and Subversion will still use the old name in older revisions of the "tree". However, Subversion may become confused when a move conflicts with edits made elsewhere,[36] both for regular commits and when merging branches.[37] The Subversion 1.5 release addressed some of these scenarios while others remained problematic.[38] The Subversion 1.8 release addressed some of these problems by making moves a first-class operation on the client, but it is still treated as copy+delete in the repository.[39]

As of 2013, Subversion lacks some repository-administration and management features. For instance, someone may wish to edit the repository to permanently remove all historical records of certain data. Subversion does not have built-in support to achieve this simply.[40]

Subversion stores additional copies of data on the local machine, which can become an issue with very large projects or files, or if developers work on multiple branches simultaneously. In versions prior to 1.7 these .svn directories on the client side could become corrupted by ill-advised user activity like global search/replace operations.[41] Starting with version 1.7 Subversion uses a single centralized .svn folder per working area.[42]

Subversion does not store the modification times of files. As such, a file checked out of a Subversion repository will have the 'current' date (instead of the modification time in the repository), and a file checked into the repository will have the date of the check-in (instead of the modification time of the file being checked in). This might not always be what is wanted.[43] To mitigate this, third-party tools exist that allow for preserving modification time and other filesystem meta-data.[44][45] However, giving checked out files a current date is important as well — this is how tools like make(1) will take notice of a changed file for rebuilding it.

Subversion uses a centralized revision control model. Ben Collins-Sussman, one of the designers of Subversion, believes a centralised model would help prevent "insecure programmers" from hiding their work from other team members during development.[46] Some users of version control systems see the centralised model as detrimental; famously, Linus Torvalds attacked Subversion's model and its developers.[47]

Subversion often does not deal well with the filename normalization performed by the HFS+ filesystem. This can cause problems when files with accented characters in their names are added to the repository on a non-HFS+ filesystem and the repository is then used with HFS+.[48]

Subversion tags and branches

[edit]

Revision numbers are difficult to remember in any version-control system. For this reason, most systems offer symbolic tags as user-friendly references to them. Subversion does not have such a feature and what its documentation recommends to use instead is very different in nature. Instead of implementing tags as references to points in history, Subversion recommends making snapshot copies into a well-known subdirectory ("tags/") in the space of the repository tree. Only a few predefined references are available: HEAD, BASE, PREV and COMMITTED.

This history-to-space projection has multiple issues:

  1. When a snapshot is taken, the system does not assign any special meaning to the name of the tag/snapshot. This is the difference between a copy and a reference. The revision is recorded and the snapshot can be accessed by URL. This makes some operations less convenient and others impossible. For instance, a naive svn diff -r tag1:tag2 myfile does not work; it is slightly more complicated than that to achieve, requiring the user to know and input URL/paths to the snapshots instead of just the names: svn diff <URL-TO-TAG1>/myfile <URL-TO-TAG2>/myfile. Other operations like for instance svn log -r tag1:tag2 myfile are just impossible.
  2. When two (ideally independent) object types live in the repository tree, a "fight to the top" can ensue. In other words, it is often difficult to decide at which level to create the tags/ subdirectory:
    trunk/
         /componentfoo/
         /componentbar/
    tags/
        /1.1/
            /componentfoo/
            /componentbar/
    
     or 
    componentfoo/
                /trunk/
                /tags/
                     /1.1/
    componentbar/
                /trunk/
                /tags/
                     /1.1/
    
  3. Tags, by their conventional definition, are both read-only and light-weight, on the repository and client. Subversion copies are not read-only, and while they are light-weight on the repository, they are incredibly heavy-weight on the client.

To address such issues, posters on the Subversion mailing lists have suggested a new feature called "labels" or "aliases".[49] SVN labels would more closely resemble the "tags" of other systems such as CVS or Git. The fact that Subversion has global revision numbers opens the way to a very simple label → revision implementation. Yet as of 2013, no progress has been made and symbolic tags are not in the list of the most wanted features.[50]

Development and implementation

[edit]

CollabNet has continued its involvement with Subversion, but the project runs as an independent open source community. In November 2009, the project was accepted into the Apache Incubator, aiming to become part of the Apache Software Foundation's efforts.[51] Since March 2010, the project is formally known as Apache Subversion, being a part of the Apache Top-Level Projects.[52]

In October 2009, WANdisco announced the hiring of core Subversion committers as the company moved to become a major corporate sponsor of the project. This included Hyrum Wright, president of the Subversion Corporation and release manager for the Subversion project since early 2008, who joined the company to lead its open source team.[53]

The Subversion open-source community does not provide binaries, but potential users can download binaries from volunteers.[54] While the Subversion project does not include an official graphical user interface (GUI) for use with Subversion, third parties have developed a number of different GUIs, along with a wide variety of additional ancillary software.

Work announced in 2009 included SubversionJ (a Java API) and implementation of the Obliterate command, similar to that provided by Perforce. Both of these enhancements were sponsored by WANdisco.[55]

The Subversion committers normally have at least one or two new features under active development at any one time. The 1.7 release of Subversion in October 2011 included a streamlined HTTP transport to improve performance and a rewritten working-copy library.[56]

In 2002, a design contest was held to select the logo for Subversion. The original entries can be found here as well as the votes for each logo. The current logo received the most votes in the contest.

See also

[edit]

Notes

[edit]
  1. ^ Apache-2.0 since 2009-07-07.

References

[edit]

Footnotes

[edit]
  1. ^ "Subversion". directory.fsf.org. Free Software Directory. 2020. Retrieved 3 October 2023.
  2. ^ "The Apache Software Foundation Announces 20th Anniversary of Apache Subversion". GlobeNewswire News Room (Press release). 2020-02-27. Retrieved 2023-01-29.
  3. ^ a b Collins-Sussman, Ben; Brian W. Fitzpatrick; C. Michael Pilato (2011). "What is Subversion? > Subversion's History". Version Control with Subversion (for Subversion 1.7). Retrieved 15 March 2012.
  4. ^ Benjamin Zeiss (2004). "subversion 1.0 is released". Linux Weekly News. Retrieved 30 March 2014.
  5. ^ Rubinstein, David (4 November 2009). "Subversion joins forces with Apache". SD Times. Archived from the original on 2009-11-11. Retrieved 15 March 2012.
  6. ^ "Subversion is now Apache Subversion". 18 February 2010. Archived from the original on 12 May 2011. Retrieved 15 March 2012.
  7. ^ "Subversion 1.1 Release Notes". Retrieved 2015-09-21.
  8. ^ "Subversion 1.2 Release Notes". Retrieved 2015-09-21.
  9. ^ "Subversion 1.3 Release Notes". Retrieved 2015-09-21.
  10. ^ "Subversion 1.4 Release Notes". Retrieved 2015-09-21.
  11. ^ "Subversion 1.5 Release Notes". Retrieved 2015-09-21.
  12. ^ "Apache Subversion 1.6 Release Notes". Retrieved 2015-09-21.
  13. ^ "Apache Subversion 1.7 Release Notes". Retrieved 2015-09-21.
  14. ^ "Apache Subversion 1.8 Release Notes". Retrieved 2015-09-21.
  15. ^ "Apache Subversion 1.9 Release Notes". Retrieved 2015-09-21.
  16. ^ "Apache Subversion 1.10 Release Notes". Retrieved 2018-04-17.
  17. ^ "Apache Subversion 1.11 Release Notes". Retrieved 2018-10-31.
  18. ^ "Apache Subversion 1.12 Release Notes". Retrieved 2019-05-01.
  19. ^ "Apache Subversion 1.13 Release Notes".
  20. ^ "Apache Subversion 1.14 LTS Release Notes". subversion.apache.org. Retrieved 2020-06-02.
  21. ^ The Subversion Team. "Apache Subversion News Archives". subversion.apache.org. The Apache Software Foundation. Retrieved 2024-10-15.
  22. ^ Sperling, Stefan (2024-10-08). "Release Announcement – [SECURITY][ANNOUNCE] Apache Subversion 1.14.4 released". lists.apache.org. User mailing list for Subversion. The Apache Software Foundation. Retrieved 2024-10-15.
  23. ^ The Subversion Team (2024-10-08). "Changelog for Version 1.14.4 and earlier". Apache Subversion. The Apache Software Foundation. Retrieved 2024-10-15.
  24. ^ "Apache Subversion's CHANGES file". Retrieved 2018-10-31.
  25. ^ a b Ben Collins-Sussman; Brian W. Fitzpatrick; C. Michael Pilato (2011). "Chapter 5: Strategies for Repository Deployment". Version Control with Subversion: For Subversion 1.7. O'Reilly.
  26. ^ "Apache Subversion 1.8 Release Notes". Apache Project. Retrieved 5 May 2020.
  27. ^ "Apache Subversion 1.9 Release Notes".
  28. ^ Berkeley DB relies on file locking and thus should not be used on (network) filesystems which do not implement them
  29. ^ SVN 1.5 release notes
  30. ^ Basic Merging
  31. ^ "rcs(1)". OpenBSD manual pages.
  32. ^ Subversion Properties
  33. ^ pre-revprop-change
  34. ^ Inter-File Branching: A Practical Method for Representing Variants Archived 2007-07-14 at the Wayback Machine
  35. ^ Branching / Tagging — TortoiseSVN
  36. ^ "Implement true renames". Archived from the original on 2002-12-01. Retrieved 2007-05-11.
  37. ^ Advanced Merging
  38. ^ Copy/move-related improvements in Subversion 1.5
  39. ^ Working copy records moves as first-class operation in Subversion 1.8
  40. ^ "[SVN-516] svn obliterate". Retrieved 2023-09-04.
  41. ^ "Subclipse - Repair SVN Checksum".
  42. ^ Working Copy Metadata Storage Improvements (client)
  43. ^ "[SVN-1256] Ability to preserve last modification time (mtime) of files under version control". Retrieved 2023-09-04.
  44. ^ FreezeAttrib (saves/restores file attributes using properties)
  45. ^ fsvs – Full System Versioning System on GitHub
  46. ^ Programmer Insecurity @ iBanjo
  47. ^ Google Tech Talk video and its transcript
  48. ^ "[SVN-2464] Canonicalize / stringprep UTF-8 filenames to handle composed / decomposed differences shown by e.g. Mac OS X HFS+". Retrieved 2023-09-04.
  49. ^ For example: Weintraub, David (23 May 2005). "Subversion 'labels' vs. 'tags'". SVN Dev (Mailing list). Retrieved 5 May 2020.
  50. ^ "Apache Subversion Roadmap". Apache Project. Retrieved 5 May 2020.
  51. ^ "Subversion Submitted to Become a Project at The Apache Software Foundation". November 4, 2009. Retrieved October 1, 2019.
  52. ^ "CollabNet Supports Subversion's Graduation to Apache Top-Level Project". CollabNet. 1 March 2010. Archived from the original on 2010-03-11.
  53. ^ WANdisco (January 7, 2010). "WANdisco Names Hyrum Wright to Lead Subversion Open Source Efforts". News release. Open Source magazine. Archived from the original on 2012-01-18. Retrieved October 29, 2011.
  54. ^ "Apache Subversion Binary Packages". Official project website. Retrieved October 29, 2011.
  55. ^ WANdisco (October 28, 2009). "WANdisco Presents New Initiatives for the Subversion Open Source Project". News release. CM Crossroads. Archived from the original on 2011-11-18. Retrieved October 29, 2011.
  56. ^ "Apache Subversion Roadmap". Official project website. Retrieved October 29, 2011.

Sources

[edit]
  • C. Michael Pilato, Ben Collins-Sussman, Brian W. Fitzpatrick; Version Control with Subversion; O'Reilly; ISBN 0-596-00448-6 (1st edition, paperback, 2004, full book online, mirror)
  • Garrett Rooney; Practical Subversion; Apress; ISBN 1-59059-290-5 (1st edition, paperback, 2005)
  • Mike Mason; Pragmatic Version Control Using Subversion; Pragmatic Bookshelf; ISBN 0-9745140-6-3 (1st edition, paperback, 2005)
  • William Nagel; Subversion Version Control: Using the Subversion Version Control System in Development Projects; Prentice Hall; ISBN 0-13-185518-2 (1st edition, paperback, 2005)

Further reading

[edit]
[edit]