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

Re: Multiple post-commit scripts for multiple projects

From: John Peacock <jpeacock_at_rowman.com>
Date: 2007-08-18 13:31:00 CEST

Graham Anderson wrote:
> Hi
>
> Within the same repository, is it possible to execute a post-commit
> depending on the project/directory being updated?

Yes, see theze Perl modules (the first which I wrote and the second which I am
the current maintainer):

     http://search.cpan.org/search?query=SVN-Notify-Mirror
and http://search.cpan.org/search?query=SVN-Notify-Config

The former can be used to keep local, remote, or even rsync'd working copies in
sync with multiple paths in the repository. The latter makes it possible to do
it without even a "script" per se. For example, here is the entire contents of
a post-commit script:

#!/usr/bin/perl -MSVN::Notify::Config=$0
--- #YAML:1.0
'':
  PATH: "/usr/bin:/usr/local/bin"
'/path':
  handler: HTML::ColorDiff
  to: project-admin@example.com
'/path/snapshot':
  fork: 1
  handler: Snapshot
  to: "/tmp/tarball-%{%Y%m%d}-${revision}.tar.gz"
'/path/multitarget':
  to:
    - alice@localhost
    - bob@localhost
    - root@localhost
'/path/tags':
  handler: Mirror
  to: '/path/to/another/dir'
  tag-regex: "RELEASE_"

That is the configuration data, in YAML format, but that is also the script
itself. To annotate what that does:

1) Commits to '/path' generate a colorized diff e-mail to project-admin@example.com.

2) Commits to '/path/snapshot' cause a tarball to be created.

3) Commits to '/path/multitarget' send a commit e-mail to three addresses.

4) Commits to '/path/tags' cause the working copy in '/path/to/another/dir' to
be switched to the new tag.

HTH

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Blvd
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Aug 18 13:28:35 2007

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.