我是SVN的新手,找不到让"提交后"更新特定txt文件的解决方案。我有一个php项目,位于根文件夹内的changelog.txt
中(与index.php所在的级别相同)。我想要的是,在每次svn commit
之后,我的changelog.txt将更新一些信息,如下所示:
*** YYYY-MM-DD HH:MM by SVN_USERNAME
SVN_COMMIT_MESSAGE
-------------------------------------------------
*** 2010-09-22 18:31 by marco.belinni
- eshop category navigation - fixed issue with navigation, due overcaching with previous version of seo tool
-------------------------------------------------
*** 2010-09-20 01:03 by jean.laroche
- plg_c16n - fixed canonicalization with SEO Plugin which redirects non www urls to www urls
- mod_login - fixed ie and ff login, hidded input type "remember me" with checked paramater
- the whole frontpage have bolded text because of bolded "READ MORE" button - need to clean it before posting any article
- eshop browse - 10products per page FIXED by clearing cache and purged ALL urls
- eshop orderby - removed useless "SELECT" option in selection field for sorting out the items on page
-------------------------------------------------
我试图找到一些信息,但有很多网站展示了C++编程的例子。有没有其他只使用SVN和PHP的解决方案?因为我甚至不是C++的新手。
更新
这是一个视觉显示,告诉你我的changelog.txt
在哪里:
- web
|- framework
| + engine
| + framework
- web
+ css
+ images
| index.php
-->| changelog.txt
感谢
我假设您的变更日志存储在SVN中。在这种情况下,就到此为止。您不能在提交后更新存储在SVN中的文件,因为它将需要提交,这将触发使其需要提交的更新。。。你明白了。
您可以很高兴地将数据写入一个新文件并使用它,但是,只需在hooks目录中创建一个名为post_commit的文件,并在其中放入一些脚本(以及您喜欢的脚本语言)来调用svn-log,将输出通过管道发送到您的changelog文件。