I wanted to set up an SVN that writes to a mounted DMG file. So that I could easily copy the files to a USB key and not have to worry about someone easily reading them (using GPGTools).
I found a great tutorial on setting up an SVN server on OSX. Went off with only one hitch. That being I had to make sure that the svnroot folders had full access for the SVN account.
Creating the DMG file was easy enough as well (Diskutility). I created an encrypted DMG file and stuck it in the SVN account I set up.
As for auto mounting, there is a handy tool called Lingon. Using that and the following command line meant that the my DMG mounted.
echo PASSWORD | hdiutil attach /Users/svnacc/svnStuff.dmg
Although svnserve can launch before the mount, it doesn’t check until you try to access the repository and you are logged in at that stage.