Posts Tagged ‘trac’

Installing Post-Commit-Hook for Subversion and Trac 0.11

If you have a Subversion running including a Trac connection, it’s nice to have the post-commit-hook running, too.

With this hook, you can include additional keywords (closes, fixes) in commit-comments which then allow to close, fix etc. tickets.

I installed it in the following way.

My Subversion directory is in this case /svn and my Trac directory is /trac.

mkdir -p /usr/share/trac/contrib
cd /usr/share/trac/contrib
wget http://trac-hacks.org/export/7848/timingandestimationplugin/branches/trac0.11/scripts/trac-post-commit.py

Now the SVN settings

cd /svn/hooks
vim post-commit

Add this content to the post-commit file (via http://trac-hacks.org/wiki/TimingAndEstimationSVNPostCommitHook):

#!/bin/sh
REPOS="$1"
REV="$2"
LOG=`svnlook log -r $REV $REPOS`
AUTHOR=`svnlook author -r $REV $REPOS`
TRAC_ENV='/trac'

/usr/bin/python /usr/share/trac/contrib/trac-post-commit.py \
-p "$TRAC_ENV"  \
-r "$REV"       \
-u "$AUTHOR"    \
-m "$LOG"

Change some privileges and owner-ships:

chown www-data:www-data post-commit
chmod 755 post-commit

ImportError: No module named trac.web.modpython_frontend

I just updated my Debian Etch installation to Lenny. I am using Trac on this system and got the following error, when I tried to access it:

ImportError: No module named trac.web.modpython_frontend

I struggled around a lot and the easy solution was to update the Trac system via

easy_install --upgrade Trac

error: Unexpected HTML page found at http://trac-hacks.org/svn/accountmanagerplugin/0.10

I got the following error:

error: Unexpected HTML page found at http://trac-hacks.org/svn/accountmanagerplugin/0.10

To fix it, you need to update setuptools via

sudo easy_install -U setuptools