开发者

SVN change property in pre-commit

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 chall开发者_如何学编程enging.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜