You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Juanma Barranquero <jm...@wke.es> on 2004/02/13 14:14:04 UTC

Return code of pre-revprop-change hook ignored in some cases

Using SVN 0.37.0 on a Windows 2K.

I have the following simple .BAT with an embedded perl script:

--------------- example starts here -----------------
@rem = '
@echo off
perl.exe -x -S "%0" %1 %2 %3 %4
goto endofperl
@rem ';
#!perl
exit 1;
__END__
:endofperl
---------------- example ends here ------------------

The intent is to use it as a pre-revprop-change hook (obviously, in real
use it would contain something more useful that "exit 1").

I create a repo, commit a single change, and put this script in hooks/
as pre-revprop-change.bat.

Test 1:

  C:\> svnserve -d -r c:\repo\test

  [In another CMD.EXE window:]
  C:\> svn propset svn:log --revprop -r 1 "Test" svn://localhost/
  Authentication realm: <svn://localhost:3690>
  Password for 'JMBarranquero': *********
  svn: 'pre-revprop-change' hook failed with error output:

  (which seems correct; it's returning 1)

Test 2:

  (No server)

  C:\> svn propset svn:log --revprop -r 1 "Test" file:///C:/repo/test/
  svn: 'pre-revprop-change' hook failed with error output:  

  (again, that's right)

Test 3:

    <Location /svn>
        DAV svn
        SVNPath "C:/repo/test"
        Order Allow,Deny
        Allow from all

        AuthType Basic
        AuthName "Subversion"
        AuthUserFile conf/passwd

        <LimitExcept GET PROPFIND OPTIONS REPORT>
            Require valid-user
            Satisfy All
        </LimitExcept>
    </Location>

    C:\> svn propset svn:log --revprop -r 1 "Test" http://localhost/svn/
    property 'svn:log' set on repository revision '1'
    
    Uh?

What's that? An artifact of the way the .BAT hook is executed by the
mod_dav_svn module?
    
                                                            Juanma



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Return code of pre-revprop-change hook ignored in some cases

Posted by Juanma Barranquero <jm...@wke.es>.
Three days ago, I said:

> --------------- example starts here -----------------
> @rem = '
> @echo off
> perl.exe -x -S "%0" %1 %2 %3 %4
> goto endofperl
> @rem ';
> #!perl
> exit 1;
> __END__
> :endofperl
> ---------------- example ends here ------------------

It works by doing:

  @rem = '
  @echo off
  perl.exe -x -S "%0" %1 %2 %3 %4
  exit %ERRORLEVEL%
  @rem ';
  #!perl
  exit 1;

but I don't understand why doing a goto in CMD.EXE would lose
%ERRORLEVEL, and even less why it does behave differently in
http:// setups that it does in svn:// or file:// ones.

Well, it's a moot point now, anyway.

                                                                Juanma



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org