svnresurrect() { found=0 empty="" listofrevs=`svn log | grep -o --regexp="^r[0-9]*" | sed "s/r//g"` for i in $listofrevs; do echo $i thisrev=`svn log -v -r $i | grep "^ *D [/A-Za-z0-9]*$1$"` if [ "$thisrev" != "$empty" ] then found=$i break fi done if [ "$found" -eq "0" ] then echo "couldn't find deletion of" $1 else echo "found deletion of" $1 "in revision" $found svnurl=`svn info | grep "URL:" | sed "s/URL: //g"` svn copy -r $found $svnurl $1 fi }