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

Re: Hook script questions

From: Ryan Schmidt <subversion-2006c_at_ryandesign.com>
Date: 2006-07-07 00:08:30 CEST

On Jul 6, 2006, at 23:20, Linda Halligan wrote:

> I’m setting up a new subversion instance. It will contain a single
> repository with several projects. One of those projects is going to
> be the source for a tomcat based website. I want the website to get
> updated automatically only when the “website” project is updated.
> Since I’m not a coder I’m not entirely sure how to go about doing
> that.
>
>
>
> Is it possible to write a post-commit script that will execute only
> if that portion of the tree has been changed?

Hi Linda! This can definitely be done. The basic strategy for the
post-commit hook would be:

* call "svnlook dirs-changed -r $REV $REPOS" (where $REV and $REPOS
are the parameters passed into the script, as in the example post-
commit hook) to get the list of directories that were changed by the
commit.

* examine each line of the output with for example grep to determine
if the path to your web site was affected

* if so, update a server-side working copy with "svn update"

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Jul 7 00:10:07 2006

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.