#!/bin/bash
#svn publish tool
#2017-9-5
svn=/usr/local/bin/svn
cd /var/www/html/svn_log/files/svn/
svn up --username web --password web101
cat /var/www/html/svn_log/files/svntest/file.log | svn log $2 |head -n 5 | sed -n "/publish" > svnlog
svnlog_change='sed -i"s@publish please@already published@" svnlog'
cat /var/www/html/svn_log/files/svntest/file.log | awk -F ',' '{print "/usr/local/bin/svn/propset --username web --password web101 -r" $1" --revprop svn:log "$svnlog_change" "$2"}' | /bin/bash
[ ! -d /var/www/html/svn_log/files/svntest ] || mv /var/www/html/svn_log/files/svntest /var/www/html/svn_log/files/svn/
/old-svntest/html -${commit}
mkdir /var/www/html/svn_log/files/svntest
chmod -R 777 /var/www/html/svn_log/files/svntest
chown -R www:www /var/www/html/svn_log/files/svntest
cd /var/www/html/svn_log/files/svn/
svn up --username web --password web101