Daily Archives: October 1, 2009

You *can* check out a particular revision of the Sakai trunk..

So, perhaps you want a historical version of Sakai, say because you like revision 66860 because of its “fine nutmeg-like quality”. You think – this is easy and type

svn co -r 66860 https://source.sakaiproject.org/svn/sakai/trunk/ sakai-66860

And think all is well.

But all is *not* well – all you did was get the main pom and the version of the .externals from 66860. As svn reads that externals file it sees a bunch of entries of the form:

access https://source.sakaiproject.org/svn/access/trunk

This tells svn to go and check-out trunk at the :HEAD revision. You think, “this is not what we wanted!” – svn does not propagate the -r parameter down to the implied checkouts in the externals file.

You might think – svn will have an option called – “Propogate that -r value down into externals – particularly those which come from the same path”. Of course there is no such parameter.

But here is a sweet little procedure for accomplishing that task. First check out only the sakai module and do not follow externals:

svn co -r 66860 --ignore-externals https://source.sakaiproject.org/svn/sakai/trunk/ sakai-66860

Next go into the directory and run this command to make a script to to the rest of the work:

awk '{print "svn co -r 66860 " $2 " " $1}' < .externals > chk1.sh

Yes – that would assume UNIX – for the awk-impaired, this produces a script file with a bunch of lines that look like this:

svn co -r 66860 https://source.sakaiproject.org/svn/access/trunk access
svn co -r 66860 https://source.sakaiproject.org/svn/alias/trunk alias

Windows folks can do similar in a text editor or some other non-awk mechanism.

The last step is simply to execute the chk1.sh shell script and sit back and enjoy. You now have been able to go back in time in trunk and see what what life would have been life when the revision was 66860!

(Thanks to Seth for the ignore-externals suggestion!)