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.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState