Subversion Hack: Automatic Versioning on Save With Subversion

By Angsuman Chakraborty, Gaea News Network
Tuesday, August 14, 2007

I discovered a really cool way to use Subversion, my favorite version control system - automatic versioning / commit on save. Essentially with this simple tweak you can use subversioned files like you would use any ordinary files. You can open them in any editor, create or delete them. When you save a file it is actually saved and versioned in a remote subversion repository. Similarly the other file operations are transparently supported from a remote subversion installation. This greatly simplifies the life of new users and pros alike. You do not have to repeatedly remind your users to commit changes to repositories and no changes will ever be lost. Experienced users can still view history and do more complex operations.

Autoversioning is a feature whereby generic WebDAV clients can write to a DeltaV server (like mod_dav_svn), and the server performs commits silently in the background. This means that if you use Apache httpd as your Subversion server, then most modern operating systems can mount the repository as a network share, and non-technical users get “transparent” versioning for free. (Of course, technical users can still use Subversion clients to examine repository history.)

The first step is to configure Subversion to run over Apache web server which is well documented and very easy to implement.
This makes your repository accessible over WebDAV (& DeltaAV).
Most operating systems (tested on both Windows & Linux) provide a way to mount WebDAV as drives or directories. So you need to mount the repository and then configure your OS to mount it on restart.
Now you can access the files in the repository normally as you would any other files on your operating system. Transparently the files will be saved in the repository and versioned on every save.

This feature was made available from Subversion version 1.2. This is the coolest subversion trick in my book so far. What’s yours?

will not be displayed