Edgewall Software

Changes between Version 8 and Version 9 of TracRepositoryAdmin


Ignore:
Timestamp:
Aug 3, 2010, 2:10:41 AM (10 years ago)
Author:
Remy Blank
Comment:

Added a note about using sudo.

Legend:

Unmodified
Added
Removed
Modified
  • TracRepositoryAdmin

    v8 v9  
    102102
    103103The 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
    106105#!/bin/sh
    107106export PYTHON_EGG_CACHE="/path/to/dir"
     
    109108}}}
    110109On Windows (`post-commit.cmd`):
    111 {{{
    112 #!application/x-dos-batch
     110{{{#!application/x-dos-batch
    113111@C:\Python26\Scripts\trac-admin.exe C:\path\to\env changeset added "%1" "%2"
    114112}}}
    115113
    116114The post-revprop-change hook for Subversion is very similar. On Unix (`post-revprop-change`):
    117 {{{
    118 #!sh
     115{{{#!sh
    119116#!/bin/sh
    120117export PYTHON_EGG_CACHE="/path/to/dir"
     
    122119}}}
    123120On Windows (`post-revprop-change.cmd`):
    124 {{{
    125 #!application/x-dos-batch
     121{{{#!application/x-dos-batch
    126122@C:\Python26\Scripts\trac-admin.exe C:\path\to\env changeset modified "%1" "%2"
    127123}}}
     124
     125The 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`.
    128126
    129127Note 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.