[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Help with post-commit script

From: Alfred von Campe <alfred_at_von-campe.com>
Date: Mon, 2 Dec 2013 15:44:10 -0500

I need to implement a post-commit hook that does the following in a "standard" Subversion repository (with trunk, branches, and tags at the top level):

  1. Checks for existence of a certain property in the top-level directory of the trunk or branch
  2. If property exists, check if any files listed in said property's value has been modified
  3. Send an email with all diffs from step 2 to the recipients listed in another property

What makes it tricky is that in all steps above I need to be able to handle trunk as well as any branches. In addition, since it is possible to submit to both trunk and/or one or more branches in the same commit, and the property may exist in one but not the other, I need to walk through all files affected in the commit. I think this means I cannot use just svnlook and will have to parse the output of svn log. My questions are:

  1. Is parsing the output of svn log the best approach?
  2. If not, what is a better approach?
  3. I would prefer to write this in bash or perl, but would appreciate any examples in other languages before I go re-inventing the wheel.

Thanks,
Alfred

P.S. Please CC me as I am not on the list.
Received on 2013-12-02 21:44:52 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.