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

Re: Post-commit hook tutorials?

From: John Peacock <john.peacock_at_havurah-software.org>
Date: Thu, 28 Feb 2008 20:38:47 -0500

Robert Denton wrote:
> If any file is committed in a specific SVN directory, copy that file to
> a windows file server via UNC (or any other means). Any suggestions
> would be great. Thanks!

Here's the short answer - Don't write your own hooks (see below)!

Here's the explanation why:

        http://svn.haxx.se/users/archive-2007-10/0498.shtml

Here's how to use someone else's hard work, so you have more time to play
[insert your favorite time waster here]:

Install SVN::Notify::Mirror[1] and SVN::Notify::Config[2]. Write a post-commit
file like this:

         #!/usr/bin/perl -MSVN::Notify::Config=$0
         --- #YAML:1.0
         '':
           PATH: "C:/Subversion/bin"
         'path/in/repository':
           handler: Mirror
           minimal: 1
           to: "/path/to/www/htdocs"

and you are done (if the repository is local to the destination that is). If
your Subversion server is Windows (my condolences), you are going to have to
write a CMD file wrapper.

You won't be able to use UNC paths from a service account on Windows (because
those are specifically limited to local machine access only). You could use
SVN::Notify::Mirror::SSH (if you can install SSH on the remote server) which I
have done quite successfully at my previous job. Or you can prod me a little
and I'll write an FTP subclass... ;-)

HTH

John

1) http://search.cpan.org/search?query=SVN::Notify::Mirror
2) http://search.cpan.org/search?query=SVN::Notify::Config

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-02-29 02:40:10 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.