178 | | == Trac 0.11 & SVN on Mac OS X Leopard (10.5) == |
179 | | |
180 | | * [trac:TracOnLeopardServer TracOnLeopardServer] |
| 178 | == Automatic reference to the SVN changesets in Trac tickets == |
| 179 | |
| 180 | You can configure SVN to automatically add a reference to the changeset into the ticket comments, whenever files are committed to the repository. The description of the commit needs to contain one of the following formulas: |
| 181 | * '''Refs #123''' - to reference this changeset in #123 ticket |
| 182 | * '''Fixes #123''' - to reference this changeset and close #123 ticket with the default status ''fixed'' |
| 183 | |
| 184 | All you have to do is to edit the ''post-commit'' hook in your SVN repository and make it execute ''trac-post-commit-hook'' coming with Trac. |
| 185 | |
| 186 | If you are editing the ''post-commit'' hook for the first time you need to navigate to your SVN repository's hooks subfolder and rename existing there ''post-commit'' template: |
| 187 | |
| 188 | {{{ |
| 189 | $ cd /path/to/svn/repository/hooks |
| 190 | $ mv post-commit.tmpl post-commit |
| 191 | $ chmod 755 post-commit |
| 192 | }}} |
| 193 | |
| 194 | Next open it in any text editor and add a line with path to the Trac environment connected with this SVN repository and another line executing the ''trac-post-commit-hook'' script: |
| 195 | |
| 196 | {{{ |
| 197 | REPOS="$1" |
| 198 | REV="$2" |
| 199 | TRAC_ENV="/path/to/your/trac/project" |
| 200 | |
| 201 | /usr/bin/python /usr/local/bin/trac-post-commit-hook -p "$TRAC_ENV" -r "$REV" |
| 202 | }}} |
| 203 | |
| 204 | Make sure that ''trac-post-commit-hook'' exists in above path with execution permissions for the same user which SVN is running from. This script can be found in contrib subfolder of your Trac distribution and the latest version can be always downloaded from [source:trunk/contrib/trac-post-commit-hook]. |
| 205 | |
| 206 | |
| 207 | == Platform-specifics installations == |
| 208 | |
| 209 | * See [trac:TracInstallPlatforms TracInstallPlatforms] |
| 210 | |