svn component: more verbose exception if svn command fails.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@443 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
vsnijders
2008-04-28 09:37:16 +00:00
parent d8013165ac
commit df1408e52b

View File

@ -78,6 +78,13 @@ var
Result := true;
end;
end;
function GetOutput: string;
begin
SetLength(Result, Output.Size);
Output.Seek(0,soBeginning);
Output.Read(Result[1],Length(Result));
end;
begin
if SvnExecutable='' then InitializeSvnExecutable;
@ -92,8 +99,11 @@ begin
end;
ReadOutput;
Result := SvnProcess.ExitStatus;
if Result<>0 then
Raise Exception.Create('svn ' + Command + ' failed.');
if Result<>0 then begin
Raise Exception.CreateFmt(
'svn %s failed: Result %d' + LineEnding + '%s',
[Command, Result, GetOutput]);
end;
finally
SvnProcess.Free;
end;