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

Re: Automatic properties for new added files

From: Ryan Schmidt <subversion-2009d_at_ryandesign.com>
Date: Wed, 2 Dec 2009 11:51:35 -0600

On Dec 2, 2009, at 09:55, Claudio Ferreira wrote:

> I have noticed that the Subversion Client only performs the Automatic properties creation when a new file is added thru a working copy, and not when it is commited in that working copy.

That's right. Autoprops are applied at add time, not at commit time. The purpose of using a working copy at all is to examine your changes before committing. It would be counter to the purpose of using a working copy if "commit" were to make changes other than those you've already requested in your working copy.

> We have a large number of Subversion users than need to commit files with a pre-defined header. This header contains the $Rev:$, $Author:$ and $Date:$ for automatic keyword substitution.
>
> Since the installed base of Subversions Clients is large, we opted to implement a server-side hook script that does not allow commits to files in specified folders with a certain file extension, if the associated files do not contain the Subversion Property 'svn:keywords' set as 'Rev Author Date'.
> The return error message from the hook script indicates to the users where they can get the required Subversion configuration file and replace it in their Subversion Client (or they can set the required property manually before commit).

Sounds good, that's how I'd do it as well.

> The problem is, if a given user adds a new file, and it didn't replace yet the required Subversion Client configuration file, that activates the Automatic properties, then the subversion hook script will not allow the commit to proceed, giving the error message to the user instructing him to replace the required configuration file or setting the Subversion property 'svn:keywords' to 'Rev Author Date' manually, before proceeding with the commit.
> After the user replaces the Subversion configuration file, it tries to execute the commit again (because he already added the file to the working copy), and the hook script denies the commit again...
> He can only work around this problem by 'un-Adding' the already added files to his working copy and re-adding them again, or by setting the required Subversion property manually.
>
> So, the problem is that for newly added files, the Subversion client only executes the Automatic property setting when the files are 'Added', and not when the files are 'Commited'.
>
> I don't know if this behavior should be changed, but it seemed a coherency problem related to the Automatic Property setting by the Subversion Client.

I don't believe the behavior should be changed as explained above.

Your users can either "svn propset" the required properties on the files they've already scheduled for addition, or they can "svn revert" the files to unschedule the additions, then "svn add" them again, which will this time get the automatic properties.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2426409

Please start new threads on the <users_at_subversion.apache.org> mailing list.
To subscribe to the new list, send an empty e-mail to <users-subscribe_at_subversion.apache.org>.
Received on 2009-12-02 18:52:38 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.