Broken SVN Post Commit on Joyent Accelerator
I was trying to remove and add lots of files (unfreezing/freezing Rails 2.0), and subversion was just being a pain. It would go through all of the motions for committing, including actually committing the code, but then it would error and leave my working copy all confused.
........ Adding vendor/rails/actionpack/test/template/tag_helper_test.rb Adding vendor/rails/actionpack/test/template/text_helper_test.rb Adding vendor/rails/actionpack/test/template/url_helper_test.rb Adding vendor/rails/actionpack/test/testing_sandbox.rb Transmitting file data ............................................................................................................................................................................................................................................................................................................svn: Commit failed (details follow): svn: MERGE request failed on '/svn/source/Geartracks/trunk/vendor/rails' svn: MERGE of '/svn/source/Geartracks/trunk/vendor/rails': 200 OK (http://svn.nickstielau.com)
I googled around for a little and found a helpful article on Ubergeek. They found that a failing post-commit hook script would cause this error. And then I remembered, checking something on my Joyent Accelerator Webmin panel when I was creating the svn repository.
I looked around a little and found the post-commit hook that webmin created for me:
[nickstielau:~] admin$ sudo cat /home/svn.nickstielau.com/svn/source/hooks/post-commit Password: #!/bin/sh EMAIL="my_email@gmail.com" REPOS="$1" REV="$2" /opt/webmin-1.340/virtualmin-svn/commit-email.pl --from my_email@gmail.com -s "SubVersion commit" "$REPOS" "$REV" "$EMAIL"
No problems there. Looking at the perl script, we find a configuration section:
###################################################################### # Configuration section. # Sendmail path, or SMTP server address. # You should define exactly one of these two configuration variables, # leaving the other commented out, to select which method of sending # email should be used. # Using --stdout on the command line overrides both. #$sendmail = "/usr/sbin/sendmail"; $smtp_server = "127.0.0.1"; # Svnlook path. my $svnlook = "/usr/bin/svnlook"; # By default, when a file is deleted from the repository, svnlook diff # prints the entire contents of the file. If you want to save space # in the log and email messages by not printing the file, then set # $no_diff_deleted to 1. my $no_diff_deleted = 0; # By default, when a file is added to the repository, svnlook diff # prints the entire contents of the file. If you want to save space # in the log and email messages by not printing the file, then set # $no_diff_added to 1. my $no_diff_added = 0; # End of Configuration section. ######################################################################
I wasn't sure if I had an SMTP server running locally, but I could easily check sendmail.
[nickstielau:~] admin$ which sendmail sendmail is /opt/csw/sbin/sendmail [nickstielau:~] admin$ which svnlook svnlook is /opt/csw/bin/svnlook
So I commented the SMTP line and put the the appropiate paths to svnlook and sendmail.
$sendmail = "/opt/csw/sbin/sendmail"; #$smtp_server = "127.0.0.1"; # Svnlook path. my $svnlook = "/opt/csw/bin/svnlook";
Booyeah. Emails on commits. Also notice the two configuration settings there, no_diff_deleted and no_diff_added, to configure how detailed the commit emails are.
