You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Oliver Kopf <ol...@kopfweb.de> on 2006/02/16 17:00:58 UTC

Change Property in Pre-Commit-Hook

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.

What wrong ?

Testinstallation of SVN is running on Win32.


Oliver Kopf

Re: Change Property in Pre-Commit-Hook

Posted by Ryan Schmidt <su...@ryandesign.com>.
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