post-commit 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/bin/bash
  2. REPOS="$1"
  3. REV="$2"
  4. AUTHOR=`svnlook author $REPOS -r $REV`
  5. REPONAME=`basename $REPOS`
  6. ##URL="http://svn.wxwidgets.org/viewvc/$REPONAME?view=rev&rev=%s"
  7. URL="http://trac.wxwidgets.org/changeset/%s"
  8. TICKET_MAP='\[?#\s*(\d+)\]?=http://trac.wxwidgets.org/ticket/%s'
  9. EMAIL1="wx-commits-diffs@googlegroups.com"
  10. EMAIL2="wx-commits@googlegroups.com"
  11. EMAIL3="wxPython-commits@googlegroups.com"
  12. FROM="noreply@wxsite.net"
  13. REPLYTO1="wx-dev@googlegroups.com"
  14. REPLYTO2=$REPLYTO1
  15. REPLYTO3="wxPython-dev@googlegroups.com"
  16. WXPYTHON=`svnlook dirs-changed $REPOS -r $REV | grep -ce ^wxPython`
  17. if [ $WXPYTHON = 0 ]; then
  18. # Send notification with diffs
  19. /usr/bin/svnnotify --repos-path "$REPOS" \
  20. --revision $REV \
  21. --to $EMAIL1 \
  22. --from $FROM \
  23. --reply-to $REPLYTO1 \
  24. --subject-prefix "SVN:($AUTHOR)" \
  25. --revision-url $URL \
  26. --ticket-map $TICKET_MAP \
  27. --wrap-log \
  28. --with-diff \
  29. --diff-switches '--no-diff-added --no-diff-deleted' \
  30. --max-diff-length 10240 \
  31. --handler Alternative \
  32. --alternative HTML::ColorDiff \
  33. &
  34. # Send plain text notification without diffs to a different address
  35. /usr/bin/svnnotify --repos-path "$REPOS" \
  36. --revision $REV \
  37. --to $EMAIL2 \
  38. --from $FROM \
  39. --reply-to $REPLYTO2 \
  40. --subject-prefix "SVN:($AUTHOR)" \
  41. --revision-url $URL \
  42. &
  43. else
  44. # Send notification to the wxPython address
  45. /usr/bin/svnnotify --repos-path "$REPOS" \
  46. --revision $REV \
  47. --to $EMAIL3 \
  48. --from $FROM \
  49. --reply-to $REPLYTO3 \
  50. --subject-prefix "SVN:($AUTHOR)" \
  51. --revision-url $URL \
  52. --ticket-map $TICKET_MAP \
  53. --wrap-log \
  54. --with-diff \
  55. --handler HTML::ColorDiff \
  56. --diff-switches '--no-diff-added --no-diff-deleted' \
  57. --max-diff-length 10240 \
  58. &
  59. fi
  60. ## Send notification to cia.vc
  61. #$REPOS/hooks/ciabot_svn.py "$REPOS" $REV &
  62. # Check for keywords that Trac can use
  63. export PYTHONPATH=/home/wxsite/domains/trac.wxwidgets.org/htdocs/lib/python
  64. export PYTHON_EGG_CACHE=/tmp/.python-eggs
  65. /usr/bin/python2.5 $REPOS/hooks/trac-post-commit-hook \
  66. -p /home/wxsite/domains/trac.wxwidgets.org/htdocs/wxtrac -r $REV &