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

[TSVN] Tortoiseproc apparently must have a shell

From: Thomas Denk <thomas.denk_at_gmail.com>
Date: 2005-06-21 18:30:27 CEST

Hi,
not sure if this is an actual bug or a feature, maybe I am too stupid to
get things right, too, who knows.
A poor workman blames his tools, so well, I'll blame tortoise ;-)

I am currently working on a plugin for the code::blocks IDE to add svn
and (for Windows) tortoisesvn support.

The respective tool along with its command line is called via wxExec.
Output is redirected to PipedProcess and handled by the respective
"Runner" subclass. Sounds easy enough, and works fine with svn.
However, tortoiseproc does not like me, for some reason. When it is
called, it either does nothing at all (yes, I set the /notempfile
parameter), or worse.

The thing which made me wonder was that when I copy the output from the
debug console and paste it into a DOS window, everything runs as it was
intended.
So, in the end, I came to a workaround by passing "cmd /C " plus the
actual command to the wxExec() function.
Although this does work for now, this surely cannot be the way to do it?

Thank you for looking into it :-)

Thomas

---
For your reference, a few snips from my code:
// this runs fine
int  SVNRunner::Checkout(const wxString& repo, const wxString& dir,
const wxString& revision)
{
  return Run("checkout \"" + repo + "\" \"" + dir + "\" -r " + revision);
}
// this utterly fails
int TortoiseRunner::Branch(const wxString& path)
    {
    wxString cmd("/command:copy /notempfile /closeonend /path:\"");
    cmd << path << "\"";
    return Run(cmd);
    }
// both SVNRunner and TortoiseRunner implement the virtual Run()
function to make sure paramters are correct
// and to handle errors, prompt for passwords if svn wants one, etc...
and finally both call:
int ToolRunner::Run(wxString cmd)
{
  std_out = std_err = ""; std_out_array.Clear();
  count = 0;
  lastExitCode = 0;
  wxString runCommand(exec + " " + cmd);
  outputLog->AddLog(runCommand);
  process = new PipedProcess((void**)&process, this, ID_RUNNER);
  if (!wxExecute(runCommand, wxEXEC_ASYNC, process))
    {
      outputLog->AddLog("Error: Did not find the tool to launch ?");
      return -1;
    }
 runLock = true;
 while(runLock)    // this is not nice, but we want all operations finished
    ::wxYield();
  return lastExitCode;
}
The exec variable holds the contents of 
HKEY_LOCAL_MACHINE\SOFTWARE\TortoiseSVN\ProcPath, so
for example "C:\Program Files\TortoiseSVN\bin\tortoiseproc.exe".
If I set it to "cmd /C C:\Program
Files\TortoiseSVN\bin\tortoiseproc.exe" instead, then everything is fine.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Tue Jun 21 18:31:25 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.