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

Re: howto pass command-line option from svn client to repository....(new option --skip-post-commit)

From: Max Bowsher <maxb1_at_ukf.net>
Date: 2005-11-15 15:43:24 CET

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lucas van Staden wrote:
[snipped: Using svn in web development environment.
  Many branches. Wants to automate Apache/DNS setup that goes along
  with creating a new branch.]

> I have begun to automate this process using the hook scripts, so now when we
> use our svn clients (linux) to create a branch folder, and commit this folder
> to the repository, the hook scripts create the required apache folder (more
> on this in next paragraph), creates the apache vhost entries (working) and
> adds the required dns entry into bind (working), which then gets replicated
> to the main windows domain dns servers (waiting for the network guys to get
> back to me on this).
>
> (and breathe again)
>
> Sofar everything is working good, appart from the creation of the apache
> folders (the most crucial bit - read on this is a development issue...;)..),
> the process is as follows:
>
> Post-commit hook script checks to see a folder with the name of the branch
> exists, and if not creates it, and does an inplace checkout as described in
> the faq to make it an active svn workdir to the branch in the repository.
> It then copies all the source files (php/javascript/html templates) into this
> folder, and does a svn add on these, followed by a commit (can you see the
> issue yet?)

OK, now this is the first bit which puzzles me. The client is creating
an empty directory to contain the branch, and then the server fills it
in? Why do things this way, rather than have the client do "svn copy
TRUNK-URL BRANCH-URL", and have the post-commit just do a checkout of
the new branch?

...

> The issue is that when the post-commit script does the commit, the commit
> itself triggers the post-commit script again. This can at times send the
> process into an endless loop, and also slow the process down, creating more
> new folders etc.
>
> Now I thought of creating a new option called --skip-post-commit for the svn
> client, which would then be included in the svn commit used by the
> post-commit script.

Whoa! Serious over-engineering.

If the post-commit is only supposed to do anything when it sees a branch
directory being created, just make the post-commit check whether this is
the case, and exit if not, before doing anything else.

Max.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)

iD8DBQFDefQLfFNSmcDyxYARAlIxAKC6kgBPyFRiTHNH5nsWTkiZv1dqbACgkogP
vT2phohpD+OpBJAvG8ysdEo=
=c2yI
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 15 15:46:28 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.