svn merge命令合包脚本(按版本号)
rem 功能 :自动把分支最新的版本merge到主干 rem 入参 :1服务名;2分支名;3注释内容 @echo off rem =========进入待merge的本地workspace========= cd D:workspace235%1 echo Goto local path...... rem =========更新本地workspace========= svn update echo Update local workspace... rem =========获取分支的更新履历,并写入本地文件========= svn log -q --stop-on-copy https://kxbdatdbpc:8443/svn/WJ-SVN/03_Resource/%1/branches/%2 > D:svn_merge\%1.log echo Get the branch's history...... type D:svn_merge\%1.log rem =========定义变量:存储分支版本号========= set brancheNO= rem =========判断文件是否存在========= if not exist D:svn_merge\%1.log ( echo D:svn_merge\%1.log is not exist goto end ) rem =========读取履历文件,忽略-开头的行后只读第一行,默认以空格分隔,默认取第一列========= for /f "skip=1 eol=-" %%i in ('type D:svn_merge\%1.log') do ( set brancheNO=%%i echo Merged veision%%i goto line ) rem =========模拟merge确定有没有冲突========= :line svn merge https://kxbdatdbpc:8443/svn/WJ-SVN/03_Resource/%1/branches/%2 -c %brancheNO% D:workspace235%1 --dry-run rem =========如果有冲突文件按N退出,若没有按Y继续========= set /p Askme=continue(Y) or exit(N)? if /i "%Askme%"=="y" goto next if /i "%Askme%"=="n" goto end rem =========执行merge========= :next rem =========格式化当前时间========= set CURRENT_DATE_TIME=%date:~0,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%:%time:~3,2%:%time:~6,2% echo svn merge https://kxbdatdbpc:8443/svn/WJ-SVN/03_Resource/%1/branches/%2 -c %brancheNO% D:workspace235%1 svn merge https://kxbdatdbpc:8443/svn/WJ-SVN/03_Resource/%1/branches/%2 -c %brancheNO% D:workspace235%1 rem =========写入merge日志文件========= echo %CURRENT_DATE_TIME%====/%1/branches/%2 -c %brancheNO% D:workspace235%1 >> D:svn_mergeSVN_Merge.log rem =========提交文件========= svn commit -m %3 echo %3 echo %CURRENT_DATE_TIME%====%3 >> D:svn_mergeSVN_Merge.log rem =========处理结束并返回脚本所在目录========= :end cd D:svn_merge
©️公众号:思考者文刀
- 上一篇: fork: 无法分配内存解决方法
- 下一篇: ibdata1文件过大的处理方法
评论
游客
回复最近回了很多帖子,都没人理我!http://46408.juyuangroup.com
游客
回复知识就是力量啊!http://s9j.yonghengtang.cn
游客
回复有钱、有房、有车,人人都想!http://mobile.jsailitejz.com