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

Re: Change Property in Pre-Commit-Hook

From: Ryan Schmidt <subversion-2006Q1_at_ryandesign.com>
Date: 2006-02-16 18:53:14 CET

On Feb 16, 2006, at 18:00, Oliver Kopf wrote:

> I want to change the property KOPF:TestDate to a default if the
> contents of the file has changed before the commit was executed.
> For this purpose I have created the following batch file:
> pre-commit.bat:
> set REPOS=%1
> set TXN=%2
> ...
> svn propset KOPF:TestDate 2004-04-04 %TXN% >> Commit_Log.txt
> ...
>
> But the property isn't changed and in the Commit_Log file I get no
> error ! I have also checked with the option --force but it's the same.

There are at least three things wrong here:

1. svn propset requires a working copy; it cannot operate on a URL as
you are trying to do. The ability to have svn propset work on a URL
is an open feature request, currently scheduled for inclusion in
Subversion 1.4:

http://subversion.tigris.org/issues/show_bug.cgi?id=2238

2. You're not seeing an error in your log because you've only
redirected stdout but errors are always printed to stderr. If you
want to redirect stderr as well, you might write

....... >> Commit_Log.txt 2>&1

3. Do not attempt to modify a transaction in a hook script. Please
see the last red warning box on this page:

http://svnbook.red-bean.com/nightly/en/
svn.reposadmin.create.html#svn.reposadmin.create.hooks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Feb 16 19:08:42 2006

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