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

Re: update hook per project (or directory)

From: Andy Levy <andy.levy_at_gmail.com>
Date: 2007-03-01 19:03:20 CET

On 3/1/07, Andrew Brosnan <andrew@broscom.com> wrote:
> Hello,
>
> I have a repos layout like
>
> trunk
> proj_a
> proj_b
> proj_c
>
> When wc1 commits I want a hook to update wc2. However, if wc1 only
> commits something in proj_a, I only want proj_a updated in wc2. Since
> post-commit only knows about repos path and revision number, how do I
> accomplish this?

Have the first step of your hook script be to check what changed using
svnlook changed. Then, based on the paths changed, do whatever needs
to be done.

HOWEVER, modifying the repository in a hook script can be troublesome.
If someone commits to wc1, then their WC is instantly out of date
because your hook will increment the global revision # when /trunk/wc2
is updated. I know modifying the in-flight transaction in the
pre-commit is considered a Bad Thing(tm); doing what you're asking is
less bad, but may still not be a great idea.

Plus, you could find yourself in a loop if you're not every careful -
if that hook accidentally updates /trunk/wc1, it'll call the hook
again.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Mar 1 19:04:10 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.