Changes between Version 8 and Version 9 of TracRepositoryAdmin
- Timestamp:
- Aug 3, 2010, 2:10:41 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracRepositoryAdmin
v8 v9 102 102 103 103 The following examples are complete post-commit and post-revprop-change scripts for Subversion. They should be edited for the specific environment, marked executable (where applicable) and placed in the `hooks` directory of each repository. On Unix (`post-commit`): 104 {{{ 105 #!sh 104 {{{#!sh 106 105 #!/bin/sh 107 106 export PYTHON_EGG_CACHE="/path/to/dir" … … 109 108 }}} 110 109 On Windows (`post-commit.cmd`): 111 {{{ 112 #!application/x-dos-batch 110 {{{#!application/x-dos-batch 113 111 @C:\Python26\Scripts\trac-admin.exe C:\path\to\env changeset added "%1" "%2" 114 112 }}} 115 113 116 114 The post-revprop-change hook for Subversion is very similar. On Unix (`post-revprop-change`): 117 {{{ 118 #!sh 115 {{{#!sh 119 116 #!/bin/sh 120 117 export PYTHON_EGG_CACHE="/path/to/dir" … … 122 119 }}} 123 120 On Windows (`post-revprop-change.cmd`): 124 {{{ 125 #!application/x-dos-batch 121 {{{#!application/x-dos-batch 126 122 @C:\Python26\Scripts\trac-admin.exe C:\path\to\env changeset modified "%1" "%2" 127 123 }}} 124 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`. 128 126 129 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.