Recent Posts
- The Economics of Pet Ownership (Infographic)
- NEW SSDD GLASSES
- Together Forever And Ever
- HIGH PLAINS / FLATLANDS
- Attractive Pink Snake
Archives
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- December 2007
- October 2007
- September 2007
- January 2007
- December 2006
- November 2006
- February 2006
- July 2005
- June 2005
- May 2005
TP Widget
TP Badge
This Crazy Web
Searching the web for the craziest content - so you don’t have to!
I installed Trac on dreamhost.com using CreamyTrac with an svnsynced Subversion repository from our local one, and the post-commit hook to do ‘close #3′ wasn’t working and the correct commit messages and users weren’t showing up until I did a trac-admin resync.
Most of the info I found on the web didn’t help, but I eventually solved it myself by using hook post-revprop-change instead of post-commit with the code shown below. This code only activates when svnsync is completely finished and has unlocked the destination repository, then it syncs the latest revision with Trac and then runs the Trac post-commit hook to close tickets, etc. Svnsync only seems to update commit messages and users after committing code, so Trac has the wrong information in post-commit, so you have to use post-revprop-change instead.
REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"
# Export bash variables required by trac.fcgi
export HOME="/home/me"
# Root directory for the Trac project
export TRAC_PROJECT_DIR="/home/me/trac_projects"
export TRAC_ENV="/home/me/trac_projects/myproj"
. ${HOME}/.bash_profile
if [ "$ACTION" = "D" -a "$PROPNAME" = "svn:sync-lock" ]; then
YOUNGEST_REV=`svnlook youngest /home/me/svn/myproj`
trac-admin $TRAC_ENV resync $YOUNGEST_REV
${RUN}/bin/python ${RUN}/share/trac/contrib/trac-post-commit-hook \
-p "$TRAC_ENV" \
-r "$YOUNGEST_REV"
fi
No Comments »
No comments yet.
RSS feed for comments on this post. TrackBack URL
