[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Subversion 1.8 appreciation thread

From: Tobias Bading <tbading_at_web.de>
Date: Thu, 06 Jun 2013 13:48:35 +0200

Goody #2: (People probably came up with something like this for
Subversion 1.7 already... anyway...)

Our company currently uses Subversion 1.6 and at first I thought
'duel-Subversioning' 1.6 and 1.8 would lead nowhere except headaches. As
it turns out, the fact that a Subversion 1.8 client cannot directly work
with a Subversion 1.6 working copy is no problem at all, at least not on
GNU/Linux in a shell or GNU Emacs.

First, make sure you have both Subversion versions installed and that
you have links on your $PATH named svn-1.6 and svn-1.8 that link to the
respective binaries. Then create a shell script called svn with this
content: (work in progress)

--- snip ---

#!/bin/bash

# check whether the command uses Subversion 1.8 features:
usesNewFeature=0
for arg in "$@"; do
   if [[ "$arg" = "--search" || "$arg" = "--diff" || "$arg" = "--new" ||
"$arg" = "--old" ]]; then
     usesNewFeature=1;
     break;
   fi
done
if [[ "$1" = "upgrade" || ( "$1" = "help" && "$2" = "upgrade" ) ]]; then
   usesNewFeature=1;
fi

# decide which Subversion version to use:
if [[ $usesNewFeature = 0 && -f .svn/entries && "`head -1 .svn/entries`"
!= "12" ]]; then
   cmd=svn-1.6
else
   cmd=svn-1.8
fi

# debug logging:
# echo `date` "[PWD=$PWD]" -- $cmd "$@" >>~/.svn.log

exec $cmd "$@"

--- snip ---

There you go. A svn command that is able to deal with 1.6 and 1.8
working copies.

Those are the two goodies I came up with so far. Who's next?

Kind regards,
Tobias
Received on 2013-06-06 13:49:15 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.