added TLogEntry.DisplayDate

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@117 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
vsnijders
2007-03-05 16:16:17 +00:00
parent 280e661bef
commit 93fd07caa5
3 changed files with 14 additions and 2 deletions

View File

@ -146,6 +146,7 @@ type
FMessage: string; FMessage: string;
FRevision: integer; FRevision: integer;
function GetCommonPath: string; function GetCommonPath: string;
function GetDisplayDate: string;
function GetLogPath(index: integer): TLogPath; function GetLogPath(index: integer): TLogPath;
function GetLogPathCount: integer; function GetLogPathCount: integer;
procedure LoadFromNode(ANode: TDOMElement); procedure LoadFromNode(ANode: TDOMElement);
@ -157,6 +158,7 @@ type
property Author: string read FAuthor write FAuthor; property Author: string read FAuthor write FAuthor;
property CommonPath: string read GetCommonPath; property CommonPath: string read GetCommonPath;
property Date: string read FDate write FDate; property Date: string read FDate write FDate;
property DisplayDate: string read GetDisplayDate;
property Message: string read FMessage write FMessage; property Message: string read FMessage write FMessage;
property Path[index: integer] :TLogPath read GetLogPath; property Path[index: integer] :TLogPath read GetLogPath;
property PathCount: integer read GetLogPathCount; property PathCount: integer read GetLogPathCount;
@ -460,13 +462,19 @@ begin
end; end;
end; end;
function TLogEntry.GetDisplayDate: string;
begin
Result := Copy(FDate, 1, 10) + ' ' + Copy(FDate,12,8);
end;
function TLogEntry.GetFileList(const BaseDir: string = ''): TStrings; function TLogEntry.GetFileList(const BaseDir: string = ''): TStrings;
var var
i: integer; i: integer;
begin begin
Result := TStringList.Create; Result := TStringList.Create;
for i:= 0 to PathCount -1 do for i:= 0 to PathCount -1 do
Result.Add(BaseDir + Path[i].Path); if Path[i].Action in [caModify, caAdd] then
Result.Add(BaseDir + Path[i].Path);
end; end;
function TLogEntry.GetLogPathCount: integer; function TLogEntry.GetLogPathCount: integer;
@ -596,7 +604,7 @@ begin
Lines := TStringList.Create; Lines := TStringList.Create;
try try
Lines.LoadFromStream(s); Lines.LoadFromStream(s);
writeln(Lines.Text); //writeln(Lines.Text);
i := 0; i := 0;
while (i<Lines.Count) do begin while (i<Lines.Count) do begin
Line := Lines[i]; Line := Lines[i];

View File

@ -92,6 +92,8 @@ begin
end; end;
ReadOutput; ReadOutput;
Result := SvnProcess.ExitStatus; Result := SvnProcess.ExitStatus;
if Result<>0 then
Raise Exception.Create('Svn ' + Command + ' failed.');
finally finally
SvnProcess.Free; SvnProcess.Free;
end; end;

View File

@ -114,6 +114,8 @@ begin
AssertEquals('Wrong log author', 'vincents', LogEntry.Author); AssertEquals('Wrong log author', 'vincents', LogEntry.Author);
AssertEquals('Wrong log date', AssertEquals('Wrong log date',
'2007-02-20T10:57:42.928052Z', LogEntry.Date); '2007-02-20T10:57:42.928052Z', LogEntry.Date);
AssertEquals('Wrong log display date',
'2007-02-20 10:57:42', LogEntry.DisplayDate);
AssertEquals('Wrong log message', AssertEquals('Wrong log message',
'TAChart: added icon, added to make bigide', LogEntry.Message); 'TAChart: added icon, added to make bigide', LogEntry.Message);
finally finally