Question

I'm running OS X Mavericks. Pretty sure I got svn from the Command Line Tools from the Apple Developer site.

I've searched around for where hook script are supposed to be located. All the articles I've found (e.g. this one: https://stackoverflow.com/a/7577251/726378) say that there is a hooks directory in the repository directory. I have found no such directory.

Where is this directory?

Is this directory on the svn server or the client?

Was it helpful?

Solution

In Subversion, hooks are run on the server side, and are located inside the repository directory on the server.

Try this:

$ cd $HOME
$ svnadmin create foo_repo  # Creating Subversion repository called "foo_repo"
$ cd foo_repo
$ hooks
post-commit.tmpl         post-revprop-change.tmpl pre-commit.tmpl          
pre-revprop-change.tmpl  start-commit.tmpl        post-lock.tmpl           
post-unlock.tmpl         pre-lock.tmpl            pre-unlock.tmpl

There they are!

You can try using this repo if you'd like:

$ cd $HOME/foo_repo/conf
$ vi svnserve.conf          # Remove the "#" from "password-db = passwd" (Line 27)
$ vi passwd                 # You want to define a password for your user
$ cd $HOME
$ svnserve -r foo_repo -d   # Starts up the Subversion server
$ mkdir $HOME/workdir
$ cd $HOME/workdir
$ svn co svn://localhost localhost
$ cd localhost             # Your Subversion working directory!

Now, you can play around with your various hook and see how it affects using your repository.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top