You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Do...@atosorigin.com on 2006/06/26 07:53:27 UTC

svn:keyword Id as hookscript

Hi list,

for some reasons, the development team need a CVS-Header in their
scripts. Now I set this for the old items with the svn:keyword command.
Is there any possibility to do this with a hook script? With which one?
Can you give me a hint or a Url of a tutorial?

Thanks in advance!
Dominique

Re: svn:keyword Id as hookscript

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jun 26, 2006, at 09:53, Dominique Ronde wrote:

> for some reasons, the development team need a CVS-Header in their
> scripts. Now I set this for the old items with the svn:keyword  
> command.
> Is there any possibility to do this with a hook script? With which  
> one?
> Can you give me a hint or a Url of a tutorial?

No. You cannot modify a transaction in a pre-commit hook.* If you  
require all files (or all .c files, say) to have this keyword set,  
then the best you can do is to write a pre-commit script which checks  
that each file that's about to be committed does indeed have the  
property, and if it does not, to print an error message explaining to  
the user that they must add this property before committing. Hooks  
are described in the book at http://svnbook.org/ and some example  
hooks are created in the hooks directory of every repository.



* In fact you can, but you must not. Subversion will not currently  
prevent you from modifying the transaction, but if you do, your  
working copies will break and die horrible deaths, so you should not  
modify the transaction. Future versions of Subversion may enforce this.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn:keyword Id as hookscript

Posted by Andy Levy <an...@gmail.com>.
On 6/26/06, Dominique.Ronde@atosorigin.com
<Do...@atosorigin.com> wrote:
> for some reasons, the development team need a CVS-Header in their scripts.
> Now I set this for the old items with the svn:keyword command. Is there any
> possibility to do this with a hook script? With which one? Can you give me a
> hint or a Url of a tutorial?

Do you mean you need to go through the whole repository and apply this
same property to every file?  Best (only) way I can think of is to
check out the whole repository and apply the property recursively to
everything (may require a script if you're not using TSVN).

While you're at it, it'd be a good time to set other properties if
they aren't already set, like svn:mime-type and svn:eol-style.
svn_apply_autoprops.py would come in real handy.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org