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

how to "hook" a executable program?

From: Chien-Lung Wu <cwu_at_deltartp.com>
Date: 2003-05-02 16:14:48 CEST


        Is the "hook" working in this way?
         step1. Any activity (commit, ...) will trigger a hook, for example,
         step2 --> Within post_commit, you can put any "executable" program
to do whatever you want.
                --> so that the executable program will be executed once if
there is any trigger.
                         For example, in each commit, it will call
"send_mail" to do something.

        Is it correct to interpret "hook" functionality?

            When I create a repository, the "hook" directory will be created
automatically with following temp files:

         5/02/2003 9:24 1,406 post-commit.bat
         5/02/2003 8:12 1,297 post-commit.tmpl
         4/24/2003 15:00 1,475 post-revprop-change.tmpl
         4/24/2003 15:00 2,093 pre-commit.tmpl
         4/24/2003 15:00 1,952 pre-revprop-change.tmpl
         4/24/2003 15:00 1,377 start-commit.tmpl

        And following is the procedure for me to test hook functions:
        (I am running subversion on Window NT)
        1. rename the post-commit.tmpl to post-commit.bat (it should be
converted to "bat" format)
        2. within the post-commit.bat, I execute a command "test.bat", which
is very simple, to rename e-text to x.txt

        Following is the post-commit.bat:
        /**** Begin post-commit.bat
        rem !/bin/sh
        echo off
        /**** end of post-commit.bat ****/

        Theoretically, if I commit a file, the post-commit.bat will be
triggered, and then the test.bat will be executed
            once. That means the e-text will be renamed to be x.txt.

        Unfortunately, this don't happen. Anything wrong with this
        Before I hook up any executable program, do I need to do any other

        Following the document (chapter 5 --repository hooks), there is a
perl program called commit-email.pl.
        As I install Subversion on Window NT, I can not find it there. But I
can get it from subversion's source code
        (tools/hook-scripts/). It seems to me that it works on Unix/Linux
environment. Are there any other program
            working on window? or do I need to convert for running in
Window? (sorry, I do not familiar with perl.)

        Appreciate your help. Thanks.

        -- Chien-Lung

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 2 16:17:01 2003

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.