svn post-commit hook first timer

208 Views Asked by At

I found my repo files and have started editing my post-commit.tmpl. Here is what is in there now:

REPOS="$1"
REV="$2"

#"$REPOS"/hooks/mailer.py commit "$REPOS" $REV "$REPOS"/mailer.conf

cd /var/www/domains/mywebsite.com
svnlook dirs-changed $REPOS -r $REV | xargs /user/bin/svn up -N

I'm trying to get all my web files to post-commit to my website, but only the web files. I thought this would be easier, but it looks like I'm in over my head a bit.. How can I send files like .php, .html, etc to my web folders on commit? Or am I going about it all wrong?

1

There are 1 best solutions below

0
On

It's been a few years since I've had to deal with svn hooks... What you need to do with svnlook is:

$FILE_LIST = `svnlook changed -r $REV $REPOS |
grep '^(A|U|D).*(\.php|\.html)$' |
sed 's/\s\s*/ /g' |
cut -d' ' -f2`

This will give you an array of files that you can svn checkout into your web directory.