On Nov 21, 2011, at 17:54, <joe.floe...@sungard.com> <joe.floe...@sungard.com> 
wrote:

> I am looking for an example of a post commit hook script that will 'get' a 
> copy of the files that have changed in the revision being committed. The 
> intent is to populate a set of unix directories with the latest version of 
> source code files.  These directories are in the "PROPATH"  used in our 
> PROGRESS database test systems.  I would prefer examples of unix shell 
> scripts but will also take a look at python or perl scripts. 
> 
> I googled a bit on this and I see a script that in turn calls a Hudson build 
> script but we are not quite ready to do complete system builds. I also think 
> a "bulk" svn export will not work for us either as we really only want the 
> files that have changed in that revision.


If you maintained a server-side working copy, running "svn update" on that 
working copy would only pull the changes. But if you really only want the files 
that have been changed, in order to do something special with them, then a 
different approach using svnlook may be desirable. You use "svnlook changed" to 
see what files changed, and you can use "svnlook cat" to extract them from the 
transaction to do things with them.

There have been a few such scripts posted here over the years. Here's one that 
tries to do a PHP syntax check on each PHP script committed:

http://svn.haxx.se/dev/archive-2008-01/0277.shtml

Perhaps that's a useful example to start with. This is a pre-commit hook but a 
post-commit hook is similar (you just deal with a revision instead of a 
transaction).



Reply via email to