/hooks/post-unlock.tmpl

http://labaratorijske2011.googlecode.com/ · Shell · 42 lines · 3 code · 3 blank · 36 comment · 0 complexity · 01d73400b799201a950e44a5dae124a7 MD5 · raw file

  1. #!/bin/sh
  2. # POST-UNLOCK HOOK
  3. #
  4. # The post-unlock hook runs after a path is unlocked. Subversion runs
  5. # this hook by invoking a program (script, executable, binary, etc.)
  6. # named 'post-unlock' (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] USER (the user who destroyed the lock)
  11. #
  12. # The paths that were just unlocked are passed to the hook via STDIN
  13. # (as of Subversion 1.2, only one path is passed per invocation, but
  14. # the plan is to pass all unlocked paths at once, so the hook program
  15. # should be written accordingly).
  16. #
  17. # The default working directory for the invocation is undefined, so
  18. # the program should set one explicitly if it cares.
  19. #
  20. # Because the lock has already been destroyed and cannot be undone,
  21. # the exit code of the hook program is ignored.
  22. #
  23. # On a Unix system, the normal procedure is to have 'post-unlock'
  24. # invoke other programs to do the real work, though it may do the
  25. # work itself too.
  26. #
  27. # Note that 'post-unlock' 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-unlock.bat' or 'post-unlock.exe',
  33. # but the basic idea is the same.
  34. #
  35. # Here is an example hook script, for a Unix /bin/sh interpreter:
  36. REPOS="$1"
  37. USER="$2"
  38. # Send email to interested parties, let them know a lock was removed:
  39. mailer.py unlock "$REPOS" "$USER" /path/to/mailer.conf