subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Bading <tbad...@web.de>
Subject Re: Subversion 1.8 appreciation thread
Date Thu, 06 Jun 2013 11:48:35 GMT
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


Mime
View raw message