1、首先创建一个svn 分支库 svnserver create branches (contos7.2 用svnadmin create branches)
2、在svn中的conf 下的authz 设置相应权限 passwd设置相应的用户名和密码
3、在你要存入的目录下,使用 svn co svn://127.0.0.1/branches 到当前的branches目录(不用创建此目录)
4、创建branches.sh文件 写入内容 此文件要求输入一个参数 (if [ $# != 1 ]; then)
一、切分支脚本
#!/bin/sh
if [ $# != 1 ]; then
echo "错误: 请输入版本名"
exit
fi
DATE=$(date +%x--%X)
DIR_NAME=$1
ServerDir=./$DIR_NAME/server
ClientDir=./$DIR_NAME/client/
ResDir=./$DIR_NAME/res/
ResDataDir=./$DIR_NAME/res/data/
ResFileListDir=./$DIR_NAME/res/filelist/
DocDir=./$DIR_NAME/data_table/
ReleaseDir=./$DIR_NAME/release
svn up
svn export svn://127.0.0.1/8sword_server/trunk/server $ServerDir
svn export svn://127.0.0.1/8swords_client/trunk $ClientDir
svn export svn://127.0.0.1/res/data $ResDataDir
svn export svn://127.0.0.1/res/filelist $ResFileListDir
cp ../res/crossdomain.xml $ResDir
svn export svn://127.0.0.1/配置表/导入用 $DocDir
svn export svn://127.0.0.1/release/client/trunk $ReleaseDir/client
svn export svn://127.0.0.1/8sword_server/trunk/server/data/map $ReleaseDir/server/data/map
svn export svn://127.0.0.1/8sword_server/trunk/server/log $ReleaseDir/server/log
svn export svn://127.0.0.1/8sword_server/trunk/server/config $ReleaseDir/server/config
svn export svn://127.0.0.1/8sword_server/trunk/server/database $ReleaseDir/server/database
mkdir $ReleaseDir/server/script/
cp ./$ServerDir/script/policy.bat $ReleaseDir/server/script/
cp ./$ServerDir/script/start.bat $ReleaseDir/server/script/
svn add $DIR_NAME
svn ci -m "切版本到:$DIR_NAM" $DIR_NAME
DATE1=$(date +%x--%X)
二、S0 (切完后) 更新内容脚本
#!/bin/sh
DATE=$(date +%x--%X)
ServerDir=./server
ClientDir=./client/
ResDir=./res/
ResDataDir=./res/data/
ResFileListDir=./res/filelist/
DocDir=./data_table/
ReleaseDir=./release
svn up
svn --force export svn://127.0.0.1/8sword_server/trunk/server/proto $ServerDir/proto
svn --force export svn://127.0.0.1/8sword_server/trunk/server/src $ServerDir/src
svn --force export svn://127.0.0.1/8sword_server/trunk/server/include $ServerDir/include
svn --force export svn://127.0.0.1/8sword_server/trunk/server/database $ServerDir/database
svn --force export svn://127.0.0.1/8sword_server/trunk/server/data $ServerDir/data
svn --force export svn://127.0.0.1/8sword_server/trunk/server/log $ReleaseDir/server/log
svn --force export svn://127.0.0.1/8sword_server/trunk/server/config/enum.config $ServerDir/server/config/enum.config
svn --force export svn://127.0.0.1/8sword_server/trunk/server/config/db.config $ServerDir/server/config/db.config
svn --force export svn://127.0.0.1/8sword_server/trunk/server/config/slice_table.config $ServerDir/server/config/slice_table.config
svn --force export svn://127.0.0.1/8swords_client/trunk $ClientDir
svn --force export svn://127.0.0.1/res/data $ResDataDir
svn --force export svn://127.0.0.1/res/filelist $ResFileListDir
cp ../../res/crossdomain.xml $ResDir
svn --force export svn://127.0.0.1/配置表/导入用 $DocDir
svn --force export svn://127.0.0.1/release/client/trunk $ReleaseDir/client
svn commit -m '切版本到s0' ./