Changes between Initial Version and Version 1 of TimingAndEstimationSVNPostCommitHook


Ignore:
Timestamp:
Jan 22, 2007, 5:12:09 PM (17 years ago)
Author:
Russ Tyndall
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TimingAndEstimationSVNPostCommitHook

    v1 v1  
     1= Using a Subversion commit hook To Interact With TimingAndEstimationPlugin  =
     2
     3'''Note: This information was taken from http://trac.edgewall.org/wiki/TimeTracking#UsingaSubversioncommithookoptional'''
     4
     5The {{{contrib/trac-post-commit-hook}}} script is a very convenient tool to interact with Trac's ticket system on commit. It allows to modify time tracking values and ticket state through special commit messages.
     6
     7 * Copy {{{trac-post-commit-hook}}} into /usr/share/trac/contrib.
     8 * Create a script {{{hooks/post-commit}}} in your Subversion repository with the content below (modify '''TRAC_ENV''' to point to your local Trac project).
     9 * Set the executable bit: {{{chmod 755 hooks/post-commit}}}.
     10
     11{{{
     12REPOS="$1"
     13REV="$2"
     14LOG=`svnlook log -r $REV $REPOS`
     15AUTHOR=`svnlook author -r $REV $REPOS`
     16TRAC_ENV='/var/trac/test'
     17
     18/usr/bin/python /usr/share/trac/contrib/trac-post-commit-hook \
     19  -p "$TRAC_ENV"  \
     20  -r "$REV"       \
     21  -u "$AUTHOR"    \
     22  -m "$LOG"
     23}}}
     24
     25You can now use special keywords in your commit message to modify Trac tickets. The available commands are:
     26
     27||refs #id||Adds a reference to the ticket's Changelog||
     28||re #id||Adds a reference to the ticket's Changelog||
     29||closes #id||Closes the ticket||
     30||fixes #id||Closes the ticket||
     31
     32The time spent is specified in parenthesis. :
     33  ex. re #853 (1) adds one hour to
     34
     35
     36
     37See {{{contrib/trac-post-commit-hook}}} for details (after applying the patch).
     38
     39'''Examples:'''
     40
     41{{{
     42svn commit -m 'Added time tracking, closes #1 (1), refs #2 (.5)'
     43}}}
     44
     45This closes ticket #1, increases the time spent by 1 hour. It adds an entry to the Changelog of ticket #2, increases the time spent by .5 hours.