245 | | If you want to enable post-commit hook functionality on your repository, add the following to your repository's `.hg/hgrc` file: |
246 | | {{{ |
247 | | [hooks] |
248 | | commit = trac-admin /path/to/env changeset added repo_name $HG_NODE |
249 | | incoming = trac-admin /path/to/env changeset added repo_name $HG_NODE |
250 | | }}} |
251 | | |
252 | | On Windows change $HG_NODE to %HG_NODE%. |
253 | | |
254 | | Remember to change `/path/to/env` and `repo_name` on ''both'' lines to reflect your environment. |
| 245 | If you want to enable post-commit hook functionality on your repository, add the following to your repository's `.hg/hgrc` file (since [10728]): |
| 246 | {{{#!ini |
| 247 | [hooks] |
| 248 | ; If mercurial-plugin is installed globally |
| 249 | commit = python:tracext.hg.hooks:add_changesets |
| 250 | changegroup = python:tracext.hg.hooks:add_changesets |
| 251 | |
| 252 | ; If mercurial-plugin is installed in a Trac plugins directory |
| 253 | commit = python:/path/to/hooks.py:add_changesets |
| 254 | changegroup = python:/path/to/hooks.py:add_changesets |
| 255 | |
| 256 | [trac] |
| 257 | env = /path/to/env |
| 258 | trac-admin = /path/to/trac-admin |
| 259 | }}} |
| 260 | |
| 261 | Remember to change `/path/to/env` and `/path/to/trac-admin` to reflect your environment. If TracMercurial is installed in a Trac `plugins` directory, you will also have to download [source:plugins/0.13/mercurial-plugin/tracext/hg/hooks.py hooks.py] and place it somewhere accessible. |