If you want to get the notification email about the code update when a team member commits the code. And the mail contains the Author, Date, Modified,Log and Commit information, just like the following type:
Author: lulei
Date: 2009-04-02 15:12:50 +0800 (Thu, 02 Apr 2009) New Revision: 6615
Modified:
nat/7.Test/test_file/test2.txt
Log:
Commit: Test for the commit notification.
Modified: nat/7.Test/test_file/test2.txt ===================================================================
--- nat/7.Test/test_file/test2.txt 2009-04-02 07:08:21 UTC (rev 6614)
+++ nat/7.Test/test_file/test2.txt 2009-04-02 07:12:50 UTC (rev 6615)
@@ -8,5 +8,23 @@
test it again when updating the repository of subversion.
+test it again when updating the repository of subversion.
+
+test it again when updating the repository of subversion.
This function is very useful and helpful to managers, but it needs more extra effort.
But it can be done by using the svn inbuilt hooks.For more information about the hooks, please refer to the manual of Subversion.
OK, let's do something for the mail notification.
First, you can access the website:http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/commit-email.pl.in, and stored the file "commit-email.pl.in" into your local disk.
Secondly,please copy the file "commit-email.pl.in" into the hooks directory of your Subversion repository, mine is "/svnroot/repo/hooks".
And then renanme the file "commit-email.pl.in" as "commit-email.pl".Defaultly, I thought you have installed perl on your server.
OK, cd to the hooks directory inside of your repository, rename the post-commit.tmpl to post-commit, and then chmod 755 to post-commit and commit-email.pl. Now, let's open the post-commit with your favorite editor, and put the following content at the bottom of the file:
/usr/bin/perl /svnroot/repo/hooks/commit-email.pl "$REPOS" "$REV" --fromsubversion_notifcation@example.com-s 'SVN Commit Notification'user_whom_to_notify@example.comanother_user_whom_to_notify@example.com
And then open the file "commit-email.pl" and make changes to the configuration according to your own requirement and server, sepcillay the svnlook path.
Congratulations! You are done, :)
Now the email addressuser_whom_to_notify@example.com,anthor_user_whom_to_notify@example.comwill get the notification emails whenever someone commits codes.
Hope this article is helpful to you.
So far, I still have an problem about the environment variables.Because sometimes you can not get the right result because of the variables.
OK,if any problems, you can contact me.