Subversion: Not Just for Code Anymore

Here is a subversive way to handle multiple versions of your personal information instead of just versions of code.

or by using svn cat to download a single file:

$ svn cat -r 1563 http://$MY_SERVER/docs/pics/beach.jpg

If you're going to use autoversioning to mount your repository under Linux, you need to install davfs. Once it is installed, mounting the repository is easy. All you need to do is run mount.davfs, like in the following example, which mounts the repository $MY_SERVER/docs at /mnt/documents:

$ mount.davfs http://$MY_SERVER/docs/ /mnt/documents

Before you can use autoversioning though, you also have to turn it on in Apache. To do that, you need to add the SVNAutoversioning on option to your <Location> directive for the Subversion repository.

Conclusion

Subversion is a system with a large feature list, many of which I haven't even touched on. You should know enough now to get started with versioning your files though. I've been using it for my files for a while now and find it to be very helpful. I find it especially useful when used with autoversioning, which makes it an almost seamless integration with the filesystem.

Resources for this article: /article/8751.

William Nagel is the Chief Software Engineer for a small technology company, and the author of Subversion Version Control: Using the Subversion Version Control System in Development Projects. He can be reached at bill@williamnagel.net.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Labels for certain important changes

Alvaro Arenas's picture

Hi

Good article. However, I was missing a little paragraph about labelling some important versions of a file. For example, I am trying to modify my grandmother’s cake receipt. I made some changes and I got a good receipt, but still I am not totally satisfied. I would like to save this version of the receipt with a label "good-enough" and continue trying. Can I do this? How do I do it?

Greetings

Alvaro.

Re: Labels for certain important changes

William Nagel's picture

Thanks, I'm glad you enjoyed the article.

Creating a "label" of a version of your file couldn't be easier. All you have to do is make a copy of the file and rename it to whatever you want. Subversion uses what it calls "cheap copies" when you make a copy of a file in the repository. Basically what that means is that it doesn't really make a copy of the file. Instead all it does is make a new entry under the new filename that points back to the revision of the original file from which it was created, which uses almost zero extra space on disk.

Assuming you are using WebDAV, you can do the copy by just copying the file as you would any other file and Subversion will "do the right thing" (don't create the copy by using Save As from the text editor though, as that will create a copy of the file's contents in the repository). On the other hand, if you're using a working copy of the repository you can do the copy from the command line using "svn copy" followed by "svn commit".

import syntax

padyer's picture

I think you need to use file:/// (3 /'s instead of 2) when not including a hostname.

Awesome article. I really want to try the webdav stuff.

phil

Re: import syntax

William Nagel's picture

I think you need to use file:/// (3 /'s instead of 2) when not including a hostname.

You are correct. However if you look back at the article you'll notice that I use $HOME, which includes the leading slash so that file://$HOME will expand to file:///home/bill (with the correct number of /'s).

Awesome article. I really want to try the webdav stuff.

Thank you very much! I'm glad you enjoyed it and I with you luck with getting WebDAV going.

Webcast
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers

Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.

Learn More

Sponsored by AMD

White Paper
Red Hat White Paper: Using an Open Source Framework to Catch the Bad Guy

Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6

Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.

Learn more about catching the bad guy in this free white paper.

Learn More

Sponsored by DLT Solutions