4

We have an svn server here with multiple paths.

What I'm looking for, and I might not have looked hard enough, is a post-commit script that, whenever something is checked into a specific path, does an ssh to another server and runs a bash script.

Any ideas on a quick and easy way to do this or a post-commit script already out there?

Paŭlo Ebermann
  • 73,284
  • 20
  • 146
  • 210

1 Answers1

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

svnlook changed $REPOS -r $REV | grep "YourFilePattern" 1>/dev/null

if [ "$?" == "0" ] ; then
    ssh user@example.com foo.bash

fi
Lance Rushing
  • 7,540
  • 4
  • 29
  • 34
  • This looks like it would work, but I'm being thrown an error about a missing arguement or -r. I'll double checking my file now –  Oct 01 '09 at 18:51
  • Ok, I think got it all except for that I'm always trying to check against HEAD and its looking for a number, do I have to convert head to a number prior to running this or is there a way to specify HEAD –  Oct 01 '09 at 19:50