post-revprop-change.tmpl 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/sh
  2. # POST-REVPROP-CHANGE HOOK
  3. #
  4. # The post-revprop-change hook is invoked after a revision property
  5. # has been added, modified or deleted. Subversion runs this hook by
  6. # invoking a program (script, executable, binary, etc.) named
  7. # 'post-revprop-change' (for which this file is a template), with the
  8. # following ordered arguments:
  9. #
  10. # [1] REPOS-PATH (the path to this repository)
  11. # [2] REV (the revision that was tweaked)
  12. # [3] USER (the username of the person tweaking the property)
  13. # [4] PROPNAME (the property that was changed)
  14. # [5] ACTION (the property was 'A'dded, 'M'odified, or 'D'eleted)
  15. #
  16. # [STDIN] PROPVAL ** the old property value is passed via STDIN.
  17. #
  18. # Because the propchange has already completed and cannot be undone,
  19. # the exit code of the hook program is ignored. The hook program
  20. # can use the 'svnlook' utility to help it examine the
  21. # new property value.
  22. #
  23. # On a Unix system, the normal procedure is to have 'post-revprop-change'
  24. # invoke other programs to do the real work, though it may do the
  25. # work itself too.
  26. #
  27. # Note that 'post-revprop-change' must be executable by the user(s) who will
  28. # invoke it (typically the user httpd runs as), and that user must
  29. # have filesystem-level permission to access the repository.
  30. #
  31. # On a Windows system, you should name the hook program
  32. # 'post-revprop-change.bat' or 'post-revprop-change.exe',
  33. # but the basic idea is the same.
  34. #
  35. # The hook program typically does not inherit the environment of
  36. # its parent process. For example, a common problem is for the
  37. # PATH environment variable to not be set to its usual value, so
  38. # that subprograms fail to launch unless invoked via absolute path.
  39. # If you're having unexpected problems with a hook program, the
  40. # culprit may be unusual (or missing) environment variables.
  41. #
  42. # Here is an example hook script, for a Unix /bin/sh interpreter.
  43. # For more examples and pre-written hooks, see those in
  44. # the Subversion repository at
  45. # http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
  46. # http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
  47. REPOS="$1"
  48. REV="$2"
  49. USER="$3"
  50. PROPNAME="$4"
  51. ACTION="$5"
  52. mailer.py propchange2 "$REPOS" "$REV" "$USER" "$PROPNAME" "$ACTION" /path/to/mailer.conf