Subversion and post-commit script errors

SVN does not handle errors with the post-commit script very gracefully. I’m using CommitMessage 2.0. For example:

$ svn commit -m "test2"
Sending paper/intro.tex
Transmitting file data .svn: Commit failed (details follow):
svn: MERGE request failed on '/svn/paper'
svn: MERGE of '/svn/paper': 200 OK (https://svnserver)

The problem was that the particular user who performed the commit did not have an entry in the [userMap] section of commitmessage.conf.

Prior to identifying the problem, this particular client was version 1.2.x and the server was 1.4.1. In that case the error message was:

$ svn commit -m "minor edit"
Sending paper/intro.tex
Transmitting file data .svn: Commit failed (details follow):
svn: MERGE request failed on '/svn/paper'
svn: The MERGE request returned invalid XML in the response: XML parse error at
line 23: Opening and ending tag mismatch: None line 0 and S:post-commit-err
. (/svn/paper)

I’m not sure if this old client would have worked with the current server had commitmessage.conf been correctly configured.

UPDATE 2009.03.23: I just ran into all these problems yet again upgrading from Debian Etch to Debian Lenny (i.e., from SVN 1.4 to SVN 1.5). I haven’t fixed the commit script yet but one way to prevent so many client-side apparent failures is to add “exit 0” to the end of /var/lib/svn/REPO/hooks/post-commit. A non-zero exit code from post-commit triggers all sorts of pain. I prefer that the commit emails fail silently so people can go about their work.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s