Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # svnexport.sh
- # Export only modified files in SVN
- # tests for parameters
- if [ ! $1 ];then echo "svnexport : No source specified.";exit;fi
- if [ ! $2 ];then echo "svnexport : No revision specified. ";exit;fi
- if [ ! $3 ];then echo "svnexport : No target directory specified. ";exit;fi
- echo "Processing : source($1), revision($2), target_directory($3)"
- for myfile in `svn diff -c $2 --summarize $1 | grep -e '^M ' -e '^A '`
- do
- if [ "$myfile" = "M" -o "$myfile" = "AM" -o "$myfile" = "A" -o "$myfile" = "." -o -d $myfile ]
- then
- continue
- else
- outfile=`echo $myfile | sed "s|$1||g"`
- file="$3$outfile"
- mkdir -p $(dirname $file)
- svn export --force $myfile $file -r $2 >> /dev/null
- echo "export $file "
- fi
- done
- echo "\nDone"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement