All About Subversion
|
Here’s a really brief layman’s description of the Subversion version control system along with some links to resources about it. Since this most excellent tool is approaching its 1.0 release, you might want to check it out, if you’re into that kind of thing. I’m not as well-versed with Subversion as I’d like to be, so feel free to post a comment if I got anything wrong.
I’m really interested in the way people organize information and, in a more general sense, how technology can help people work more intelligently. Using technology to get more organized really pumps me up. I’m really fascinated by version control systems. I think SourceSafe reeks, but that’s not news; everyone who uses SourceSafe thinks it reeks. I used a commercial product Perforce for a while and I liked that, but it’s kind of expensive ($750/seat) and a lot of purists don’t like it because it, like SourceSafe, Locking version control systems force you to check out a file to edit it. Locking is good because it means that two people can’t muck with the same file at the same time, but it’s bad because two people can’t muck with the same file at the same time. And if I check out a file, go to lunch, and get hit by a bus, you are hosed, at least until you can track down a repository administrator to release my lock on the file. The most prevalent version control system in the open source world today is a free product called CVS. A lot of people think it reeks too, but they continue to use it because it reeks less than all the other stuff out there. (Like other ancient protocols which also reek yet continue to exist as part of the DNA of the Internet — SMTP comes to mind — CVS seems to have persisted for so long because it has persisted for so long). CVS doesn’t lock files by default. Instead, if you want to work on something, you just start working on it. If it should happen that I changed the file while you were working on it, either you or I can merge our changes to the file using software tools that are specifically tailored to that purpose. This enables projects to scale up to hundreds of developers without the need for a lot of centralized management — perfect for open-source projects. Subversion is a version control system that attempts to take the goodness from CVS (such as an easily automated command-line interface and a lack of locking) and get rid of some of its long-standing shortcomings — such as the lack of ‘atomic commits’. The ability to do atomic commits means that if you make changes to more than one file, you can specify that all of the files you’re working on must be checked in as a single ("atomic") unit. In a world in which changes to multiple files often have critical interdependencies, this is a nifty feature. But there are other important benefits to using Subversion as well, such as efficient handling of binary files and an easy way to browse repositories with a Web browser (thanks to the fact that Subversion is built on top of the Apache Web server). Subversion, like CVS, is also an open-source project. But unlike CVS, a lot of development resources are being devoted to it today. Subversion is currently close to a 1.0 release; its own team have been using it to store their own source code for many months now. They say that neither they nor anyone else have lost data with it. I wrote this mainly to kick off a new category devoted to Subversion; I have a couple of projects I’m working on that I’d like to use it for. So I’m going to try to devote some time to learning it well. The book Version Control with Subversion is the definitive book on Subversion. The pre-publication version is available free online today, but the book will supposedly find its way into print at some point (I think O’Reilly is going to publish it, and I understand that APress is working on their own Subversion book as well, which is great). TortoiseSVN is a nifty GUI front-end for Subversion that provides deep integration into the Windows shell. If you ever wanted to right-click on a file and add it to a version control repository, TortoiseSVN is what you want. This is the tool that I use to do 99% of my daily interaction with Subversion. There is a Visual Studio .NET add-in for Subversion called AnkhSVN. Subway is a project to create an SCC provider for Subversion. SCC providers let you get to a source control system from development environments that supports Microsoft’s SourceSafe integration API (this means Visual Studio and Visual Basic, but also others such as Macromedia Dreamweaver). This looks like it will be a great choice if you have existing SourceSafe users that want a relatively seamless upgrade path, but it also looks like this tool is a work in progress; the first (and only) release was put out in April 2003, and the last update to the Subway Web site was in June 2003. Subversion has its own client API for C/C++ that you can use to integrate Subversion repositories into your applications. Here is an article by Garrett Rooney on using the Subversion Client API. Here is part two of that article. The full Subversion API documentation is here. Updated 28. Dec 2003 to reorganize and provide more details for Subversion utilities for Windows, in particular the indispensible TortoiseSVN and the unfortunate not-ready-for-prime-time-ishness of Subway. |
Related posts:
- A Rank Amateur Upgrades His Subversion Repository As I mentioned previously, I’m using Subversion to store stuff I’m working...
- Subversion on Mac OS X Who’s successfully running a Subversion client on Mac OS X? I...
- Installing the MySQL ADO.NET Connector into the Global Assembly Cache This morning I sat through a MySQL webinar on Visual Studio tools...
This is a common misconception about SourceSafe.
Locking is optional in SourceSafe (on by default). When you check out a file, you can tick “Allow multiple checkouts”, and hordes of people can work on the same file! Better yet, if you dislike locking, you can let multiple checkouts be the default via the SS admin interface.
Yechhhh, does anybody actually use it that way? What’s the user experience for merge collisions?
There are still plenty of reasons for SourceSafe to suck even if it has a lockless mode, I gotta say.
It’s an equally common misconception about CVS.
CVS also supports locking but it is off by default. See ‘cvs admin -l’. Reserved checkouts can be implemented using it through a wrapper.
http://www.gnu.org/manual/cvs-1.9/html_mono/cvs.html#SEC92
Thanks for the info, but heck, riding underwater is a supported use case for a bicycle; doesn’t mean it’s a good idea. Does anybody really use cvs in locking mode?
besides ‘browsing’ your repository via apache, you can also make use of apache’s built in access control mechanisms! If you want to tunnel via ssh subversion supports that too. I’ve been using it for months and am very happy with it.
With regard to using the cvs locking; I think that more people use it or would like to use it than some would think. We have certain types of regularly changed and heavily modified files that are painful to merge and we would rather lock; e.g. html, jsp and some of our javascript files. It is not a lot of fun to be the person stuck merging them as I can attest from personal experience…
There is a new Subversion plugin for VisualStudio 2003 & 2005 - VisualSVN (http://www.visualsvn.com). Lightweight and reliable. Have a look at it :)
I’ve been involved in experiments with allowing multiple checkouts (i.e., non-locking mode) in Visual SourceSafe at several previous employers.
Biggest problem is that VSS is *supposed* to automatically merge the multiple checkouts at checkin time and present the “Visual Merge” interface for any conflicts it can’t resolve.
In reality this never seems to happen. What you get instead is “last one in wins”, i.e., last checkin overwrites all changes from the earlier ones. Every time we tried this we imediately went back to lock mode, because it just simply wasn’t working.
I definitely would *not* recommend using VSS in this way. Works much better in lock mode if you can live with and work within this limitation. If you want multiple simultaneous checkouts of the same file and sophisticated branching and merging capabilities, Perforce works much better. Sure it costs money, but so does VSS if you license it legitimately.
I’m looking into SVN right now as a replacement for CVS. Hopefully it will give us similar capabilities in an open-source product.
Excellent, thanks for the post and good luck!
Just to be honest: we use SourceSafe in multiple checkouts mode for a two years now in small (three to four person) but highly active projects. (VS2003 and VS2005 IDEs) Merging feature works fine with no issues to implementation. We use VSS for local projects only, for distributed projects we use Subversion, but not pleased with currently available SVN to IDE integration products.