You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by loubingyong <lo...@fmsh.com.cn> on 2004/12/24 02:26:57 UTC

question about the hooks

Hi,

I have a question about the suvbersion hooks.

I am using subversion 1.1.1 on Windows 2000/XP system, my server is Windows Server 2003 + Apache 2.0.52 + Subversion 1.1.1.
I want the post-commit hook to send a email via outlook to inform the team members, so I write a VBscript to send email , the code is below:

-------------------------------------------------------------------------------

On Error Resume Next
 
strComputer = "."
 
Set objArgs = WScript.Arguments

Set myolapp = CreateObject("Outlook.Application")
Set myItem = myolapp.CreateItem(olMailItem)
Set myRecipient = myItem.Recipients.Add("Team_mail")
myItem.Subject = objArgs(0) & " " & objArgs(1)
myItem.Send
-------------------------------------------------------------------------------

then I put the vbscript in Repo/To/Path/hooks, and create a post-commit.bat with only 1 line:

-------------------------------------------------------------------------------

c:\windows\system32\cscript.exe Repo/To/Path/hooks/myvbscript.vbs

-------------------------------------------------------------------------------

When I commit a file, the commit process seems to hang up. So I checked the processes running on the server,
and found the reason is that the cscript.exe did not exit. 

But if I modify the VBscript and do not use Outlook object  in the code, the VBscript could be excuted normally. 

Is Subversion server not compatible with windows host script?  Or should I change my server configuration?

Thanks,
bylou



答复: question about the hooks

Posted by loubingyong <lo...@fmsh.com.cn>.
Hi  Toby,
    Outlook is already runnning, but the result is the same. 
    Thank you very much, I will try your suggestion. 


loubingyong wrote:

>When I commit a file, the commit process seems to hang up. So I checked the processes running on the server,
>and found the reason is that the cscript.exe did not exit. 
>
>But if I modify the VBscript and do not use Outlook object  in the code, the VBscript could be excuted normally. 
>
>Is Subversion server not compatible with windows host script?  Or should I change my server configuration?
>  
>
Is Outlook already running on the server when you attempt to run the
hook script? I believe it is required that the Outlook application
already be running in order to create new Outlook objects.

I'm no Windows programming expert, but I believe a much better solution
that creating an Outlook object is to use the CDOSYS library, which is
built in to Windows 2000, XP, and 2003 and doesn't require anything else
to be running. See the following link for some information.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdosys/html/_cdosys_about_cdo_for_windows_2000.asp



Re: question about the hooks

Posted by Toby Johnson <to...@etjohnson.us>.
loubingyong wrote:

>When I commit a file, the commit process seems to hang up. So I checked the processes running on the server,
>and found the reason is that the cscript.exe did not exit. 
>
>But if I modify the VBscript and do not use Outlook object  in the code, the VBscript could be excuted normally. 
>
>Is Subversion server not compatible with windows host script?  Or should I change my server configuration?
>  
>
Is Outlook already running on the server when you attempt to run the
hook script? I believe it is required that the Outlook application
already be running in order to create new Outlook objects.

I'm no Windows programming expert, but I believe a much better solution
that creating an Outlook object is to use the CDOSYS library, which is
built in to Windows 2000, XP, and 2003 and doesn't require anything else
to be running. See the following link for some information.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdosys/html/_cdosys_about_cdo_for_windows_2000.asp



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org