subversion_logo_hor-468x64.pngThe mac is a pretty complete system for developing applications. Once I was surprised that tools like subversion and maven come pre-installed. There is a big advantage for the non-technical users that these tools are pre installed. Although I doubt that these people will use it a lot. Would you teach a person to use command line subversion? I guess not. You would teach them to use a tool like Versions. As a developer you can run into problems when you want to upgrade one of these libraries. Some time a go I have already written a post about upgrading maven on the mac. This is a short post about upgrading subversion.

Like I said, mac osx comes with a subversion client out of the box. At least Leopard does. If you do not believe me, try the following command and watch the output:

svn –version

svn, version 1.4.4 (r25188)
   compiled May 31 2008, 03:45:57
Copyright (C) 2000-2006 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).
The following repository access (RA) modules are available:
* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme

This is not the most recent version of subversion. That comes with performance as well as use ability problems. I am not going into details here. The biggest problem to me is that I use Versions and IntelliJ with subversion 1.5. Now my command line client does not work anymore. This is a problem for some of the maven projects. Therefore I want to upgrade the commandline subversion client. I was surprised that there are almost no resources on the web to do this without installing other libraries. But I found a pretty easy way. Execute the following steps:

  • Download the binaries from the website : http://subversion.tigris.org/getting.html#osx. I used the openCollabnet version. You do have to provided your details to download, just leave everything empty.
  • Use the downloaded installer to install all the subversion binaries.
  • Make sure that the new binaries are on the path before the original subversion libraries. Issue the following command in a terminal.
    export PATH=/usr/local/bin:$PATH

Those are the most important steps. If you do this in a terminal and execute the svn –version again you get the following output

svn, version 1.5.4 (r33841)
   compiled Oct 27 2008, 11:19:10
Copyright (C) 2000-2008 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).
The following repository access (RA) modules are available:
* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - with Cyrus SASL authentication
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - handles 'http' scheme
  - handles 'https' scheme

That worked, the version is now 1.5.4. If you do not want to execute this command every time you need it, you can add it to you .profile. If you need more info on how to do just that, you can find a good explenation here.

Hope this post helps you use the new and improved subversion.

Tagged on:             

26 thoughts on “Upgrade subversion client on mac osx

  • June 13, 2012 at 1:43 pm
    Permalink

    Using macports to update subversion client is a good idea. Its a one step process. Installing macports is a prerequisite, but it will help installing many other packages like tomcat, mysql etc.

    Reply
  • June 19, 2010 at 7:39 pm
    Permalink

    I hate the way OS X comes with these things and when you want to update then you have 2 versions. Python is the same way. OS X needs some kind of apt-get or something. I know there’s Fink, but you’re still out of luck with the stuff that comes preinstalled, right? Pretty lame.

    Reply
  • October 16, 2009 at 9:55 pm
    Permalink

    Solved it… obvious I suppose but you also need to update the path of dav_svn_module in ServerAdmin to point to the new module that comes with subversion install default at /opt/subversion/lib/svn-apache/mod_dav_svn.so

    Assuming you are using OS X Leopard Server.

    Great though. Thanks.

    Reply
  • October 16, 2009 at 9:07 pm
    Permalink

    I’m having same issue as Yves De Billoez…

    I removed the old svn* files from /usr/bin … setup the symlinks and was still getting 1.4.4. showing on Repository …

    I thought I’d delete and recreate the Repository using 1.6.5 … now when I try to browse via Safari, I get cannot connect o svn repository show in browser and this in console….

    [Fri Oct 16 20:37:55 2009] [error] A subtree cannot specify a different DAV provider than its parent.
    [Fri Oct 16 20:37:55 2009] [error] [client ::1] (20014)Internal error: Expected FS format ’2′; found format ’4′
    [Fri Oct 16 20:37:55 2009] [error] [client ::1] Could not fetch resource information. [500, #0]
    [Fri Oct 16 20:37:55 2009] [error] [client ::1] Could not open the requested SVN filesystem [500, #160043]
    [Fri Oct 16 20:37:55 2009] [error] [client ::1] Could not open the requested SVN filesystem [500, #160043]

    Reply
  • October 11, 2009 at 7:01 pm
    Permalink

    Thanks for your tip, Jettro

    Reply
  • October 5, 2009 at 11:28 am
    Permalink

    Problem with the upgrade is that Apache 2 is still compiled with Subversion 1.4.4.

    Apache version on Leopard:
    Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.7l DAV/2 PHP/5.2.10 SVN/1.4.4

    Is there any way to upgrade Apache dav svn to the SVN 1.5 or 1.6 after doing previous stepsN

    Reply
  • June 1, 2009 at 4:12 pm
    Permalink

    This worked – for a hot minute, rebooted and the changes went away. /usr/local/bin is in my .profile, and when I echo $PATH it is before /usr/local.

    I tried to get the version of the binary directly. This is the result:

    homestar:bin ltackett$ pwd
    /usr/local/bin
    homestar:bin ltackett$ ls
    change-svn-wc-format.py
    irb
    rdoc
    svn
    svnlook
    svnversion
    erb
    rails
    ri
    svnadmin
    svnserve
    testrb
    gem
    rake
    ruby
    svndumpfilter
    svnsync
    homestar:bin ltackett$ ./svn –version
    -bash: ./svn: No such file or directory
    homestar:bin ltackett$ cd svn
    -bash: cd: svn: No such file or directory

    Am I doing it wrong? Any help here would rock, I am having trouble connecting to one of my work repositories because of this (the whole reason I upgraded).

    Reply
    • June 1, 2009 at 6:36 pm
      Permalink

      In my home directory I have a file called .bash_profile. This file contains a few lines for java, maven and one for subversion. I have the following line that might be the thing you are looking for:

      export PATH=/opt/subversion/bin:$PATH

      Hope that helps

      Reply
  • May 7, 2009 at 8:34 pm
    Permalink

    Thanks. I had to do one more thing to get it working in OS X (10.5.6). I had to create a symbolic link to point to /opt/subversion/bin/svn in /usr/local/bin. I don’t know why, but svn –version was still showing 1.4.4, even after updating.

    $: sudo cp /usr/local/bin/svn /usr/local/bin/svn_copy
    $: sudo ln -s /opt/subversion/bin/svn /usr/local/bin/svn

    and then it worked.

    Reply
    • May 7, 2009 at 9:00 pm
      Permalink

      That is an option, I did not do it, because I want to switch often. So I just change my path if I use svn command line.

      Reply
  • April 23, 2009 at 3:18 am
    Permalink

    Thanks. Like what you said, I just needed to add the new svn version to the path before everything else.

    Reply
  • April 16, 2009 at 11:54 pm
    Permalink

    Thanks for the tip. It worked perfectly.
    @hamy: yes, unfortunate that the collabnet installer misses this.

    Reply
  • March 28, 2009 at 6:29 am
    Permalink

    thanks for the tip. It is unfortunate the installer that comes from open collabnet doesn’t do this automatically

    Reply
  • March 19, 2009 at 4:03 pm
    Permalink

    Thank you sir, this was very helpful.

    Reply
  • March 16, 2009 at 3:39 pm
    Permalink

    Thanks a lot. I just noticed the 1.4.4 version because usually I use Eclipse with the Subversive plugin.

    Now that one comes in really handy!

    Reply
  • March 1, 2009 at 6:24 pm
    Permalink

    Awesome! Thanks. Been wanting to upgrade SVN but messed it up once before going the manual route :) The link to the installer is greatly appreciated.

    Reply
  • January 24, 2009 at 7:54 pm
    Permalink

    For some reason when I installed 1.5.5 it didn’t replace the svn executable in /user/local/bin. I had to move file that in order for the installer to make a symlink to 1.5.5. Not sure if I’m doing something wrong…

    Reply
    • January 25, 2009 at 9:44 am
      Permalink

      This could well be, I did not try this myself yet. I only upgraded once, did try to upgrade a second time.

      Reply
  • January 3, 2009 at 1:35 am
    Permalink

    on my machine, there are now two installations. 1.4.4 in /usr/bin and 1.5.4 in /usr/local/bin. is it safe to remove the earlier version?

    Reply
    • January 3, 2009 at 9:35 am
      Permalink

      It should be possible yes, BUT, I would not do it. Like magomarcelo comments, there are some issues with maven. It could be there are other issues as well. It is also not the binaries coming from apple. Maybe in time, apple comes with their own upgrade. I’d recommend to leave it there, it is not in your way.

      greetz Jettro

      Reply
  • December 22, 2008 at 1:42 pm
    Permalink

    For those of you that have are using bash:

    - Please edit your .bash_profile (instead of .profile as mentioned in the post).
    - Add the following line: export PATH=/usr/local/bin:$PATH
    - Launch a new terminal window and you’re done

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>