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

Re: Run different post-commit hook script based on change

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-05-23 01:00:47 CEST

On May 22, 2007, at 17:52, Melanie McSally wrote:

> Is there a way to trigger different scripts to run from the post-
> commit hook based on what was changed?
>
> I have two scenarios:
> 1) When a commit happens on a branch I want the changes to be
> automatically deployed to server a, but when a commit happens to
> the trunk I want the changes to be automatically deployed to server b.
> 2) When a commit happens that involves changes to the web directory
> only, I want server a to be automatically updated without a build,
> but when changes happen to any other directory or file outside of
> web, i want a full build to occur for server a.
>
> I have builds and updates working from my post-commit hook, all I
> am looking for is help on knowing what has changed so I can trigger
> the correct script to run.
>
> Does anyone know how to do this, or if this capability even exists?

Sure. Well, Subversion will always call a single post-commit hook, so
you need to write that script to react differently depending on what
was changed in the repository. Use "svnlook changed" or "svnlook dirs-
changed" in your post-commit hook to discover what changed.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed May 23 01:01:20 2007

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.