You've already forked lazarus-ccr
svnclasses: implemented reading svn log output
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@98 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -6,11 +6,23 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils,
|
Classes, SysUtils,
|
||||||
|
contnrs,
|
||||||
DOM, XMLRead;
|
DOM, XMLRead;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
TEntryKind = (ekUnknown, ekFile, ekDirectory);
|
TEntryKind = (ekUnknown, ekFile, ekDirectory);
|
||||||
|
TCommitAction = (caUnknown, caModify, caAdd, caDelete);
|
||||||
|
|
||||||
|
{ TSvnBase }
|
||||||
|
|
||||||
|
TSvnBase = class
|
||||||
|
private
|
||||||
|
procedure LoadFromXml(ADoc: TXMLDocument); virtual; abstract;
|
||||||
|
public
|
||||||
|
procedure LoadFromStream(s: TStream);
|
||||||
|
procedure LoadFromFile(FileName: string);
|
||||||
|
end;
|
||||||
|
|
||||||
{ TCommit }
|
{ TCommit }
|
||||||
|
|
||||||
@ -65,21 +77,114 @@ type
|
|||||||
|
|
||||||
{ TSvnInfo }
|
{ TSvnInfo }
|
||||||
|
|
||||||
TSvnInfo = class
|
TSvnInfo = class(TSvnBase)
|
||||||
private
|
private
|
||||||
FEntry: TEntry;
|
FEntry: TEntry;
|
||||||
procedure LoadFromXml(ADoc: TXMLDocument);
|
procedure LoadFromXml(ADoc: TXMLDocument); override;
|
||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
procedure LoadFromStream(s: TStream);
|
|
||||||
procedure LoadFromFile(FileName: string);
|
|
||||||
property Entry: TEntry read FEntry;
|
property Entry: TEntry read FEntry;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TLogPath }
|
||||||
|
|
||||||
|
TLogPath = class
|
||||||
|
private
|
||||||
|
FAction: TCommitAction;
|
||||||
|
FCopyFromPath: string;
|
||||||
|
FCopyFromRevision: integer;
|
||||||
|
FPath: string;
|
||||||
|
procedure LoadFromNode(ANode: TDomElement);
|
||||||
|
public
|
||||||
|
property Action : TCommitAction read FAction write FAction;
|
||||||
|
property CopyFromRevision: integer read FCopyFromRevision write FCopyFromRevision;
|
||||||
|
property CopyFromPath: string read FCopyFromPath write FCopyFromPath;
|
||||||
|
property Path: string read FPath write FPath;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TLogEntry }
|
||||||
|
|
||||||
|
TLogEntry = class
|
||||||
|
private
|
||||||
|
FAuthor: string;
|
||||||
|
FDate: string;
|
||||||
|
FLogPaths: TFPObjectList;
|
||||||
|
FMessage: string;
|
||||||
|
FRevision: integer;
|
||||||
|
function GetLogPath(index: integer): TLogPath;
|
||||||
|
function GetLogPathCount: integer;
|
||||||
|
procedure LoadFromNode(ANode: TDOMElement);
|
||||||
|
public
|
||||||
|
constructor Create;
|
||||||
|
destructor Destroy; override;
|
||||||
|
property Author: string read FAuthor write FAuthor;
|
||||||
|
property Date: string read FDate write FDate;
|
||||||
|
property Message: string read FMessage write FMessage;
|
||||||
|
property Path[index: integer] :TLogPath read GetLogPath;
|
||||||
|
property PathCount: integer read GetLogPathCount;
|
||||||
|
property Revision: integer read FRevision write FRevision;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TSvnLog }
|
||||||
|
|
||||||
|
TSvnLog = class(TSvnBase)
|
||||||
|
private
|
||||||
|
FLogEntries: TFPObjectList;
|
||||||
|
function GetLogEntry(index: integer): TLogEntry;
|
||||||
|
function GetLogEntryCount: integer;
|
||||||
|
procedure LoadFromXml(ADoc: TXMLDocument); override;
|
||||||
|
public
|
||||||
|
constructor Create;
|
||||||
|
destructor Destroy; override;
|
||||||
|
procedure Clear;
|
||||||
|
property LogEntry[index: integer] :TLogEntry read GetLogEntry;
|
||||||
|
property LogEntryCount: integer read GetLogEntryCount;
|
||||||
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
const
|
||||||
|
ActionStrings : array[TCommitAction] of char =
|
||||||
|
(' ','M','A','D');
|
||||||
|
|
||||||
|
function GetChildTextContent(ANode: TDomNode; const AName: string) : string;
|
||||||
|
var
|
||||||
|
ChildNode: TDOMNode;
|
||||||
|
begin
|
||||||
|
Result := '';
|
||||||
|
ChildNode := ANode.FindNode(AName);
|
||||||
|
if assigned(ChildNode) then
|
||||||
|
Result := ChildNode.TextContent;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TSvnBase }
|
||||||
|
|
||||||
|
procedure TSvnBase.LoadFromStream(s: TStream);
|
||||||
|
var
|
||||||
|
ADoc: TXMLDocument;
|
||||||
|
begin
|
||||||
|
ReadXMLFile(ADoc, s);
|
||||||
|
try
|
||||||
|
LoadFromXml(ADoc);
|
||||||
|
finally
|
||||||
|
ADoc.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSvnBase.LoadFromFile(FileName: string);
|
||||||
|
var
|
||||||
|
ADoc: TXMLDocument;
|
||||||
|
begin
|
||||||
|
ReadXMLFile(ADoc, FileName);
|
||||||
|
try
|
||||||
|
LoadFromXml(ADoc);
|
||||||
|
finally
|
||||||
|
ADoc.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TSvnInfo }
|
{ TSvnInfo }
|
||||||
|
|
||||||
procedure TSvnInfo.LoadFromXml(ADoc: TXMLDocument);
|
procedure TSvnInfo.LoadFromXml(ADoc: TXMLDocument);
|
||||||
@ -105,30 +210,6 @@ begin
|
|||||||
FEntry.Clear;
|
FEntry.Clear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSvnInfo.LoadFromStream(s: TStream);
|
|
||||||
var
|
|
||||||
ADoc: TXMLDocument;
|
|
||||||
begin
|
|
||||||
ReadXMLFile(ADoc, s);
|
|
||||||
try
|
|
||||||
LoadFromXml(ADoc);
|
|
||||||
finally
|
|
||||||
ADoc.Free;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TSvnInfo.LoadFromFile(FileName: string);
|
|
||||||
var
|
|
||||||
ADoc: TXMLDocument;
|
|
||||||
begin
|
|
||||||
ReadXMLFile(ADoc, FileName);
|
|
||||||
try
|
|
||||||
LoadFromXml(ADoc);
|
|
||||||
finally
|
|
||||||
ADoc.Free;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TEntry }
|
{ TEntry }
|
||||||
|
|
||||||
procedure TEntry.LoadFromNode(ANode: TDomNode);
|
procedure TEntry.LoadFromNode(ANode: TDomNode);
|
||||||
@ -186,21 +267,11 @@ end;
|
|||||||
{ TRepository }
|
{ TRepository }
|
||||||
|
|
||||||
procedure TRepository.LoadFromNode(ANode: TDomNode);
|
procedure TRepository.LoadFromNode(ANode: TDomNode);
|
||||||
var
|
|
||||||
RepositoryNode: TDomElement;
|
|
||||||
ChildNode: TDOMNode;
|
|
||||||
begin
|
begin
|
||||||
if ANode=nil then exit;
|
if ANode=nil then exit;
|
||||||
|
|
||||||
if ANode.NodeType = ELEMENT_NODE then begin
|
FRoot := GetChildTextContent(ANode, 'root');
|
||||||
RepositoryNode := TDomElement(ANode);
|
FUUID := GetChildTextContent(ANode, 'uuid');
|
||||||
ChildNode := RepositoryNode.FindNode('root');
|
|
||||||
if assigned(ChildNode) then
|
|
||||||
FRoot := ChildNode.TextContent;
|
|
||||||
ChildNode := RepositoryNode.FindNode('uuid');
|
|
||||||
if assigned(ChildNode) then
|
|
||||||
FUUID := ChildNode.TextContent;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TRepository.Clear;
|
procedure TRepository.Clear;
|
||||||
@ -212,21 +283,13 @@ end;
|
|||||||
{ TCommit }
|
{ TCommit }
|
||||||
|
|
||||||
procedure TCommit.LoadFromNode(ANode: TDomNode);
|
procedure TCommit.LoadFromNode(ANode: TDomNode);
|
||||||
var
|
|
||||||
CommitNode: TDomElement;
|
|
||||||
ChildNode: TDOMNode;
|
|
||||||
begin
|
begin
|
||||||
if ANode=nil then exit;
|
if ANode=nil then exit;
|
||||||
|
|
||||||
if ANode.NodeType = ELEMENT_NODE then begin
|
if ANode.NodeType = ELEMENT_NODE then begin
|
||||||
CommitNode := TDomElement(ANode);
|
FRevision := StrToIntDef(TDomElement(ANode).GetAttribute('revision'),0);
|
||||||
FRevision := StrToIntDef(CommitNode.GetAttribute('revision'),0);
|
FAuthor := GetChildTextContent(ANode, 'author');
|
||||||
ChildNode := CommitNode.FindNode('author');
|
FDate := GetChildTextContent(ANode, 'date');
|
||||||
if assigned(ChildNode) then
|
|
||||||
FAuthor := ChildNode.TextContent;
|
|
||||||
ChildNode := CommitNode.FindNode('date');
|
|
||||||
if assigned(ChildNode) then
|
|
||||||
FDate := ChildNode.TextContent;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -237,5 +300,124 @@ begin
|
|||||||
FRevision := 0;
|
FRevision := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TSvnLog }
|
||||||
|
|
||||||
|
function TSvnLog.GetLogEntry(index: integer): TLogEntry;
|
||||||
|
begin
|
||||||
|
Result := TLogEntry(FLogEntries[index]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TSvnLog.GetLogEntryCount: integer;
|
||||||
|
begin
|
||||||
|
Result := FLogEntries.Count;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSvnLog.LoadFromXml(ADoc: TXMLDocument);
|
||||||
|
var
|
||||||
|
LogEntryElement: TDomNode;
|
||||||
|
NewLogEntry: TLogEntry;
|
||||||
|
begin
|
||||||
|
Clear;
|
||||||
|
|
||||||
|
LogEntryElement := ADoc.FindNode('log').FirstChild;
|
||||||
|
while assigned(LogEntryElement) do begin
|
||||||
|
if (LogEntryElement.NodeType=ELEMENT_NODE)
|
||||||
|
and (LogEntryElement.NodeName='logentry') then
|
||||||
|
begin
|
||||||
|
NewLogEntry := TLogEntry.Create;
|
||||||
|
NewLogEntry.LoadFromNode(TDomElement(LogEntryElement));
|
||||||
|
FLogEntries.Add(NewLogEntry);
|
||||||
|
end;
|
||||||
|
LogEntryElement := LogEntryElement.NextSibling;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TSvnLog.Create;
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
FLogEntries := TFPObjectList.Create(true);
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TSvnLog.Destroy;
|
||||||
|
begin
|
||||||
|
FLogEntries.Free;
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSvnLog.Clear;
|
||||||
|
begin
|
||||||
|
FLogEntries.Clear;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TLogEntry }
|
||||||
|
|
||||||
|
function TLogEntry.GetLogPath(index: integer): TLogPath;
|
||||||
|
begin
|
||||||
|
Result := TLogPath(FLogPaths[index]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TLogEntry.GetLogPathCount: integer;
|
||||||
|
begin
|
||||||
|
Result := FLogPaths.Count;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TLogEntry.LoadFromNode(ANode: TDOMElement);
|
||||||
|
var
|
||||||
|
PathsELement: TDomNode;
|
||||||
|
PathElement: TDomNode;
|
||||||
|
NewLogPath: TLogPath;
|
||||||
|
begin
|
||||||
|
FRevision := StrToIntDef(ANode.GetAttribute('revision'),0);
|
||||||
|
FAuthor := GetChildTextContent(ANode, 'author');
|
||||||
|
FDate := GetChildTextContent(ANode, 'date');
|
||||||
|
FMessage := GetChildTextContent(ANode, 'msg');
|
||||||
|
|
||||||
|
PathsElement := ANode.FindNode('paths');
|
||||||
|
if assigned(PathsELement) then begin
|
||||||
|
PathElement := PathsELement.FirstChild;
|
||||||
|
while assigned(PathElement) do begin
|
||||||
|
if (PathElement.NodeType=ELEMENT_NODE)
|
||||||
|
and (PathElement.NodeName='path') then
|
||||||
|
begin
|
||||||
|
NewLogPath := TLogPath.Create;
|
||||||
|
NewLogPath.LoadFromNode(TDomElement(PathElement));
|
||||||
|
FLogPaths.Add(NewLogPath);
|
||||||
|
end;
|
||||||
|
PathElement := PathElement.NextSibling;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TLogEntry.Create;
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
FLogPaths := TFPObjectList.Create(true);
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TLogEntry.Destroy;
|
||||||
|
begin
|
||||||
|
FLogPaths.Free;
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TLogPath }
|
||||||
|
|
||||||
|
procedure TLogPath.LoadFromNode(ANode: TDomElement);
|
||||||
|
var
|
||||||
|
ActionStr: string;
|
||||||
|
i: TCommitAction;
|
||||||
|
begin
|
||||||
|
FPath := ANode.TextContent;
|
||||||
|
FCopyFromRevision := StrToIntDef(ANode.GetAttribute('copyfrom-rev'),0);
|
||||||
|
FCopyFromPath := ANode.GetAttribute('copyfrom-path');
|
||||||
|
ActionStr := ANode.GetAttribute('action');
|
||||||
|
FAction := caUnknown;
|
||||||
|
for i := low(TCommitAction) to high(TCommitAction) do
|
||||||
|
if ActionStrings[i]=ActionStr then begin
|
||||||
|
FAction := i;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<Version Value="5"/>
|
<Version Value="5"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<SearchPaths>
|
<SearchPaths>
|
||||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)\"/>
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
</SearchPaths>
|
</SearchPaths>
|
||||||
<CodeGeneration>
|
<CodeGeneration>
|
||||||
<Generate Value="Faster"/>
|
<Generate Value="Faster"/>
|
||||||
@ -22,7 +22,6 @@
|
|||||||
<UnitName Value="svnclasses"/>
|
<UnitName Value="svnclasses"/>
|
||||||
</Item1>
|
</Item1>
|
||||||
</Files>
|
</Files>
|
||||||
<Type Value="RunAndDesignTime"/>
|
|
||||||
<RequiredPkgs Count="1">
|
<RequiredPkgs Count="1">
|
||||||
<Item1>
|
<Item1>
|
||||||
<PackageName Value="FCL"/>
|
<PackageName Value="FCL"/>
|
||||||
@ -30,7 +29,7 @@
|
|||||||
</Item1>
|
</Item1>
|
||||||
</RequiredPkgs>
|
</RequiredPkgs>
|
||||||
<UsageOptions>
|
<UsageOptions>
|
||||||
<UnitPath Value="$(PkgOutDir)"/>
|
<UnitPath Value="$(PkgOutDir)\"/>
|
||||||
</UsageOptions>
|
</UsageOptions>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
|
@ -7,14 +7,8 @@ unit svnpkg;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
svnclasses, LazarusPackageIntf;
|
svnclasses;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
procedure Register;
|
|
||||||
begin
|
|
||||||
end;
|
|
||||||
|
|
||||||
initialization
|
|
||||||
RegisterPackage('svnpkg', @Register);
|
|
||||||
end.
|
end.
|
||||||
|
@ -4,14 +4,13 @@
|
|||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<Version Value="5"/>
|
<Version Value="5"/>
|
||||||
<General>
|
<General>
|
||||||
|
<SessionStorage Value="InProjectDir"/>
|
||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
<TargetFileExt Value=".exe"/>
|
<TargetFileExt Value=".exe"/>
|
||||||
<ActiveEditorIndexAtStart Value="0"/>
|
|
||||||
</General>
|
</General>
|
||||||
<VersionInfo>
|
<VersionInfo>
|
||||||
<ProjectVersion Value=""/>
|
<ProjectVersion Value=""/>
|
||||||
<Language Value=""/>
|
|
||||||
<CharSet Value=""/>
|
|
||||||
</VersionInfo>
|
</VersionInfo>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
@ -30,238 +29,27 @@
|
|||||||
<PackageName Value="svnpkg"/>
|
<PackageName Value="svnpkg"/>
|
||||||
</Item1>
|
</Item1>
|
||||||
<Item2>
|
<Item2>
|
||||||
<PackageName Value="FPCUnitTestRunner"/>
|
<PackageName Value="LCL"/>
|
||||||
</Item2>
|
</Item2>
|
||||||
<Item3>
|
<Item3>
|
||||||
<PackageName Value="LCL"/>
|
<PackageName Value="FPCUnitTestRunner"/>
|
||||||
</Item3>
|
</Item3>
|
||||||
<Item4>
|
<Item4>
|
||||||
<PackageName Value="FCL"/>
|
<PackageName Value="FCL"/>
|
||||||
</Item4>
|
</Item4>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="12">
|
<Units Count="2">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="fpcunitsvnpkg.lpr"/>
|
<Filename Value="fpcunitsvnpkg.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="fpcunitsvnpkg"/>
|
<UnitName Value="fpcunitsvnpkg"/>
|
||||||
<UsageCount Value="20"/>
|
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="testsvnclasses.pas"/>
|
<Filename Value="testsvnclasses.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="TestSvnClasses"/>
|
<UnitName Value="TestSvnClasses"/>
|
||||||
<CursorPos X="63" Y="60"/>
|
|
||||||
<TopLine Value="28"/>
|
|
||||||
<EditorIndex Value="0"/>
|
|
||||||
<UsageCount Value="20"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
|
||||||
<Filename Value="..\..\..\..\lazarus\components\fpcunit\guitestrunner.pas"/>
|
|
||||||
<UnitName Value="GuiTestRunner"/>
|
|
||||||
<CursorPos X="1" Y="48"/>
|
|
||||||
<TopLine Value="37"/>
|
|
||||||
<EditorIndex Value="1"/>
|
|
||||||
<UsageCount Value="10"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit2>
|
|
||||||
<Unit3>
|
|
||||||
<Filename Value="..\..\..\..\fpc\2.1\fcl\inc\fpcunit.pp"/>
|
|
||||||
<UnitName Value="fpcunit"/>
|
|
||||||
<CursorPos X="1" Y="446"/>
|
|
||||||
<TopLine Value="427"/>
|
|
||||||
<EditorIndex Value="9"/>
|
|
||||||
<UsageCount Value="10"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit3>
|
|
||||||
<Unit4>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<UnitName Value="svnclasses"/>
|
|
||||||
<CursorPos X="72" Y="201"/>
|
|
||||||
<TopLine Value="190"/>
|
|
||||||
<EditorIndex Value="2"/>
|
|
||||||
<UsageCount Value="10"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit4>
|
|
||||||
<Unit5>
|
|
||||||
<Filename Value="info.xml"/>
|
|
||||||
<CursorPos X="78" Y="9"/>
|
|
||||||
<TopLine Value="1"/>
|
|
||||||
<EditorIndex Value="3"/>
|
|
||||||
<UsageCount Value="10"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
<SyntaxHighlighter Value="XML"/>
|
|
||||||
</Unit5>
|
|
||||||
<Unit6>
|
|
||||||
<Filename Value="..\..\..\..\fpc\2.1\fcl\xml\dom.pp"/>
|
|
||||||
<UnitName Value="DOM"/>
|
|
||||||
<CursorPos X="3" Y="1168"/>
|
|
||||||
<TopLine Value="1165"/>
|
|
||||||
<EditorIndex Value="4"/>
|
|
||||||
<UsageCount Value="10"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit6>
|
|
||||||
<Unit7>
|
|
||||||
<Filename Value="..\..\..\..\fpcbuild\2.0.4\fpcsrc\packages\extra\gtk2\gtk+\gtk\gtksocket.inc"/>
|
|
||||||
<CursorPos X="74" Y="77"/>
|
|
||||||
<TopLine Value="58"/>
|
|
||||||
<EditorIndex Value="5"/>
|
|
||||||
<UsageCount Value="10"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit7>
|
|
||||||
<Unit8>
|
|
||||||
<Filename Value="..\..\..\..\lazarus\lcl\interfaces\gtk2\gtk2extrah.inc"/>
|
|
||||||
<CursorPos X="47" Y="44"/>
|
|
||||||
<TopLine Value="25"/>
|
|
||||||
<EditorIndex Value="6"/>
|
|
||||||
<UsageCount Value="10"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit8>
|
|
||||||
<Unit9>
|
|
||||||
<Filename Value="..\..\..\..\fpcbuild\2.0.4\fpcsrc\packages\extra\gtk2\gtk+\gdk\gdkdrawable.inc"/>
|
|
||||||
<CursorPos X="94" Y="12"/>
|
|
||||||
<TopLine Value="1"/>
|
|
||||||
<EditorIndex Value="7"/>
|
|
||||||
<UsageCount Value="10"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit9>
|
|
||||||
<Unit10>
|
|
||||||
<Filename Value="..\..\..\..\lazarus\lcl\interfaces\win32\win32winapi.inc"/>
|
|
||||||
<CursorPos X="33" Y="3164"/>
|
|
||||||
<TopLine Value="3145"/>
|
|
||||||
<EditorIndex Value="8"/>
|
|
||||||
<UsageCount Value="10"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit10>
|
|
||||||
<Unit11>
|
|
||||||
<Filename Value="..\..\..\..\fpc\2.1\rtl\win\wininc\ascdef.inc"/>
|
|
||||||
<CursorPos X="10" Y="268"/>
|
|
||||||
<TopLine Value="249"/>
|
|
||||||
<UsageCount Value="10"/>
|
|
||||||
</Unit11>
|
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="30" HistoryIndex="29">
|
|
||||||
<Position1>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="130" Column="13" TopLine="111"/>
|
|
||||||
</Position1>
|
|
||||||
<Position2>
|
|
||||||
<Filename Value="..\..\..\..\fpc\2.1\fcl\xml\dom.pp"/>
|
|
||||||
<Caret Line="217" Column="40" TopLine="198"/>
|
|
||||||
</Position2>
|
|
||||||
<Position3>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="134" Column="30" TopLine="111"/>
|
|
||||||
</Position3>
|
|
||||||
<Position4>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="131" Column="48" TopLine="112"/>
|
|
||||||
</Position4>
|
|
||||||
<Position5>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="130" Column="1" TopLine="112"/>
|
|
||||||
</Position5>
|
|
||||||
<Position6>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="83" Column="46" TopLine="72"/>
|
|
||||||
</Position6>
|
|
||||||
<Position7>
|
|
||||||
<Filename Value="..\..\..\..\fpcbuild\2.0.4\fpcsrc\packages\extra\gtk2\gtk+\gtk\gtksocket.inc"/>
|
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
|
||||||
</Position7>
|
|
||||||
<Position8>
|
|
||||||
<Filename Value="..\..\..\..\lazarus\lcl\interfaces\gtk2\gtk2extrah.inc"/>
|
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
|
||||||
</Position8>
|
|
||||||
<Position9>
|
|
||||||
<Filename Value="..\..\..\..\fpcbuild\2.0.4\fpcsrc\packages\extra\gtk2\gtk+\gdk\gdkdrawable.inc"/>
|
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
|
||||||
</Position9>
|
|
||||||
<Position10>
|
|
||||||
<Filename Value="..\..\..\..\lazarus\lcl\interfaces\win32\win32winapi.inc"/>
|
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
|
||||||
</Position10>
|
|
||||||
<Position11>
|
|
||||||
<Filename Value="..\..\..\..\lazarus\lcl\interfaces\win32\win32winapi.inc"/>
|
|
||||||
<Caret Line="3164" Column="33" TopLine="3145"/>
|
|
||||||
</Position11>
|
|
||||||
<Position12>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="89" Column="8" TopLine="72"/>
|
|
||||||
</Position12>
|
|
||||||
<Position13>
|
|
||||||
<Filename Value="..\..\..\..\lazarus\components\fpcunit\guitestrunner.pas"/>
|
|
||||||
<Caret Line="45" Column="36" TopLine="26"/>
|
|
||||||
</Position13>
|
|
||||||
<Position14>
|
|
||||||
<Filename Value="..\..\..\..\lazarus\components\fpcunit\guitestrunner.pas"/>
|
|
||||||
<Caret Line="47" Column="63" TopLine="28"/>
|
|
||||||
</Position14>
|
|
||||||
<Position15>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="55" Column="22" TopLine="36"/>
|
|
||||||
</Position15>
|
|
||||||
<Position16>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="103" Column="5" TopLine="60"/>
|
|
||||||
</Position16>
|
|
||||||
<Position17>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="33" Column="3" TopLine="31"/>
|
|
||||||
</Position17>
|
|
||||||
<Position18>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="17" Column="3" TopLine="15"/>
|
|
||||||
</Position18>
|
|
||||||
<Position19>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="185" Column="17" TopLine="25"/>
|
|
||||||
</Position19>
|
|
||||||
<Position20>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="174" Column="5" TopLine="131"/>
|
|
||||||
</Position20>
|
|
||||||
<Position21>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="182" Column="29" TopLine="156"/>
|
|
||||||
</Position21>
|
|
||||||
<Position22>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="60" Column="21" TopLine="36"/>
|
|
||||||
</Position22>
|
|
||||||
<Position23>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="173" Column="11" TopLine="154"/>
|
|
||||||
</Position23>
|
|
||||||
<Position24>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="188" Column="1" TopLine="145"/>
|
|
||||||
</Position24>
|
|
||||||
<Position25>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="194" Column="5" TopLine="162"/>
|
|
||||||
</Position25>
|
|
||||||
<Position26>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="33" Column="7" TopLine="14"/>
|
|
||||||
</Position26>
|
|
||||||
<Position27>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="38" Column="15" TopLine="33"/>
|
|
||||||
</Position27>
|
|
||||||
<Position28>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="187" Column="23" TopLine="170"/>
|
|
||||||
</Position28>
|
|
||||||
<Position29>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="218" Column="1" TopLine="175"/>
|
|
||||||
</Position29>
|
|
||||||
<Position30>
|
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
|
||||||
<Caret Line="216" Column="10" TopLine="192"/>
|
|
||||||
</Position30>
|
|
||||||
</JumpHistory>
|
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="5"/>
|
<Version Value="5"/>
|
||||||
@ -269,21 +57,13 @@
|
|||||||
<CodeGeneration>
|
<CodeGeneration>
|
||||||
<Generate Value="Faster"/>
|
<Generate Value="Faster"/>
|
||||||
</CodeGeneration>
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
<Other>
|
<Other>
|
||||||
<CompilerPath Value="$(CompPath)"/>
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
</Other>
|
</Other>
|
||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
<Debugging>
|
|
||||||
<Exceptions Count="3">
|
|
||||||
<Item1>
|
|
||||||
<Name Value="ECodetoolError"/>
|
|
||||||
</Item1>
|
|
||||||
<Item2>
|
|
||||||
<Name Value="EFOpenError"/>
|
|
||||||
</Item2>
|
|
||||||
<Item3>
|
|
||||||
<Name Value="EAssertionFailedError"/>
|
|
||||||
</Item3>
|
|
||||||
</Exceptions>
|
|
||||||
</Debugging>
|
|
||||||
</CONFIG>
|
</CONFIG>
|
||||||
|
67
components/svn/test/log.xml
Normal file
67
components/svn/test/log.xml
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<log>
|
||||||
|
<logentry revision="10660">
|
||||||
|
<author>vincents</author>
|
||||||
|
<date>2007-02-20T10:57:42.928052Z</date>
|
||||||
|
<paths>
|
||||||
|
<path action="M">/trunk/ide/Makefile</path>
|
||||||
|
<path action="A">/trunk/components/tachart/Makefile.fpc</path>
|
||||||
|
<path action="A">/trunk/components/tachart/tagraph.lrs</path>
|
||||||
|
<path action="M">/trunk/ide/lazarus.pp</path>
|
||||||
|
<path action="M">/trunk/components/Makefile</path>
|
||||||
|
<path action="M">/trunk/components/tachart/TAGraph.pas</path>
|
||||||
|
<path action="M">/trunk/ide/Makefile.fpc</path>
|
||||||
|
<path action="A">/trunk/components/tachart/Makefile</path>
|
||||||
|
<path action="M">/trunk/components/Makefile.fpc</path>
|
||||||
|
<path action="M">/trunk/components/tachart/tachartlazaruspkg.lpk</path>
|
||||||
|
<path action="M">/trunk/docs/xml/lcl/lclintf.xml</path>
|
||||||
|
</paths>
|
||||||
|
<msg>TAChart: added icon, added to make bigide</msg>
|
||||||
|
</logentry>
|
||||||
|
<logentry revision="10661">
|
||||||
|
<author>vincents</author>
|
||||||
|
<date>2007-02-20T11:24:55.592011Z</date>
|
||||||
|
<paths>
|
||||||
|
<path copyfrom-path="/trunk/components/tachart/TAGraph.pas" copyfrom-rev="10660" action="A">/trunk/components/tagraph.pas</path>
|
||||||
|
<path action="D">/trunk/components/tachart/TAGraph.pas</path>
|
||||||
|
</paths>
|
||||||
|
<msg>lowercase</msg>
|
||||||
|
</logentry>
|
||||||
|
<logentry revision="10662">
|
||||||
|
<author>vincents</author>
|
||||||
|
<date>2007-02-20T11:26:46.869961Z</date>
|
||||||
|
<paths>
|
||||||
|
<path action="D">/trunk/components/tagraph.pas</path>
|
||||||
|
<path copyfrom-path="/trunk/components/tagraph.pas" copyfrom-rev="10661" action="A">/trunk/components/tachart/tagraph.pas</path>
|
||||||
|
</paths>
|
||||||
|
<msg>tachart: fixed wrong move</msg>
|
||||||
|
</logentry>
|
||||||
|
<logentry revision="10663">
|
||||||
|
<author>vincents</author>
|
||||||
|
<date>2007-02-20T11:31:09.651670Z</date>
|
||||||
|
<paths>
|
||||||
|
<path action="D">/trunk/components/tachart/TAEngine.pas</path>
|
||||||
|
<path copyfrom-path="/trunk/components/tachart/TAEngine.pas" copyfrom-rev="10662" action="A">/trunk/components/tachart/taengine.pas</path>
|
||||||
|
<path action="M">/trunk/components/tachart/tachartlazaruspkg.lpk</path>
|
||||||
|
<path action="D">/trunk/components/tachart/TASeries.pas</path>
|
||||||
|
<path copyfrom-path="/trunk/components/tachart/TASeries.pas" copyfrom-rev="10662" action="A">/trunk/components/tachart/taseries.pas</path>
|
||||||
|
</paths>
|
||||||
|
<msg>tachart: user lowercase unit filenames</msg>
|
||||||
|
</logentry>
|
||||||
|
<logentry revision="10664">
|
||||||
|
<author>vincents</author>
|
||||||
|
<date>2007-02-20T21:57:51.761388Z</date>
|
||||||
|
<paths>
|
||||||
|
<path action="M">/trunk/lcl/interfaces/win32/win32callback.inc</path>
|
||||||
|
</paths>
|
||||||
|
<msg>win32 interface: fix showing contextmenu for listviews (bug 8331)</msg>
|
||||||
|
</logentry>
|
||||||
|
<logentry revision="10665">
|
||||||
|
<author>vincents</author>
|
||||||
|
<date>2007-02-20T23:18:34.679005Z</date>
|
||||||
|
<paths>
|
||||||
|
<path action="M">/trunk/lcl/interfaces/win32/win32winapi.inc</path>
|
||||||
|
</paths>
|
||||||
|
<msg>win32 interface: made LCLIntf.Rectangle and TCanvas.Rectangle compatible with Windows.Rectangle winapi function (bug 8342)</msg>
|
||||||
|
</logentry>
|
||||||
|
</log>
|
@ -5,7 +5,7 @@ unit TestSvnClasses;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, fpcunit, testutils, testregistry,
|
Classes, SysUtils, fpcunit, testregistry,
|
||||||
svnclasses;
|
svnclasses;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -15,10 +15,15 @@ type
|
|||||||
TTestSvnClasses= class(TTestCase)
|
TTestSvnClasses= class(TTestCase)
|
||||||
private
|
private
|
||||||
function GetInfoFileName: string;
|
function GetInfoFileName: string;
|
||||||
|
function GetLogFileName: string;
|
||||||
published
|
published
|
||||||
procedure TestHookUp;
|
procedure TestHookUp;
|
||||||
procedure TestLoadInfo;
|
procedure TestLoadInfo;
|
||||||
end;
|
procedure TestLoadLog;
|
||||||
|
procedure TestLoadSimpleLogPaths;
|
||||||
|
procedure TestLoadComplexLogPaths;
|
||||||
|
procedure TestLoadLogTwice;
|
||||||
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -27,12 +32,19 @@ begin
|
|||||||
Result := ExtractFilePath(ParamStr(0)) + 'info.xml';
|
Result := ExtractFilePath(ParamStr(0)) + 'info.xml';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTestSvnClasses.TestHookUp;
|
function TTestSvnClasses.GetLogFileName: string;
|
||||||
var
|
|
||||||
InfoFileName: string;
|
|
||||||
begin
|
begin
|
||||||
InfoFileName := GetInfoFileName;
|
Result := ExtractFilePath(ParamStr(0)) + 'log.xml';
|
||||||
AssertTrue(InfoFileName + ' does not exist', FileExists(InfoFileName));
|
end;
|
||||||
|
|
||||||
|
procedure TTestSvnClasses.TestHookUp;
|
||||||
|
procedure CheckFile(const FileName: string);
|
||||||
|
begin
|
||||||
|
AssertTrue(FileName + ' does not exist', FileExists(FileName));
|
||||||
|
end;
|
||||||
|
begin
|
||||||
|
CheckFile(GetInfoFileName);
|
||||||
|
CheckFile(GetLogFileName);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTestSvnClasses.TestLoadInfo;
|
procedure TTestSvnClasses.TestLoadInfo;
|
||||||
@ -63,6 +75,95 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTestSvnClasses.TestLoadLog;
|
||||||
|
var
|
||||||
|
SvnLog: TSvnLog;
|
||||||
|
LogEntry: TLogEntry;
|
||||||
|
begin
|
||||||
|
SvnLog := TSvnLog.Create;
|
||||||
|
try
|
||||||
|
SvnLog.LoadFromFile(GetLogFileName);
|
||||||
|
AssertEquals('Wrong number of log entries', 6, SvnLog.LogEntryCount);
|
||||||
|
LogEntry := SvnLog.LogEntry[0];
|
||||||
|
AssertEquals('Wrong log revision', 10660, LogEntry.Revision);
|
||||||
|
AssertEquals('Wrong log author', 'vincents', LogEntry.Author);
|
||||||
|
AssertEquals('Wrong log date',
|
||||||
|
'2007-02-20T10:57:42.928052Z', LogEntry.Date);
|
||||||
|
AssertEquals('Wrong log message',
|
||||||
|
'TAChart: added icon, added to make bigide', LogEntry.Message);
|
||||||
|
finally
|
||||||
|
SvnLog.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TTestSvnClasses.TestLoadSimpleLogPaths;
|
||||||
|
var
|
||||||
|
SvnLog: TSvnLog;
|
||||||
|
LogEntry: TLogEntry;
|
||||||
|
LogPath: TLogPath;
|
||||||
|
begin
|
||||||
|
SvnLog := TSvnLog.Create;
|
||||||
|
try
|
||||||
|
SvnLog.LoadFromFile(GetLogFileName);
|
||||||
|
AssertEquals('Wrong number of log entries', 6, SvnLog.LogEntryCount);
|
||||||
|
LogEntry := SvnLog.LogEntry[4];
|
||||||
|
AssertEquals('Wrong log revision', 10664, LogEntry.Revision);
|
||||||
|
AssertEquals('Wrong number of paths', 1, LogEntry.PathCount);
|
||||||
|
LogPath := LogEntry.Path[0];
|
||||||
|
AssertEquals('Wrong path',
|
||||||
|
'/trunk/lcl/interfaces/win32/win32callback.inc', LogPath.Path);
|
||||||
|
AssertEquals('Wrong commit action', ord(caModify), ord(LogPath.Action));
|
||||||
|
finally
|
||||||
|
SvnLog.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TTestSvnClasses.TestLoadComplexLogPaths;
|
||||||
|
var
|
||||||
|
SvnLog: TSvnLog;
|
||||||
|
LogEntry: TLogEntry;
|
||||||
|
|
||||||
|
procedure AssertLogPath(i: integer; action: TCommitAction;
|
||||||
|
const path, copyfrompath: string; copyfromrev: integer);
|
||||||
|
var
|
||||||
|
LogPath: TLogPath;
|
||||||
|
begin
|
||||||
|
LogPath := LogEntry.Path[i];
|
||||||
|
AssertEquals('Wrong commit action', ord(action), ord(LogPath.Action));
|
||||||
|
AssertEquals('Wrong path', path, LogPath.Path);
|
||||||
|
AssertEquals('Wrong copy from revision', copyfromrev, LogPath.CopyFromRevision);
|
||||||
|
AssertEquals('Wrong copy from path', copyfrompath, LogPath.CopyFromPath);
|
||||||
|
end;
|
||||||
|
begin
|
||||||
|
SvnLog := TSvnLog.Create;
|
||||||
|
try
|
||||||
|
SvnLog.LoadFromFile(GetLogFileName);
|
||||||
|
AssertEquals('Wrong number of log entries', 6, SvnLog.LogEntryCount);
|
||||||
|
LogEntry := SvnLog.LogEntry[3];
|
||||||
|
AssertEquals('Wrong log revision', 10663, LogEntry.Revision);
|
||||||
|
AssertEquals('Wrong number of paths', 5, LogEntry.PathCount);
|
||||||
|
AssertLogPath(0, caDelete, '/trunk/components/tachart/TAEngine.pas', '', 0);
|
||||||
|
AssertLogPath(1, caAdd, '/trunk/components/tachart/taengine.pas',
|
||||||
|
'/trunk/components/tachart/TAEngine.pas', 10662);
|
||||||
|
finally
|
||||||
|
SvnLog.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TTestSvnClasses.TestLoadLogTwice;
|
||||||
|
var
|
||||||
|
SvnLog: TSvnLog;
|
||||||
|
begin
|
||||||
|
SvnLog := TSvnLog.Create;
|
||||||
|
try
|
||||||
|
SvnLog.LoadFromFile(GetLogFileName);
|
||||||
|
SvnLog.LoadFromFile(GetLogFileName);
|
||||||
|
AssertEquals('Wrong number of log entries', 6, SvnLog.LogEntryCount);
|
||||||
|
finally
|
||||||
|
SvnLog.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
|
||||||
RegisterTest(TTestSvnClasses);
|
RegisterTest(TTestSvnClasses);
|
||||||
|
Reference in New Issue
Block a user