Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I am trying to get a post-commit hook working on my Apache Subversion server, specifically I'm trying to send email to my Google account as described on this link.

After setting the permissions for the script and the working copy to the same user and read/write access it started causing MERGE errors when users tried to commit.

After some reading I found out that it was because of the post-commit hook not working and found out that by typing

svn - ./post-commit commit  ../ 250 mailer.conf

I get this error:

> annerajb@annerajb-desktop:~/Desktop/TotEM_SVN/hooks$ env - ./post-commit.test commit ../ 250

/var/lib/python-support/python2.6/svn/ DeprecationWarning: The popen2 module is deprecated.  Use the subprocess module.

  import sys as _sys, os as _os, popen2 as _popen2, tempfile as _tempfile

Traceback (most recent call last):

  File "/usr/share/subversion/hook-scripts/mailer/", line 1351, in <module>
    svn.core.run_app(main, cmd, config_fname, repos_dir, sys.argv[3:3+expected_args])

  File "/var/lib/python-support/python2.6/svn/", line 288, in run_app
    return apply(func, (application_pool,) + args, kw)

  File "/usr/share/subversion/hook-scripts/mailer/", line 80, in main
    revision = int(cmd_args[0])

ValueError: invalid literal for int() with base 10: ''

./post-commit.test: 5: ../: Permission denied

I am not sure why cmd_args[0] is empty if I am passing it a value.

/usr/share/subversion/hook-scripts/mailer/ commit "$REPOS" \
        "$REV" /usr/share/subversion/hook-scripts/mailer/mailer.conf
share|improve this question
Can you fix the formatting of your output to use fixed width fonts and include the contents of your post-commit file? – David Pashley Jun 8 '09 at 21:59
I dont know how to set the width of the fonts fonts. i will appreciate some instructions. – user8761 Jun 8 '09 at 23:00
I made an attempt to cleanup the question a bit. Please feel free to further edit or rollback if I destroyed your question at all!!! – squillman Jun 9 '09 at 2:44
Have you tried debugging it at all? Have you tried printing out the contents of cmd_args before that call to int(cmd_args[0])? eg. print cmd_args just to see what is there. – Chealion Jun 9 '09 at 7:30

permissions should not be set for working copy, but for repository access. Also execution right for the script should be set by user running svn server (or httpd server - depending on your solution).

From the error above looks like user running the script doesn't have direct repository access and cannot get revision number..


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.