功用

  • Refs #123
    在做 svn commit 只要在 --message 訊息裏加入 refs #no 就可以在 #no ticket 新增一筆 comment。
  • Fixes #123
    在做 svn commit 只要在 --message 訊息裏加入 fixed #no 就可以自動關閉 #no ticket。比如 svn commit -m "fixed #4 add file to fix bug 4"

方法

  • vi /var/trac/proj1/trac.ini
    修改 trac.ini,[components] 新增一個指令,並修改 [repositories] 的 sync_per_request 為 false。[components] tracopt.ticket.commit_updater.* = enabled [repositories] .sync_per_request = false
  • cp /var/svn/proj1/hooks/post-commit.tmpl /var/svn/proj1/hooks/post-commit
  • vi /var/svn/proj1/hooks/post-commit
    修改 post-commit,在檔案尾加入下列文字。 export PYTHON_EGG_CACHE="/tmp/.python-eggs" trac-admin /var/trac/proj1 changeset added "$REPOS" "$REV"
  • cp /var/svn/proj1/hooks/post-revprop-change.tmpl /var/svn/proj1/hooks/post-revprop-change
  • vi /var/svn/proj1/hooks/post-revprop-change
    修改 post-revprop-change,在檔案尾加入下列文字。 export PYTHON_EGG_CACHE="/tmp/.python-eggs" trac-admin /var/trac/proj1 changeset modified "$REPOS" "$REV"

問題排除

Warning: post-commit hook failed (exit code 2) with output: /var/svn/proj1/hooks/post-commit: 52: /var/svn/proj1/hooks/post-commit: /var/svn/proj1/hooks/mailer.py: not found Error: ExtractionError: Can't extract file(s) to egg cache The following error occurred while trying to extract file(s) to the Python egg cache: [Errno 13] Permission denied: '/var/www/.python-eggs' The Python egg cache directory is currently set to: /var/www/.python-eggs Perhaps your account does not have write access to this directory? You can change the cache directory by setting the PYTHON_EGG_CACHE environment variable to point to an accessible directory.

只要把 /var/www 權限打開即可,chmod 777 /var/www or chown www-data:www-data /var/www

參考資料

創作者介紹

邱小新の工作筆記

台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()