[cvsnt] CVSNT does not seem to return from a cvs chekout command shelled out from WHS script.

Brian J. Davis davisb at orbitec.com
Wed Mar 9 17:00:08 GMT 2005


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


I am using a WHS script to automate checkout (shown) and import (not shown) 
of a project.  When calling  cmdLineExec = WshShell.Exec( command ); where 
command can be a cvs call to cvs checkout ... CVSNT does not return.  It 
just seems to run indefinitely? When calling WshShell.Run( command, 2, true) 
it will return however.   This could very well be a Windows Host problem.  I 
am just letting you know of a potential problem.  I would have prefered to 
use Exec as I can get access to the stdio and stderr which I cannot get from 
Run.  I have found a work around so I am not too concerned.  I am letting 
you know that Windows Host may be putting CVSNT into an envrionment which 
may not have been thought of and thus for some reason or another is not 
allowing it to return.

If you want to try the script rename the below text to ToCVSNT.wsf and call 
it at the shell.  It is simple and benign.

CScript /D //Job:CVSCheckOut ToCVSNT.wsf

Brian

<package>
   <job id="CVSCheckOut">
      <?job debug="true"?>
      <script language="JScript">


      // This script (job) can be called by the follwing command which 
enables debugging.
      // CScript /D //Job:CVSCheckOut ToCVSNT.wsf


      WScript.Echo("Written By Brian J. Davis March 4, 2005\n");

      checkoutProject( "c:\\projects\\BProject", "BProject", 
"BProjectBeta1", ":pserver;hostname=venus;port=2401:D:\\OTCSoftwareRepo" );

      //================================================================================//
      function checkoutProject( projectDirectory, repositoryModule, 
revision, cvsRoot/*, logFile*/ )
      {
         var cmdLineExec;
         var cvsPath = "";

         var checkOutCMD = "co -d " + projectDirectory + " -r " + revision + 
" " + repositoryModule;

         // Get access to the shell object for access to the command line.
         var WshShell = WScript.CreateObject("WScript.Shell");

         // Build the command to delete the project from the tree.
         var removeTreeCMD = "rm -R " + projectDirectory;
         var cvsRootOption = "-d " + cvsRoot;

         var cvsCMD = "cvs " + cvsRootOption + " " + checkOutCMD;

         // Set the current direcotry to the cvs directory
         WshShell.CurrentDirectory = "C:\\Program Files\\GNU\\WinCvs 
1.3\\CVSNT";
         WScript.Echo( "The current direcotry is: " + 
WshShell.CurrentDirectory );


         var command = "";


         command = removeTreeCMD;
         WScript.Echo( "Executing: " + command );
         cmdLineExec = WshShell.Exec( command );

         while ( cmdLineExec.Status == 0 )
         {
            WScript.Sleep(10000);
            WScript.Echo( "Waiting for command " + command + " to 
complete." );
            WScript.Sleep(100);
         }

         // Here is where I have problems with cvsnt.

         command = cvsCMD; //+ " > " + logFile;
         WScript.Echo( "Executing: " + command );
         cmdLineExec = WshShell.Exec( command );
         while( cmdLineExec.Status == 0 )
         {
            WScript.Echo( "Executing: " + command );
         }
         // Use Run as using Exec and Status never returns as cvs does not 
return???
//         WshShell.Run( command, 2, true);

      }

      </script>
   </job>
   <job id="DoneInVBS">
      <?job debug="true"?>
      <script language="VBScript">
         WScript.Echo "This is VBScript"
  WScript.Echo "Who would ever use VB is beyond me!"
      </script>
   </job>
</package>









More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook