post commit hook to update a file under version

后端 未结 2 1009
無奈伤痛
無奈伤痛 2021-01-12 06:08

I have made a file called version.ini that is under version control (/trunk/version.ini) i now wanted to make a post commit hook to update that file with the latest version

2条回答
  •  清歌不尽
    2021-01-12 06:33

    There is no way to change anything in the repo without modifying the revision number.

    The solution is to put special keywords (search for svn:keywords) into the file and have SVN replace them during checkout. It will seem that these values come from the repository but the representation of the file in the repository will not change.

    You're probably looking for $LastChangedRevision$ (or $Rev$ for short).

    Another solution is to add a rule to your build tool/Makefile/whatever which uses svn info on the root directory of your project to determine the current revision and puts that into a temporary file (which is not added to your repo).

提交回复
热议问题