get_patch.bat
@echo off
svn log %1 | sed -e "/^r/!d" | sed -n "/%2/p" | sed "s/^[ \t]\?\([^ \t]\+\).*$/\1/" | sed "s/^.//" > temp_patch
echo EOF >> temp_patch
md wyf_patch
for /f %%i in (temp_patch)do (
if "%%i" equ "EOF" (
echo EOF
goto :END
) else (
echo %%i
svn diff -c %%i %1 > %cd%/wyf_patch/%%i.patch
)
)
:END
del temp_patch
echo Bingo!!!
statistic.sh
#!/bin/bash
sum=0
for TEMPFILE in `ls *.patch`
do
add_lines_count=`grep "^+" $TEMPFILE|grep -v "^+++"|sed 's/^.//'|sed '/^$/d'|wc -l`
sum=$(($add_lines_count+$sum))
done
echo $sum