Subsections

E. Repository side stuff

Here we provide an account on some actions that can be made on the server side.


E..1 Setting up a repository

There is a file /path/to/svn/README on the repository server. This file contains a short description, with links to project web sites where appropriate, about the projects hosted. Please keep this file updated when projects are added or removed.

Initialise a repository (here base)

svnadmin create /path/to/svn/repository/base

Comment: The addition of files and directory structure to the project is done from the client side as usually after the project is checked out, or a directory layout can be forced onto the project (see below).

E..1.1 Repository access

Using a web server with svn support you set up repository access using your web servers authentication methods. On apache webdav migth be used where two files passwd and access located in /path/to/svn/ (file name and directory set in subversion/apache configuration) are used to set up authentication.

Using svnserve the repository access is set up by changing to the repository configuration directory

cd /path/to/svn/repository/base/conf

Create a passwd file (you could copy a template from another existing project). Add users into this file, these will all have read/write privileges. svnserve.conf must be setup (again, copy a template), where also (optional) anonymous access is set up.

E..2 Administrator enforced repository layout

Follow these steps to enforce the recommended repository layout in new repositories:
    mkdir tmpdir
    cd tmpdir
    mkdir project
    mkdir project/trunk
    mkdir project/branches
    mkdir project/tags
    svn import . file:///path/to/repos \
        --message 'Initial repository layout'
Adding project
Adding project/trunk
Adding project/branches
Adding project/tags
Committed revision 1.
    cd ..
    rm -rf tmpdir


E..3 Adding a post-commit hook to a repository

As an example of how to add an post-commit hook simply place the trac-post-commit-hook script somewhere in the file hierarchy (e.g. /path/to/svn/contrib). Create a shell script post-commit in the /path/to/svn/reposotpry/hooks directory that contains the below block of code (there should be a template script to copy in the hooks directory)
REPOS="$1"
REV="$2"

LOG=`/usr/bin/svnlook log -r $REV $REPOS`
AUTHOR=`/usr/bin/svnlook author -r $REV $REPOS`
TRAC_ENV='/path/to/tracs/trash/'
TRAC_URL='http://lev.thep.lu.se/trac/trash/'
/usr/bin/python /home/max/svn/contrib/trac-post-commit-hook \
    -p "$TRAC_ENV"  \
    -r "$REV"       \
    -u "$AUTHOR"    \
    -m "$LOG"       \
    -s "$TRAC_URL"
Make sure the post-commit script is executable.