post-commit.tmpl 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/sh
  2. # POST-COMMIT HOOK
  3. #
  4. # The post-commit hook is invoked after a commit. Subversion runs
  5. # this hook by invoking a program (script, executable, binary, etc.)
  6. # named 'post-commit' (for which this file is a template) with the
  7. # following ordered arguments:
  8. #
  9. # [1] REPOS-PATH (the path to this repository)
  10. # [2] REV (the number of the revision just committed)
  11. #
  12. # The default working directory for the invocation is undefined, so
  13. # the program should set one explicitly if it cares.
  14. #
  15. # Because the commit has already completed and cannot be undone,
  16. # the exit code of the hook program is ignored. The hook program
  17. # can use the 'svnlook' utility to help it examine the
  18. # newly-committed tree.
  19. #
  20. # On a Unix system, the normal procedure is to have 'post-commit'
  21. # invoke other programs to do the real work, though it may do the
  22. # work itself too.
  23. #
  24. # Note that 'post-commit' must be executable by the user(s) who will
  25. # invoke it (typically the user httpd runs as), and that user must
  26. # have filesystem-level permission to access the repository.
  27. #
  28. # On a Windows system, you should name the hook program
  29. # 'post-commit.bat' or 'post-commit.exe',
  30. # but the basic idea is the same.
  31. #
  32. # The hook program typically does not inherit the environment of
  33. # its parent process. For example, a common problem is for the
  34. # PATH environment variable to not be set to its usual value, so
  35. # that subprograms fail to launch unless invoked via absolute path.
  36. # If you're having unexpected problems with a hook program, the
  37. # culprit may be unusual (or missing) environment variables.
  38. #
  39. # Here is an example hook script, for a Unix /bin/sh interpreter.
  40. # For more examples and pre-written hooks, see those in
  41. # the Subversion repository at
  42. # http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
  43. # http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
  44. REPOS="$1"
  45. REV="$2"
  46. mailer.py commit "$REPOS" "$REV" /path/to/mailer.conf