Showing posts with label Subversion. Show all posts
Showing posts with label Subversion. Show all posts

Friday 1 April 2016

Upgrade Subversion on Mac OS X using Homebrew

Hi guys, in today's article we will see how to upgrade Subversion on Mac OS X using Homebrew. Subversion i.e SVN as you know is a popular centralised version controlling system.

First of all check in Terminal, the default pre-loaded version of Subversion that comes packaged with OS X.

svn --version
svn, version 1.7.20 (r1667490)

Now lets install Homebrew on the machine. For that just type the below command as mentioned on Homebrew's homepage. Btw for those who may be unaware, Homebrew is a free open source package management solution.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Now it will begin the installation process and will change/update the owner and permissions of the following folders.

==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
==> The following directories will have their owner set to ironcladzone:
/usr/local/.
/usr/local/bin
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin


Once Homebrew is installed, we need to install Subversion using it. First of all lets get some information about svn installation. Type this in terminal :

brew info subversion

subversion: stable 1.9.3 (bottled)
Version control system designed to be a better CVS
https://subversion.apache.org/
Not installed
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/subversion.rb
==> Dependencies
Build: pkg-config , scons
Required: sqlite , openssl
Optional: gpg-agent
==> Options
--universal
Build a universal binary
--with-gpg-agent
Build with support for GPG Agent
--with-java
Build Java bindings
--with-perl
Build Perl bindings
--with-python
Build with python support
--with-ruby
Build Ruby bindings
==> Caveats
svntools have been installed to:
  /usr/local/opt/subversion/libexec

You see there are some dependencies that Brew will install along with Svn. Dependencies like sqlite, openssl etc. Proceed with the installation now and be patient for a while till it finishes.

brew install subversion

==> Installing dependencies for subversion: readline, sqlite, openssl
==> Installing subversion dependency: readline
==> Downloading https://homebrew.bintray.com/bottles/readline-6.3.8.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring readline-6.3.8.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
.
.
.
==> Caveats
svntools have been installed to:
  /usr/local/opt/subversion/libexec

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/subversion/1.9.3: 148 files, 11.1M

Just check which svn versions are installed on your machine. I mean the locations of svn.

which -a svn
/usr/local/bin/svn
/usr/bin/svn

Now after the installation is complete, if you check svn --version you will still see the older version of svn. Hey but it should be 1.9.3 the latest version right?

svn --version
svn, version 1.7.20 (r1667490)

To fix this we need to add a line to ~/.bash_profile

sudo vi ~/.bash_profile

export PATH="/usr/local/bin:$PATH"

Now type : source ~/.bash_profile

Check the svn version now and it will show the latest one.

svn --version
svn, version 1.9.3 (r1718519)

Cheers! You just upgraded Subversion on Mac OS X. Hope it helps guys!

Saturday 22 March 2014

Find youngest revision number in Subversion

In Subversion, in order to find the youngest revision number, the command is :

svnlook youngest

It will show the latest (youngest) revision number. In better words, the latest version which contains the most recent changes.

Eg : 

svnlook youngest /Users/IronCladZone/SubRepo1
25

Monday 10 March 2014

Subversion Working Copy errors with Cornerstone

If you may be aware, all Mac machines come pre-loaded with Subversion. You can find out which version is pre-installed on your machine by typing the following in terminal :

svn --version

Well, my default version was 1.6.x. And recently I decided to upgrade it to the latest current version v1.8.8. I also created a repository and a corresponding working copy using Cornerstone client for Mac. However it supports the older version 1.4, 1.5, 1.6 & 1.7 clients. It does not support yet v.1.8.8 client.

So if you try to see the logs from the Terminal or perform any svn operation from the command line on your working copy, you will get an error like :

The working copy at "x-x-x-x-location" is too old (format 10) to work with client version '1.8.8 (r1568071)' (expects format 31). You need to upgrade the working copy first.

This message can be taken care of by simply typing svn upgrade in the command line.

However, if you return to working with Cornerstone, you simply won't be able to access the working copy. It pops up an annoying message, something like :

Description : "Working_Copy_Example" the working copy's format is not supported.
Suggestion : The working copy must be downgraded to a compatible version before it can be used.

Technical Information
=====================

  Error : V4UnsupportedWorkingCopyFormatError
  Exception : ZSVNUnsupportedWorkingCopyFormatException

Causal Information

==================

working copy.  Please upgrade your Subversion client to use this
working copy.

     Status : 155021

It leads me to believe that Cornerstone works fine with Apple- supplied Subversion v1.6. However, if you upgrade it to v1.7 or v1.8 this can result in annoying errors. It seems like Cornerstone automatically detects which Subversion to use while creating the repos and working copies. There's no way to customize it on this front - I mean you can't define the svn location if you upgraded it to v1.8.

Though the Cornerstone 2.7 upgrade provides support for subversion 1.7 as described in its release notes, it is not possible to downgrade 1.7 to 1.6 or lower, if needed. Plus it doesn't support the newer subversion version 1.8.x as yet. Sure it does plan to integrate Svn v1.8 in a future update. But I feel isn't this a bit annoying, having to wait for Cornerstone to update after subversion updates theirs.




Guys, do post your comments if you think any good workaround or a fix to this annoyance is available. For now, am contemplating a switch to Versions. Ping in your views about it's strengths and weaknesses folks. You have a good day. Take care.
Related Posts Plugin for WordPress, Blogger...
eXTReMe Tracker