You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Brian Erickson <er...@BAUERCONTROLS.com> on 2006/12/14 14:57:40 UTC
Start-commit hook script
Hi all,
I'm a new SubVersion user and am having a problem with hooks...I'm using
Windows XP...
Right now, I'm trying to set it up so that no commits can happen to the
tags branch of the respository. From what I've been able to figure out,
what I need to do is use the svnlook command to see if anything is
change in the tags folder. Is that the best way?
So far, my batch file looks like this:
@echo off
Rem Start-commit hook
Rem Make sure that commits are not done in tags...
Rem %1 = repository path, %2 = User trying the commit
set APRI_ICONV_PATH=D:\SubVersion\iconv
set path=d:\SubVersion\bin
echo %path% >&2
echo '%1' '%2' '%3' '%4' '%5' '%6' '%7' '%8' '%9' >&2
d:\SubVersion\bin\svnlook changed d:\svn\pcs >&2
exit 1
Commits always fail, so I know the script is running.
The attempt to commit always produces the following:
svn: Commit failed (details follow):
svn: 'start-commit' hook failed with error output:
d:\SubVersion\bin
'//snidely/svn/pcs' 'erickson' '' '' '' '' '' '' ''
The system cannot find the path specified.
Notice, I'm not using any of the parameters to the script. I've got the
path to the repository hard baked.
If I manually clear out the environment and run the batch file by hand,
it works fine.
Can someone point me in the right direction?
Thanks,
Brian
Re: Start-commit hook script
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Dec 14, 2006, at 08:57, Brian Erickson wrote:
> Right now, I'm trying to set it up so that no commits can happen to
> the
> tags branch of the respository. From what I've been able to figure
> out,
> what I need to do is use the svnlook command to see if anything is
> change in the tags folder. Is that the best way?
>
> So far, my batch file looks like this:
>
> @echo off
> Rem Start-commit hook
> Rem Make sure that commits are not done in tags...
> Rem %1 = repository path, %2 = User trying the commit
>
> set APRI_ICONV_PATH=D:\SubVersion\iconv
> set path=d:\SubVersion\bin
>
> echo %path% >&2
> echo '%1' '%2' '%3' '%4' '%5' '%6' '%7' '%8' '%9' >&2
> d:\SubVersion\bin\svnlook changed d:\svn\pcs >&2
>
> exit 1
>
>
> Commits always fail, so I know the script is running.
>
> The attempt to commit always produces the following:
>
> svn: Commit failed (details follow):
> svn: 'start-commit' hook failed with error output:
> d:\SubVersion\bin
> '//snidely/svn/pcs' 'erickson' '' '' '' '' '' '' ''
> The system cannot find the path specified.
>
> Notice, I'm not using any of the parameters to the script. I've
> got the
> path to the repository hard baked.
>
> If I manually clear out the environment and run the batch file by
> hand,
> it works fine.
1. Are you sure the drive letter D: is defined for the user under
which the hook is running? I've heard that for Windows, drive letters
are a per-user thing.
2. You will want to use the pre-commit hook, not the start-commit
hook. By start-commit hook time, the transaction you want to examine
has not yet been created, but by pre-commit hook time, it has.
--
To reply to the mailing list, please use your mailer's Reply To All
function
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org