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