Installing Subversion on Mac OSX

SubversionYesterday it was the third time in two years that I needed to install Subversion from scratch on Mac OSX. The third time to reinvent the wheel and learn from earlier mistakes. So now I wrote down some notes, which I like to share…

First, the installation

Currently the most up to date binary builds with installer come from Martin Ott. Download the package (currently 1.4.3) and install. No sweat, no pain. Then I want to make sure the svnserve daemon is running whenever I boot my mac. Time to get into the dirty handwork. Edit a property list like the one below (replace repository path name as needed), from the command line:

$ sudo vi /Library/LaunchDaemons/org.tigris.subversion.svnserve.plist

This is the plist file:

<?xml version=“1.0“ encoding=“UTF-8“ ?>
<!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN“ ““>
<plist version=“1.0“>
        <string>SVN Version Control System</string>

Finally, add the configuration the the Launch process and restart the service:

$ sudo launchctl load /Library/LaunchDaemons/org.tigris.subversion.svnserve.plist
$ sudo launchctl start org.tigris.subversion.svnserve

Most important, the repository layout.

Subversion stores all projects and revisions in one set of database files, no possibility to go into the repository and do all kind of manual tweaks like with CVS. That should, in itself, be considered A Good Thing. But it doesn’t give me the possibility to backup a single repository separately, which I hate. So, my repository scheme now looks like this:

  • ~/Library/svn/project1
  • ~/Library/svn/project2
  • And so on…

Nice, but that means that I have to edit the same boring config file over and over again. Which I limited to the bare minimum, by moving the files with authentication credentials outside the repository and keep the basic config file the same for every repository. Just copy the standard svnserve.cnf file to a new repository and I’m up and running! The svnserve.cnf file:

### Visit for more information.

### These options control access to the repository for unauthenticated
### and authenticated users.  Valid values are “write“, “read“,
### and “none“.
anon-access = none
auth-access = read
auth-access = write
### The password-db option controls the location of the password
### database file.  Unless you specify a path starting with a /,
### the file's location is relative to the conf directory.
password-db = /Users/you/Library/svn/passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control.  Unless you specify a path
### starting with a /, the file's location is relative to the conf
### directory.  If you don't specify an authz-db, no path-based access
### control is done.
authz-db = /Users/you/Library/svn/authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
#realm = My Realm

Oh yeah, and now put the appropriate authz and passwd files in the location you just specified (in this example simply the svn repository root).

Loose ends

All of this was based on two excellent resources:

The latter has also an item about making scheduled backups of your repository, which you should configure right away (yes, it is on my todo list)! If you’re using Eclipse as your IDE of choice, you should (must?) take a look at the Subclipse plugin. A timesaver!