#!/bin/bash if [ $# -ne 3 ] ; then echo "usage : transdiffer " exit 1; fi let oldrev=$1+0 let newrev=$2+0 outfile=$3 mailfile="$3-email.txt" olddir=`pwd` svnurl="http://svn.cocoondev.org/viewsvn/" svnbase="http://svn.cocoondev.org/repos/daisy/trunk/daisy/" trunkbase="trunk/daisy/" urlbase=${svnurl}${trunkbase} url="" echo -e "Diffs\n\n" > $outfile echo -e "Diffs - email\n" > $mailfile while read line ; do # Find if a first revision is specified let first_rev=`echo "${line}" | cut -s -d \ -f 2`+0 line=`echo "${line}" | cut -d \ -f 1` # Before rev 2328 the cocoon/forms was cforms if [ $oldrev -lt 2328 ] ; then oldline=`echo ${line} | sed -e "s/cocoon\/forms/cforms/"` else oldline=$line fi if [ -n "$first_rev" ] && [ $oldrev -lt $first_rev ] ; then if [ "${line}" == "${oldline}" ]; then diff=`svn di --notice-ancestry -N --old ${oldline}@${first_rev} --new ${line}@${newrev}` url="${urlbase}${line}?rev=${newrev}&view=markup" # echo "line = oldline : $line = $oldline" # echo "svn di --notice-ancestry -N --old ${oldline}@${first_rev} --new ${line}@${newrev}" else tmpbase1=`echo $oldline | sed -e "s/cforms\/.*/cforms\//"` tmpbase2=`echo $line | sed -e "s/cocoon\/forms\/.*/cocoon\/forms\//"` tmptail=`echo $oldline | sed -e "s/.*cforms\///"` diff=`svn di -r ${first_rev}:${newrev} --notice-ancestry -N --old ${svnbase}${tmpbase1} --new ${tmpbase2} ${tmptail}` oldurl=${trunkbase}${oldline} url="${urlbase}${line}?p1=${oldurl//\//%2F}&rev=2328&r1=${first_rev}&r2=${newrev}" # echo "line != oldline : $line != $oldline" # echo "svn di -r ${oldrev}:${newrev} --notice-ancestry -N --old ${svnbase}${tmpbase1} --new ${tmpbase2} ${tmptail}" fi else if [ "${line}" == "${oldline}" ]; then diff=`svn di --notice-ancestry -N --old ${oldline}@${oldrev} --new ${line}@${newrev}` url="${urlbase}${line}?r1=text&tr1=${oldrev}&r2=text&tr2=${newrev}&diff_format=h" # echo "line = oldline : $line = $oldline" # echo "svn di --notice-ancestry -N --old ${oldline}@${oldrev} --new ${line}@${newrev}" else tmpbase1=`echo $oldline | sed -e "s/cforms\/.*/cforms\//"` tmpbase2=`echo $line | sed -e "s/cocoon\/forms\/.*/cocoon\/forms\//"` tmptail=`echo $oldline | sed -e "s/.*cforms\///"` diff=`svn di -r ${oldrev}:${newrev} --notice-ancestry -N --old ${svnbase}${tmpbase1} --new ${tmpbase2} ${tmptail}` oldurl=${trunkbase}${oldline} url="${urlbase}${line}?p1=${oldurl//\//%2F}&rev=2328&r1=${oldrev}&r2=${newrev}" # echo "line != oldline : $line != $oldline" # echo "svn di -r ${oldrev}:${newrev} --notice-ancestry -N --old ${svnbase}${tmpbase1} --new ${tmpbase2} ${tmptail}" fi fi if [ -n "$diff" ]; then echo $url >> $mailfile echo $line echo -e "\n\n##############\n" >> $outfile echo -e "$line" >> $outfile echo -e "$diff" >> $outfile fi done cd $olddir