[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: Ulrich Eckhardt <eckhardt_at_satorlaser.com>
Date: Mon, 9 Nov 2009 09:34:50 +0100

On Monday 09 November 2009, Luke Mason wrote:
> I've changed the script a bit, incorporated the changes suggested by Uli
> & Ben:
>
> Function runCmd(cmd, msg)
> debug("Function: runCmd: " & msg)
> Dim objShell
> Dim objExecObject
>
> Set objShell = WScript.CreateObject("WScript.Shell")
> Set objExecObject = objShell.Exec(cmd)
>
> ' wait for it to finish
> i = 0
> do while objExecObject.Status = 0
> WScript.Sleep 100
> i = i + 1
> debug("Loop " & i)
> loop
>
> LogSectionOpen "runCmd"
> Log "StdOut", objExecObject.StdOut.ReadAll, LOG_NORMAL
> Log "StdErr", objExecObject.StdErr.ReadAll, LOG_WARN
> LogSectionClose "runCmd"
>
> runCmd = objExecObject.ExitCode
> Set objExecObject = Nothing
> Set objShell = Nothing
> End Function
>
> The loop counter shows me that objExecObject.Status never changes from
> zero.

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

-- 
ML: http://subversion.tigris.org/mailing-list-guidelines.html
FAQ: http://subversion.tigris.org/faq.html
Docs: http://svnbook.red-bean.com/
Sator Laser GmbH, Fangdieckstraße 75a, 22547 Hamburg, Deutschland
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
**************************************************************************************
Sator Laser GmbH, Fangdieckstraße 75a, 22547 Hamburg, Deutschland
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
**************************************************************************************
           Visit our website at <http://www.satorlaser.de/>
**************************************************************************************
Diese E-Mail einschließlich sämtlicher Anhänge ist nur für den Adressaten bestimmt und kann vertrauliche Informationen enthalten. Bitte benachrichtigen Sie den Absender umgehend, falls Sie nicht der beabsichtigte Empfänger sein sollten. Die E-Mail ist in diesem Fall zu löschen und darf weder gelesen, weitergeleitet, veröffentlicht oder anderweitig benutzt werden.
E-Mails können durch Dritte gelesen werden und Viren sowie nichtautorisierte Änderungen enthalten. Sator Laser GmbH ist für diese Folgen nicht verantwortlich.
**************************************************************************************
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2415707
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-11-09 09:35:54 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.