#/bin/sh
#checkout.sh
version=$1
localProjectname=project
#checkout 后文件存放的目录
local_path=/root/Desktop/svn/clients/client1/$localProjectname
svn_path=https://192.168.0.xxx/svn/project1/trunk
username=xxx
password=yyy
if [ -z $version ] ; then
echo " useage sh $0 version"
exit 0
fi
if [ -d $local_path ] ;then
echo "删除$local_path 目录中,清等待。。。"
rm -rf $local_path
fi
echo "checkout ......"
svn --username $username --password $password checkout $svn_path $local_path -r $version
if [ $? ] ;then
echo " checkout success"
else
echo "error"
exit
fi