From 93fd07caa5fe1b105ab36b0037be873450e3c4a8 Mon Sep 17 00:00:00 2001 From: vsnijders Date: Mon, 5 Mar 2007 16:16:17 +0000 Subject: [PATCH] added TLogEntry.DisplayDate git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@117 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/svn/svnclasses.pas | 12 ++++++++++-- components/svn/svncommand.pas | 2 ++ components/svn/test/testsvnclasses.pas | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/components/svn/svnclasses.pas b/components/svn/svnclasses.pas index eb78bb19c..5e42bde1b 100644 --- a/components/svn/svnclasses.pas +++ b/components/svn/svnclasses.pas @@ -146,6 +146,7 @@ type FMessage: string; FRevision: integer; function GetCommonPath: string; + function GetDisplayDate: string; function GetLogPath(index: integer): TLogPath; function GetLogPathCount: integer; procedure LoadFromNode(ANode: TDOMElement); @@ -157,6 +158,7 @@ type property Author: string read FAuthor write FAuthor; property CommonPath: string read GetCommonPath; property Date: string read FDate write FDate; + property DisplayDate: string read GetDisplayDate; property Message: string read FMessage write FMessage; property Path[index: integer] :TLogPath read GetLogPath; property PathCount: integer read GetLogPathCount; @@ -460,13 +462,19 @@ begin end; end; +function TLogEntry.GetDisplayDate: string; +begin + Result := Copy(FDate, 1, 10) + ' ' + Copy(FDate,12,8); +end; + function TLogEntry.GetFileList(const BaseDir: string = ''): TStrings; var i: integer; begin Result := TStringList.Create; 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; function TLogEntry.GetLogPathCount: integer; @@ -596,7 +604,7 @@ begin Lines := TStringList.Create; try Lines.LoadFromStream(s); - writeln(Lines.Text); + //writeln(Lines.Text); i := 0; while (i0 then + Raise Exception.Create('Svn ' + Command + ' failed.'); finally SvnProcess.Free; end; diff --git a/components/svn/test/testsvnclasses.pas b/components/svn/test/testsvnclasses.pas index dcc5e2de2..512d334f0 100644 --- a/components/svn/test/testsvnclasses.pas +++ b/components/svn/test/testsvnclasses.pas @@ -114,6 +114,8 @@ begin AssertEquals('Wrong log author', 'vincents', LogEntry.Author); AssertEquals('Wrong log 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', 'TAChart: added icon, added to make bigide', LogEntry.Message); finally