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

RE: Re: implementing hook scripts for the first time

From: Joe Bell <joe.bell_at_prodeasystems.com>
Date: Mon, 10 Nov 2008 14:09:23 -0600

You can split things up to your heart's desire, just make sure everything that can be called in the commit script (or child scripts) have some type of environment context - I usually just provide all paths a-priori (i.e., don't call 'rm', call /bin/rm). In other words, assume you're writing a cron task and you have no environment to start with - you have to provide all of it.

My commit scripts consist of bash, Perl, Python, ruby scripts etc. Whatever I need to get the job done.

Joe

-----Original Message-----
From: Jim Hanley [mailto:jhanley_at_dgtlrift.com]
Sent: Monday, November 10, 2008 9:44 AM
To: Adam Downer
Cc: <users_at_subversion.tigris.org>
Subject: Re: implementing hook scripts for the first time

I don't think you can do this. I think it looks for the file name and
executes it.

You could do something similar by having a master script like:

#!/bin/sh
for script in ${0}.dir/* ; do
${script}
done

of course you should probably add the arguements that are missing and
record the return value from the scripts and bail if any one script
fails.

On Nov 10, 2008, at 10:04 AM, "Adam Downer" <adam.downer_at_ri3k.com>
wrote:

> Hello,
>
>
>
> I am starting to apply hook scripts to my repository and I have a
> quick query about how they are set up as the subversion system is
> still relatively new to me.
>
>
>
> Reading the book, it appears that you need to have a file called
> post-commit for subversion to call. I can then use this script to
> call all the other scripts I want to run during a post commit. Can I
> place these secondary scripts in a directory called ‘post-commit’
> inside the hooks directory? Will this work reliably?
>
>
>
> i.e. The post-commit file will have contents like this:
>
>
>
> REPOS="$1"
>
> REV="$2"
>
>
>
> perl ./post-commit-scripts/email.pl REPOS REV
>
> python ./post-commit-scripts/something-else.py REPOS REV
>
>
>
> The book doesn’t seem to suggest that this is possible and makes me
> think I need to put all my operations in one huge script file called
> post-commit for it to work. Obviously being able to split things up
> a bit means it will be more manageble for me.
>
>
>
> Thanks in advance
>
>
>
> Regards
>
> Adam Downer
>
>
> ________________________________________________________________________
 

> This e-mail and its attachments are confidential. If you are not the
> intended recipient of this e-mail message, please telephone or e-
> mail us immediately, delete this message from your system and do not
> read, copy, distribute, disclose or otherwise use this e-mail
> message and any attachments.
>
> Although RI3K believes this e-mail and any attachments to be free of
> any virus or other defect which may affect your computer, it is the
> responsibility of the recipient to ensure that it is virus free and
> RI3K does not accept any responsibility for any loss or damage in
> any way from its use.
>
> RI3K Limited is a company registered in England no: 3909745.
> Registered office 10, Ely Place, London, EC1N 6RY. VAT registration
> no: 769 0192 07

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org

This message is confidential to Prodea Systems, Inc unless otherwise indicated
or apparent from its nature. This message is directed to the intended recipient
only, who may be readily determined by the sender of this message and its
contents. If the reader of this message is not the intended recipient, or an
employee or agent responsible for delivering this message to the intended
recipient:(a)any dissemination or copying of this message is strictly
prohibited; and(b)immediately notify the sender by return message and destroy
any copies of this message in any form(electronic, paper or otherwise) that you
have.The delivery of this message and its information is neither intended to be
nor constitutes a disclosure or waiver of any trade secrets, intellectual
property, attorney work product, or attorney-client communications. The
authority of the individual sending this message to legally bind Prodea Systems
is neither apparent nor implied,and must be independently verified.
Received on 2008-11-10 21:10:00 CET

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.