All pastes #1866704 Raw Edit

svn ressurection

public shellscript v1 · immutable
#1866704 ·published 2010-04-18 19:54 UTC
rendered paste body
svnresurrect() {found=0empty=""listofrevs=`svn log | grep -o --regexp="^r[0-9]*" | sed "s/r//g"`for i in $listofrevs;doecho $i        thisrev=`svn log -v -r $i | grep "^ *D [/A-Za-z0-9]*$1$"`if [ "$thisrev" != "$empty" ]then         found=$i        breakfidoneif [ "$found" -eq "0" ]then        echo "couldn't find deletion of" $1else        echo "found deletion of" $1 "in revision" $found        svnurl=`svn info | grep "URL:" | sed "s/URL: //g"`        svn copy -r $found $svnurl $1fi}