Changes between Version 17 and Version 18 of TracRepositoryAdmin
- Timestamp:
- Jun 21, 2011, 12:07:34 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracRepositoryAdmin
v17 v18 123 123 }}} 124 124 125 Git hooks can be used in the same way for explicit syncing of git repositories. Try in `.git/hooks/post-commit` 125 The Unix variants above assume that the user running the Subversion commit has write access to the Trac environment, which is the case in the standard configuration where both the repository and Trac are served by the web server. If you access the repository through another means, for example `svn+ssh://`, you may have to run `trac-admin` with different privileges, for example by using `sudo`. 126 127 Note that calling `trac-admin` in your Subversion hooks can slow down the commit and log editing operations on the client side. You might want to use the [trac:source:trunk/contrib/trac-svn-hook contrib/trac-svn-hook] script which starts `trac-admin` in an asynchronous way. The script also comes with a number of safety checks and usage advices which should make it easier to set up and test your hooks. There's no equivalent `trac-svn-hook.bat` for Windows yet, but the script can be run by Cygwin's bash. 128 129 See the [http://svnbook.red-bean.com/en/1.5/svn.reposadmin.create.html#svn.reposadmin.create.hooks section about hooks] in the Subversion book for more information. Other repository types will require different hook setups. 130 131 Git hooks can be used in the same way for explicit syncing of git repositories. Add the following to `.git/hooks/post-commit`: 126 132 {{{ 127 133 REV=$(git rev-parse HEAD) … … 129 135 }}} 130 136 131 For Mercurial, add the following entries to the `.hgrc` file of each repository accessed by Trac ( replacing `<my-repository>` with the name of the repository in Trac):132 {{{ 137 For Mercurial, add the following entries to the `.hgrc` file of each repository accessed by Trac (if [trac:TracMercurial] is installed in a Trac plugins directory, download [source:plugins/0.13/mercurial-plugin/tracext/hg/hooks.py hooks.py] and place it somewhere accessible): 138 {{{#!ini 133 139 [hooks] 134 commit = trac-admin /path/to/env changeset added <my-repository> $HG_NODE 135 changegroup = hg log -r $HG_NODE: --template "{node} " | xargs trac-admin /path/to/env changeset added <my-repository> 140 ; If mercurial-plugin is installed globally 141 commit = python:tracext.hg.hooks:add_changesets 142 changegroup = python:tracext.hg.hooks:add_changesets 143 144 ; If mercurial-plugin is installed in a Trac plugins directory 145 commit = python:/path/to/hooks.py:add_changesets 146 changegroup = python:/path/to/hooks.py:add_changesets 147 148 [trac] 149 env = /path/to/env 150 trac-admin = /path/to/trac-admin 136 151 }}} 137 138 The Unix variants above assume that the user running the Subversion commit has write access to the Trac environment, which is the case in the standard configuration where both the repository and Trac are served by the web server. If you access the repository through another means, for example `svn+ssh://`, you may have to run `trac-admin` with different privileges, for example by using `sudo`.139 140 Note that calling `trac-admin` in your Subversion hooks can slow down the commit and log editing operations on the client side. You might want to use the [trac:source:trunk/contrib/trac-svn-hook contrib/trac-svn-hook] script which starts `trac-admin` in an asynchronous way. The script also comes with a number of safety checks and usage advices which should make it easier to set up and test your hooks. There's no equivalent `trac-svn-hook.bat` for Windows yet, but the script can be run by Cygwin's bash.141 142 See the [http://svnbook.red-bean.com/en/1.5/svn.reposadmin.create.html#svn.reposadmin.create.hooks section about hooks] in the Subversion book for more information. Other repository types will require different hook setups. Please see the plugin documentation for specific instructions.143 152 144 153 === Per-request synchronization === #PerRequestSync