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

[Subclipse-users] Svnant fails when run as hook

From: Johannes Braunias <Johannes.Braunias_at_sonydadc.com>
Date: 2007-11-23 11:36:12 CET

Good day!

I'm experiencing the following problem:
I want to copy files out of a repository to a folder, after a commit is
I implemented therefore the following ant task as a post-commit hook.
(All on a Windows system.)

When executing the task from the command line, this works fine.
When executing it as a hook in the post-commit batch, it fails.

The only difference: from command line, it runs on my user account, when
executing as a hook, it runs as the SYSTEM user.
The Path variable is available (set in the hook batch file). Hmm, other
variables needed?
After a commit, ant starts, but the "svn" process hangs. When it is
killed, the rest of the ant log file is written.

Anyone out there to help me?!
Thanks a lot.


### Ant file:
<project name="post-commit-hook" default="testtask" basedir=".">
        <property name="dir-source" location="c:\temp\repcopy"/>
        <property name="dir-dest" location="c:\temp\dist"/>
        <property name="repos" value="____"/>
        <property name="rev" value="____"/>
        <property environment="env"/>

        <typedef resource="svntask.properties"/> <!--
Alternativsyntax: <taskdef name="svn"
classname="org.tigris.subversion.svnant.SvnTask"/> -->

        <target name="testtask">
                <!--<echo message="Repository: ${repos} Revision: ${rev}"
                <echo message="Environment: ${env.Path}"
                <svn javahl="false" username="jbraunia"
                        <export srcUrl="http://localhost/svn/test"
destPath="c:\temp\rrrrrraus" revision="${rev}" force="true"/>

### post-commit.bat (exporting revision 30):
set REPOS=%1
set REV=%2
set ANT_HOME=C:\Programme\apache-ant-1.7.0
set JAVA_HOME=C:\Programme\Java\jre1.6.0_02
set SVN_HOME=C:\Programme\svn-win32-1.4.5
set PATH=%PATH%;%ANT_HOME%\bin
set PATH=%PATH%;%SVN_HOME%\bin
ant -f D:\data\svn\repository\hooks\post-commit\post-commit-test.xml
-Drepos=%REPOS% -Drev=30 -logfile

### Manual execution of the ant file (repository parameter set):
ant -f D:\data\svn\repository\hooks\post-commit\post-commit-test.xml
-Drepos=d:\data\svn\repository\ -Drev=30 -logfile

### Ant log file (after failed execution):
      [svn] Using command line interface
Svn : Exporting
export -r 30 http://localhost/svn/test c:\temp\rrrrrraus --force
>>>> svn process killed manually
Authentication realm: <http://localhost:80> Test Repository

D:\data\svn\repository\hooks\post-commit\post-commit-test.xml:26: Can't

Total time: 20 seconds

### Ant log file (after successful manual execution):
      [svn] Using command line interface
Svn : Exporting
export -r 30 http://localhost/svn/test c:\temp\rrrrrraus --force
A C:\temp\rrrrrraus
A C:\temp\rrrrrraus\neu11556405.OLD
A C:\temp\rrrrrraus\neu11558869.OLD
A C:\temp\rrrrrraus\1
A C:\temp\rrrrrraus\neu11557236.OLD
A C:\temp\rrrrrraus\neu11556635.OLD
A C:\temp\rrrrrraus\neu11557742.OLD
A C:\temp\rrrrrraus\neu11558048.OLD
A C:\temp\rrrrrraus\neu11557349.OLD
A C:\temp\rrrrrraus\neu11558276.OLD
A C:\temp\rrrrrraus\neu11556111.OLD
A C:\temp\rrrrrraus\neu11557855.OLD
A C:\temp\rrrrrraus\neu11556876.OLD
A C:\temp\rrrrrraus\neu11555887.OLD
Exported revision 30.

Total time: 1 second
Received on Fri Nov 23 11:36:42 2007

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