rendered paste body#!/bin/shREPOS="$1"REV="$2"SSH="host"SSH_PATH="/var/www/localhost/htdocs"file_list=`svnlook changed -r $REV $REPOS | awk '{print $1 ":" $2}'`tmpdir="/tmp/svn2sftp.$RANDOM"while [ -e $tmpdir ]do tmpdir="/tmp/svn2sftp.$RANDOM"donesvn export -r $REV file://$REPOS $tmpdir >/dev/nullcd $tmpdirfor a in $file_listdo filename=`echo $a | awk -F ':' '{print $2}'` case `echo $a | awk -F ':' '{print $1}'` in ['U','UU','A']) listupload+="$filename ";; 'D') listremove+="$filename ";; esacdoneif [ "$listupload" ] then tar -cO --no-recursion $listupload | ssh $SSH "cd $SSH_PATH && tar -x"fiif [ "$listremove" ] then ssh $SSH "cd $SSH_PATH && rm -rf $listremove"firm -rf $tmpdir