[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Windows Hook Script - Automatic web publishing

From: WysG <wysg_at_hextudio.com>
Date: 2005-04-23 06:34:17 CEST

To make a short story long :)

Currently, at work, the dev environnment(for web application) is set up
like this

webdev\
webdev\app1\somefile.asp
webdev\app2\someotherfile.asp
webdev\app3\blabla.asp

And it's dirrectly on the web server so we can instantlly test our
changes, but you guest it right, working on the same file as a co-worker
is a pain where the sun don't shine and we don't have versionning of files.

So obviously we need a version control system and the choice, after
checking all systems available, stoped on Subversion. But we would need
a hook script that "publish" automaticly our changes on the web server.

So here's the pseudo-code for what would the hook script looks like, I'd
need to do this in a Windows batch file or a C/C++ program, but it can't
be in perl or python aren't installed on this Windows Server and won't
be :'(

----
/* The hook receive two arguments
[1] REPOS-PATH   (the path to this repository)
[2] REV          (the number of the revision just committed)
*/
strPath = [1]
intRev = [2]
arrDirsChanged = Execute "svnlook dirs-changed strPath -r intRev" /* If
I do this as a C/C++ program, how can I execute a command and get the
data back */
/*
The data return by svnlook dirs-changed looks like this :
/
app2/
app2/trunk/
app2/trunk/someotherfile.asp
*/
/* Obviously the initial check out would have been done initialy manualy */
for each arrDirsChanged as strDirChanged
        IF Part of strDirChanged = app1/trunk
                Do svn update in Webserver_root/webdev/app1
        IF Part of strDirChanged = app2/trunk
                Do svn update in Webserver_root/webdev/app2
        IF Part of strDirChanged = app3/trunk
                Do svn update in webserver_root/completly_different_path/
/* End For Each*/
----
So the question to all Subversion guru is : Is this the correct way to
do it ? Is there any other way that I'm not seeing. Is this possible as
a Batch file ? If yes how ?
Thanks in advance for any advice.
---
WysG
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Apr 23 06:47:41 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.