You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by ka...@gmx.de on 2014/02/11 14:32:41 UTC

Pre commit script exit code validation stopped working after subversion update

Hello,

we just tried to update subversion from 1.7.10 to 1.8.5, but after the upgrade a non zero exit code from our pre commit script is no longer recognized.

Minimal example to recreate the error:
System: Windows 7, Subversion command line client 1.8.5
1. Create a svn repository in a folder on your filesystem
2. Create a hook script in the hook folder of the repository (called "pre-commit.bat"), which always gives a non zero return value:
------
@echo off
set ERRLEV=1
echo pre-commit.bat > con
echo Er: %ERRLEV% > con
pause < con > con
exit /b %ERRLEV%
------
3. Create a working copy from that repository (using the file:/// syntax)
4. Add a new file to svn and commit the changes
5. The file gets transferred to the repository, ignoring the non zero return value from the pre commit scipt

If you do the same thing with subversion 1.7.10 the commit is stopped and an error messages is displayed.

Did I miss something or is this a bug?

Regards,
Karl

RE: Pre commit script exit code validation stopped working after subversion update

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: karl.mauser@gmx.de [mailto:karl.mauser@gmx.de]
> Sent: dinsdag 11 februari 2014 14:33
> To: users@subversion.apache.org
> Subject: Pre commit script exit code validation stopped working after
> subversion update
> 
> Hello,
> 
> we just tried to update subversion from 1.7.10 to 1.8.5, but after the upgrade
> a non zero exit code from our pre commit script is no longer recognized.
> 
> Minimal example to recreate the error:
> System: Windows 7, Subversion command line client 1.8.5
> 1. Create a svn repository in a folder on your filesystem
> 2. Create a hook script in the hook folder of the repository (called "pre-
> commit.bat"), which always gives a non zero return value:
> ------
> @echo off
> set ERRLEV=1
> echo pre-commit.bat > con
> echo Er: %ERRLEV% > con
> pause < con > con
> exit /b %ERRLEV%
> ------
> 3. Create a working copy from that repository (using the file:/// syntax)
> 4. Add a new file to svn and commit the changes
> 5. The file gets transferred to the repository, ignoring the non zero return
> value from the pre commit scipt
> 
> If you do the same thing with subversion 1.7.10 the commit is stopped and an
> error messages is displayed.
> 
> Did I miss something or is this a bug?

Does the result change if you don't use '/b' for your exit, as you *do* want to exit cmd.exe (which executes your .bat file) here.

[[
G:\>svn --version
svn, version 1.8.5-SlikSvn-1.8.5-X64 (SlikSvn/1.8.5) X64
   compiled Nov 30 2013, 17:17:43 on x86_64-microsoft-windows6.2.9200

Copyright (C) 2013 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

The following repository access (RA) modules are available:

* ra_svn : Module for accessing a repository using the svn network protocol.
  - with Cyrus SASL authentication
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - using serf 1.3.2
  - handles 'http' scheme
  - handles 'https' scheme

G:\>svnadmin create REPO

G:\>echo @exit 1 > REPO\hooks\pre-commit.bat

G:\>svn mkdir file:///%CD%/REPO/q -m "QQ"
svn: E165001: Commit blocked by pre-commit hook (exit code 1) with no output.

G:\>echo @exit 111 > REPO\hooks\pre-commit.bat

G:\>svn mkdir file:///%CD%/REPO/q -m "QQ"
svn: E165001: Commit blocked by pre-commit hook (exit code 111) with no output.
]]

	Bert