Hi John,
Thanks very much for the example code - I'm off and running.
Thanks also for confirmation that it's safe to have the hooks
directory on the server be a working copy.
One question - how does your post-commit script handle the case that
it's the post-commit script itself that's just been committed ?
Doesn't this depend on the shell 'doing the right thing' when it
executes the post-commit hook and "svn up" 'doing the right thing'
when it updates the working copy of the post-commit hook?
The utility of a "checkoutlist" file is that it's a way to avoid
having the post-commit hook known the names of the files to update.
Your code already minimizes that to "SVN/*".
Cheers,
Tim.
On Dec 21, 2006, at 3:42 PM, John Rouillard wrote:
> On Thu, Dec 21, 2006 at 11:48:51AM -0500, Tim Bingham wrote:
>> I'd like to put my hook scripts under revision control and have
>> the copy on
>> the svn server automatically checked out when a modified hook
>> script is
>> committed.
>>
>> I'm looking for advice and suggestions. e.g. is there a tool, a
>> contrib or
>> example that does this? Is there a reason that Subversion doesn't
>> provide
>> this feature and that I'll trip over if I try to implement this
>> myself?
>
> Not that I know of, but it's easy enough to implement.
>
>> Committing the hooks scripts is, of course no problem. I can also
>> see how
>> the automatic checkouts can be triggered from 'post-commit'.
>> Additionally,
>> I expect to mimic CVS and create the equivalent of the
>> "checkoutlist" file.
>
> Hmm, not sure i see the utility of the checkoutlist file but...
>
>> I not sure of the best way to update the copies of the scripts on
>> the svn
>> server. For example can I simply make my "hooks" directory a
>> working copy?
>> Is that safe?
>
> I keep my SVN hook and conf files under /SVN (/SVN/hooks and /SVN/conf
> respectively) in the repository and use:
>
> # check out/update SVN control files if needed
> if svnlook -r $2 dirs-changed $1 | grep '^SVN/' > /dev/null; then
> echo "Updating repository control files." >&2
> cd $1/hooks
> output=`svn up 2>&1`
> if [ $? != 0 ]; then
> echo "svn update of hooks config files failed: $output,
> $!" >&2
> fi
>
> cd $1/conf
> output=`svn up 2>&1`
> if [ $? != 0 ]; then
> echo "svn update of conf config files failed: $output,
> $!" >&2
> fi
> fi
>
> in my post-commit script to update them. My hooks and conf dirs are
> svn working copies created using an in place import, but they could be
> normal svn checkouts as well.
>
> No problems so far with dozens of commits to the hook and config
> files.
>
> --
> -- rouilj
>
> John Rouillard
> System Administrator
> Renesys Corporation
> 603-643-9300 x 111
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Dec 22 21:03:59 2006