subversion-hell.sh (28 sep 10)
#!/bin/sh # DISCLAIMER - this script backs up a Subversion-controlled folder, checks out the latest revision, # then writes the code it just backed up over the checkout. It does not check the code in. If the # user DOES then check the code in, he or she has resolved any conflicts between his or her # code and that of other developers by simply overwriting the latter with the former. This may # not be what is intended. Use with this caution. The software is not guaranteed for any purpose.
if [ "" == "$1" ] ; then echo "Usage: subversion-hell.sh A_PROJECT" echo "A_PROJECT should be a Subversion folder you are having problems with," echo "and you should be in the folder above A_PROJECT" fi
DIR=`pwd` PWD=$DIR DIR=`echo $DIR | sed s/^.*\\\/trunk/trunk/`
mkdir ~/tmp/ 2>/dev/null rm -Rf ~/tmp/$1 2>/dev/null mv ~/$DIR/$1 ~/tmp/ find ~/tmp/$1/ -iname '.svn*' -exec rm -Rf {} \; 2>/dev/null cd $PWD echo svn co YOUR_URL_HERE/$DIR/$1 $1 svn co YOUR_URL_HERE/$DIR/$1 $1 cp -Rf ~/tmp/$1/* $PWD/$1/
# YOUR_URL_HERE can be found by looking in file .svn/entries, near the top
Back
Portland |
|
London |
|