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

RE: svn and wscript

From: Luke Mason <lmason_at_oasisasset.com.au>
Date: Tue, 10 Nov 2009 15:54:50 +1100

-----Original Message-----
From: Ulrich Eckhardt [mailto:eckhardt_at_satorlaser.com]
Sent: Monday, 9 November 2009 7:35 PM
To: users_at_subversion.tigris.org
Subject: Re: svn and wscript

On Monday 09 November 2009, Luke Mason wrote:
> I've changed the script a bit, incorporated the changes suggested by Uli
> & Ben:
>
[snip]

You incorporated Ben's changes, but the problem still remains: svn.exe can't
write its output, so it sits there waiting for the other side to process its
buffers. Just drop the loop where you try to wait for it to finish. Instead,
rely on the ReadAll, which will only return when svn.exe has finished by
itself.

Note: I'm not sure if even that is reliable. The point is that if svn.exe
writes significant amounts of data to stderr, it will block, too. If you
redirect the stderr output, you should be fine though.

> Is SVN not returning a correct status? How can I tell? This seems to
> be distinct to the ExitCode, which is another
> property altogether.

No, this is a classical deadlock. SVN wants to give you some data before it
finishes. Your wscript is waiting for SVN to finish before taking any data
from it. It can not work this way.

Uli

-- 
[snip]
I've removed the loop on status as suggested and things work!  I use .ReadAll as suggested,
But then split it on crlf and log each line individually.  It makes things prettier ^_^
Thankyou for the advice.
Function runCmd(cmd, msg)
	debug("Function: runCmd: " & msg)
	Dim objShell
	Dim objExecObject
	Dim strText
	Set objShell = WScript.CreateObject("WScript.Shell")
	Set objExecObject = objShell.Exec(cmd)
	LogSectionOpen "runCmd"
	strText = trim(objExecObject.StdOut.ReadAll)
	if len(strText) > 0 then
		LogSectionOpen "StdOut"
		LogSplitString strText, vbCrLf, LOG_NORMAL
		LogSectionClose "StdOut"
	end if
	
	strText = trim(objExecObject.StdErr.ReadAll)
	if len(strText) > 0 then
		LogSectionOpen "StdErr"
		LogSplitString strText, vbCrLf, LOG_WARN
		LogSectionClose "StdErr"
	end if
	LogSectionClose "RunCmd"
	
	runCmd = objExecObject.ExitCode
	Set objExecObject = Nothing
	Set objShell = Nothing
End Function
"This email is intended for the named recipient only. The information contained in this message may be confidential, or commercially sensitive. If you are not the intended recipient you must not reproduce or distribute any part of this email, disclose its contents to any other party, or take any action in reliance on it, or in reference to it. If you have received this email in error, would you please contact the sender immediately and delete/destroy all copies of this message, both electronic and otherwise. It is the recipient's duty to virus scan and otherwise test the enclosed information before using the information or loading attached files onto any computer system. Oasis Asset Management Ltd does not warrant that the information contained in this e-mail is free from viruses, defects, errors, interception or interference. Any views expressed in this message are those of the individual sender, except where that sender specifically states them to be the views of Oasis Asset Management Ltd."
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2416008
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-11-10 05:55:52 CET

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.