I've been trying to write a post-lock hook for my VisualSVN server on Windows, using batch files and VBS scripts. The end goal is to have the hook email a list of all the locked files to a collection of email addresses. However, the hook is called for every file. I'm hoping there's a way around this, or a clever way of waiting for all the information before sending the email. Also, I want a list of all the files, but currently only the repo path is passed in. I know the file paths are passed via stdin, but I haven't found a way to get that into a string to be passed to my VBS file. Any help would be great.
Batch File:
@echo off
pushd %~dp0
cscript email-bat.vbs %2 LOCKED %1
@pause 5
VBS:
Set emailObj = CreateObject("CDO.Message")
Set args = WScript.Arguments
emailObj.From = "mymail@gmail.com"
emailObj.To = "tomail@gmail.com"
emailObj.Subject = "SVN " + args.Item(1)
emailObj.TextBody = args.Item(0) + " has " + args.Item(1) + " the file(s) " + args.Item(2) + "."
Set emailConfig = emailObj.Configuration
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "mymail@gmail.com"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
emailConfig.Fields.Update
emailObj.Send