Search code examples
svnvisualsvnpre-commit-hookpost-commit-hook

VisualSVN commit-hook add revision to a file in the repo


We have a PHP Project under SVN control(VisualSVN).

Somehow, i need to update a file in the repo with the current revision number. So that when the main site gets updated/checkout we can show the svn build number (this part is not the issue).

is it possible with a pre/post-commit-hook to do this?


Solution

  • Sounds like you need a build solution, rather than a pre-commit hook. Using a build system like Apache Ant, you could grab the latest revision number from the repository when preparing your solution for the live environment.

    Edit: To actually answer your question "is it possible with a pre/post-commit-hook to do this?" yes it is technically possible but as already suggested, it should be avoided.