Question

I'am new to SVN, and I can't find a solution to make "after commit" update a specific txt file. I have a php project, within changelog.txt inside the root folder (at the same level where index.php is located). What I want is that after each svn commit, my changelog.txt will be updated with some information by looking like this:

*** 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
-------------------------------------------------

I tried to find some info but there was a plenty websites showing the exemples with C++ programming. Is there any other solution to use only SVN and PHP ? As I'am not even a newbie in C++.

UPDATED

Here is a visual to show you where my changelog.txt is:

- web
 |- framework
 |  + engine
 |  + framework
 - web
   + css
   + images
   | index.php
-->| changelog.txt

Thanks

Was it helpful?

Solution

I'm going to assume your changelog is stored in SVN itself. In which case, stop right there. You cannot update a file that's stored in SVN after committing, because it will then need committing, which will trigger the update that makes it need committing... you get the idea.

You can happily write data to a new file and use that however, simply create a file called post_commit in the hooks directory and put some script in it (and script language you like) to call svn log, pipe the output to your changelog file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top