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

Re: Automatic checkout of hook scripts under revision control

From: John Rouillard <rouilj_at_renesys.com>
Date: 2006-12-21 21:42:46 CET

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
Received on Thu Dec 21 21:43:37 2006

This is an archived mail posted to the Subversion Users mailing list.