[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: Andrew Brosnan <andrew_at_broscom.com>
Date: 2007-03-01 19:18:53 CET

On 3/1/07 at 1:03 PM, andy.levy@gmail.com (Andy Levy) wrote:

> 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.
> > post-commit only knows about repos path and revision number, how do
> > 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.

The idea is to update the wc running a website, so only that one wc will
auto-update. I was trying to avoid running svn up on the entire wc. when
perhaps only a few files had been committed.

Funnily enough, I started writing a script to do this using svnlook just
as I got your response. Thanks Andy!


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:18:13 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.