Archive for May, 2009

Upgrading the Subversion command line client on Mac OSX Leopard

Wednesday, May 20th, 2009

OSX Leopard ships with Subversion 1.4.x by default. Since then, SVN has had 2 major upgrades (merge tracking anyone?). To make things easy, there is a binary availableĀ atĀ Collab.net. But unfortunately you need to do some work yourself.

The path of the built in Subversion command line client is different to the one that the Collab.net Community binary is installed to. The following steps will fix this.

Disclaimer – Be careful: when you use the Terminal you are flying without a safety net! No undo & no restore from trash. Do this at your own risk and don’t forget to have an up-to-date backup!!!

  1. install the binary downloaded to Collab.net
  2. open your Terminal and check which version of SVN you are using by typing svn --version. This should say 1.4.x
  3. check which installed instance of SVN the OS is using by typing which svn. This will return the path to the SVN version you are using, which probably is /usr/local/bin/svn
  4. check whether the Collab.net version is installed by going to it: cd /opt/subversion/bin. Doing an ls should show you the subversion files
  5. Backup the current svn location: by going to it (cd /usr/local/bin) and copying it to your desktop or wherever you fancy (mv svn* ~/Desktop/)
  6. now you need to create symlinks to the Collab.net binaries:
    • ln -s /opt/subversion/bin/svn svn
    • ln -s /opt/subversion/bin/svnadmin svnadmin
    • ln -s /opt/subversion/bin/svndumpfilter svndumpfilter
    • ln -s /opt/subversion/bin/svnlook svnlook
    • ln -s /opt/subversion/bin/svnserve svnserve
    • ln -s /opt/subversion/bin/svnsync svnsync
    • ln -s /opt/subversion/bin/svnversion svnversion
  7. That should be it

The beauty is that you only need to do this once. The next time you upgrade your Subversion client, the symlinks will just point to the updated files and everything should be fine. As I said earlier though: only do this if you feel comfortable on the command line.

UPDATE: I have been told that some people seem to have SVN installed in /usr/bin/. Just use the path that is returned by the which svn command. You might also need to use sudo to run some of the command (i.e. move).