Downgrading Subversion to older 1.6 release with Macports for compatibility

Subversion source code version control tool had recently version 1.7 release. The new version has different repository layout in local copies (files are different on your hd). Downsides of SVN version 1.7 include

  • You need to manually upgrade every repository on your hard disk
  • Third party tools don’t yet like the new Subversion. For example, I had hard time try to make Aptana Studio (Eclipse) + Subclipse to pick up new libsvn version. The latest Subclipse did not come with pure Java compatible libraries and native libraries just didn’t activate. Thus, one couldn’t use Aptana Studio’s integrated SVN Team features

Macports project provides open source tools for OSX. If you install Macports or run Macports self update it will pull the latest Subversion command line command and then the havoc breaks loose. For me this happened when I tried to use jarn.mkrelease, a tool to simplify the releasing of Python packages on PyPi, on non-upgradable repository: svn 1.7 command wanted to upgrade the repository, but this would have broken my workspace in Aptana.

1. Fetching and activating the older SVN version

First you can check what versions of SVN you have installed already

$ port installed subversion
The following ports are currently installed:
  subversion @1.6.17_1
  subversion @1.7.1_0 (active)

You can browse the available Macports packages and their versions here. Use Revision log link to see the older release. Then it is simple matter installing or activating the old versions

2. Activate old version

If you have older version installed you can fall back to it

sudo port activate subversion @1.6.17_1

3. Installing old version

This is more complex task because Macports do not have packages of older software releases. You need to

  • Browse the source packages in Trac
  • See the Revision log for Portfile of the package
  • Pick the SVN revision where the change was released
  • Map the Trac path to Macports SVN path in your head (no, there is no link…)
  • Manually checkout this SVN revision
  • Run package build from this checkout

Example

cd /tmp
svn co http://svn.macports.org/repository/macports/trunk/dports/devel/subversion --revision 76647 # gets 1.6.16
sudo port instal

The first attempt will fail because of the changes in the dependencies and you need to manually specify what serf variant to use

--->  Computing dependencies for subversion
--->  Dependencies to be installed: serf
--->  Configuring serf
Error: Please use serf0 or serf1 instead.
Error: Target org.macports.configure returned: obsolete port
Error: Failed to install serf
Log for serf is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_www_serf/serf/main.log
Error: The following dependencies were not installed: serf
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

We need to manually edit checked out Portfile to reflect this change and change the depedency line to this:

depends_lib        port:expat port:neon \
            port:apr port:apr-util \
            port:db46 port:sqlite3 \
            port:gettext port:libiconv \
            port:serf0 port:cyrus-sasl2

Then it is sudo port install again and now we can see the old version is activated:

port installed subversion
The following ports are currently installed:
  subversion @1.6.16_0 (active)
  subversion @1.6.17_1
  subversion @1.7.1_0

4. More info

 

\"\" Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+

12 thoughts on “Downgrading Subversion to older 1.6 release with Macports for compatibility

  1. Thanks for that. Just installed upgraded my couchdb install and found that MacPorts thought i should upgrade from svn 1.6 to 1.7 (again?!?). Wish they would at least ask me first.

  2. Thank you, you saved my day (after mountain lion upgrade)

  3. Thank you, it helped a lot.
    Note that there is no need to manually edit the dependencies if you get revision 80777, which is for subversion 1.6.17.

    $ cd /tmp
    $ svn co http://svn.macports.org/repository/macports/trunk/dports/devel/subversion –revision 80777 # gets 1.6.17
    $ cd subversion
    $ sudo port install

    $ port installed subversion
    The following ports are currently installed:
    subversion @1.6.17_1 (active)
    subversion @1.7.7_0

  4. Thanks a lot, very helpful!

    Btw, the error message concerning serf came out differently, but the manual edit did the trick anyway.

  5. Pingback: How to downgrade Subversion client from 1.8 to 1.7 in MacPorts - Blogs - Permeance Technologies

  6. Pingback: ¿Cómo instalar una versión anterior de Subversion en OS X con MacPorts? - Protips y más

  7. If you are running 10.9 with XCode installed, here is a much easier way to get subversion 1.6.

    Edit your PATH in .bash_profile to place the following path first:

    /Applications/Xcode.app/Contents/Developer/usr/subversion-1.6/bin

    Either that or you can replace the stock subversion with a symlink to version 1.6:

    sudo mv /usr/bin/svn /usr/bin/svn17
    sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/subversion-1.6/bin/svn /usr/bin/svn

    Now when you run svn you get 1.6. No MacPorts dependencies involved.

  8. Pingback: How to downgrade Subversion client from 1.8 to 1.7 on Mac OS X using MacPorts - Home - Permeance

Leave a Reply

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