tags:

views:

159

answers:

1

I want to have a pre-commit hook check if the current commit is a tag, and if so, check for any svn:externals properties and change them to have revisions if they do not. I have a good idea of how to grep for if they are tags or not, but getting and changing the properties is proving challenging.

A: 

You can do this in a pre-commit hook via svnlook changed (not missing the transaction information via -t)

svnlook changed t --copy-info

This print out something like this:

A + p2/tags/FIRST-TAG/
(from p2/trunk/:r8)

So this is a tag...

Check for properties is fine as well...

svnlook proplist t /p2/tags/FIRST-TAG

So far so good. You can now check the contents of an svn:externals.

But you should never modify anything within a transaction. Never Never do this. The best thing is to simply abort the operation (giving back non zero) and give an explanation about this via stderr output.

khmarbaise