0

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?

Community
  • 1
  • 1
rstackhouse
  • 2,238
  • 24
  • 28
  • If you didn't find a `hooks` subdirectory, you didn't look for it in the repository. You probably had a look somewhere else (working copy, program files, configuration directories or maybe a visual repository browser). You specify the location of the repository directory every time you create one—how do you create repositories? – Álvaro González May 08 '14 at 14:39

1 Answers1

2

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.

David W.
  • 105,218
  • 39
  • 216
  • 337