You've already forked lazarus-ccr
finished parsing svn info xml
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@89 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -19,6 +19,7 @@ type
|
|||||||
FAuthor: string;
|
FAuthor: string;
|
||||||
FDate: string;
|
FDate: string;
|
||||||
FRevision: integer;
|
FRevision: integer;
|
||||||
|
procedure LoadFromNode(ANode: TDomNode);
|
||||||
public
|
public
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
property Author: string read FAuthor write FAuthor;
|
property Author: string read FAuthor write FAuthor;
|
||||||
@ -30,11 +31,12 @@ type
|
|||||||
|
|
||||||
TRepository = class
|
TRepository = class
|
||||||
private
|
private
|
||||||
FUrl: string;
|
FRoot: string;
|
||||||
FUUID: string;
|
FUUID: string;
|
||||||
|
procedure LoadFromNode(ANode: TDomNode);
|
||||||
public
|
public
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
property URL: string read FUrl write FUrl;
|
property Root: string read FRoot write FRoot;
|
||||||
property UUID: string read FUUID write FUUID;
|
property UUID: string read FUUID write FUUID;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -151,6 +153,9 @@ begin
|
|||||||
UrlNode := EntryNode.FindNode('url');
|
UrlNode := EntryNode.FindNode('url');
|
||||||
if assigned(UrlNode) then
|
if assigned(UrlNode) then
|
||||||
FUrl := UrlNode.TextContent;
|
FUrl := UrlNode.TextContent;
|
||||||
|
|
||||||
|
FRepository.LoadFromNode(EntryNode.FindNode('repository'));
|
||||||
|
FCommit.LoadFromNode(EntryNode.FindNode('commit'));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -180,14 +185,51 @@ end;
|
|||||||
|
|
||||||
{ TRepository }
|
{ TRepository }
|
||||||
|
|
||||||
|
procedure TRepository.LoadFromNode(ANode: TDomNode);
|
||||||
|
var
|
||||||
|
RepositoryNode: TDomElement;
|
||||||
|
ChildNode: TDOMNode;
|
||||||
|
begin
|
||||||
|
if ANode=nil then exit;
|
||||||
|
|
||||||
|
if ANode.NodeType = ELEMENT_NODE then begin
|
||||||
|
RepositoryNode := TDomElement(ANode);
|
||||||
|
ChildNode := RepositoryNode.FindNode('root');
|
||||||
|
if assigned(ChildNode) then
|
||||||
|
FRoot := ChildNode.TextContent;
|
||||||
|
ChildNode := RepositoryNode.FindNode('uuid');
|
||||||
|
if assigned(ChildNode) then
|
||||||
|
FUUID := ChildNode.TextContent;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TRepository.Clear;
|
procedure TRepository.Clear;
|
||||||
begin
|
begin
|
||||||
FUrl := '';
|
FRoot := '';
|
||||||
FUUID := '';
|
FUUID := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCommit }
|
{ TCommit }
|
||||||
|
|
||||||
|
procedure TCommit.LoadFromNode(ANode: TDomNode);
|
||||||
|
var
|
||||||
|
CommitNode: TDomElement;
|
||||||
|
ChildNode: TDOMNode;
|
||||||
|
begin
|
||||||
|
if ANode=nil then exit;
|
||||||
|
|
||||||
|
if ANode.NodeType = ELEMENT_NODE then begin
|
||||||
|
CommitNode := TDomElement(ANode);
|
||||||
|
FRevision := StrToIntDef(CommitNode.GetAttribute('revision'),0);
|
||||||
|
ChildNode := CommitNode.FindNode('author');
|
||||||
|
if assigned(ChildNode) then
|
||||||
|
FAuthor := ChildNode.TextContent;
|
||||||
|
ChildNode := CommitNode.FindNode('date');
|
||||||
|
if assigned(ChildNode) then
|
||||||
|
FDate := ChildNode.TextContent;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCommit.Clear;
|
procedure TCommit.Clear;
|
||||||
begin
|
begin
|
||||||
FAuthor := '';
|
FAuthor := '';
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<General>
|
<General>
|
||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
<TargetFileExt Value=".exe"/>
|
<TargetFileExt Value=".exe"/>
|
||||||
<ActiveEditorIndexAtStart Value="2"/>
|
<ActiveEditorIndexAtStart Value="0"/>
|
||||||
</General>
|
</General>
|
||||||
<VersionInfo>
|
<VersionInfo>
|
||||||
<ProjectVersion Value=""/>
|
<ProjectVersion Value=""/>
|
||||||
@ -50,8 +50,8 @@
|
|||||||
<Filename Value="testsvnclasses.pas"/>
|
<Filename Value="testsvnclasses.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="TestSvnClasses"/>
|
<UnitName Value="TestSvnClasses"/>
|
||||||
<CursorPos X="83" Y="36"/>
|
<CursorPos X="63" Y="60"/>
|
||||||
<TopLine Value="17"/>
|
<TopLine Value="28"/>
|
||||||
<EditorIndex Value="0"/>
|
<EditorIndex Value="0"/>
|
||||||
<UsageCount Value="20"/>
|
<UsageCount Value="20"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
@ -60,7 +60,7 @@
|
|||||||
<Filename Value="..\..\..\..\lazarus\components\fpcunit\guitestrunner.pas"/>
|
<Filename Value="..\..\..\..\lazarus\components\fpcunit\guitestrunner.pas"/>
|
||||||
<UnitName Value="GuiTestRunner"/>
|
<UnitName Value="GuiTestRunner"/>
|
||||||
<CursorPos X="1" Y="48"/>
|
<CursorPos X="1" Y="48"/>
|
||||||
<TopLine Value="29"/>
|
<TopLine Value="37"/>
|
||||||
<EditorIndex Value="1"/>
|
<EditorIndex Value="1"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
@ -77,15 +77,15 @@
|
|||||||
<Unit4>
|
<Unit4>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<UnitName Value="svnclasses"/>
|
<UnitName Value="svnclasses"/>
|
||||||
<CursorPos X="16" Y="173"/>
|
<CursorPos X="72" Y="201"/>
|
||||||
<TopLine Value="154"/>
|
<TopLine Value="190"/>
|
||||||
<EditorIndex Value="2"/>
|
<EditorIndex Value="2"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit4>
|
</Unit4>
|
||||||
<Unit5>
|
<Unit5>
|
||||||
<Filename Value="info.xml"/>
|
<Filename Value="info.xml"/>
|
||||||
<CursorPos X="64" Y="4"/>
|
<CursorPos X="78" Y="9"/>
|
||||||
<TopLine Value="1"/>
|
<TopLine Value="1"/>
|
||||||
<EditorIndex Value="3"/>
|
<EditorIndex Value="3"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
@ -143,123 +143,123 @@
|
|||||||
<JumpHistory Count="30" HistoryIndex="29">
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="80" Column="3" TopLine="58"/>
|
<Caret Line="130" Column="13" TopLine="111"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\..\..\..\fpc\2.1\fcl\xml\dom.pp"/>
|
||||||
<Caret Line="82" Column="21" TopLine="46"/>
|
<Caret Line="217" Column="40" TopLine="198"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="43" Column="3" TopLine="41"/>
|
<Caret Line="134" Column="30" TopLine="111"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="124" Column="42" TopLine="106"/>
|
<Caret Line="131" Column="48" TopLine="112"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="..\..\..\..\fpc\2.1\fcl\xml\dom.pp"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="224" Column="37" TopLine="189"/>
|
<Caret Line="130" Column="1" TopLine="112"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="..\..\..\..\fpc\2.1\fcl\xml\dom.pp"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="94" Column="15" TopLine="75"/>
|
<Caret Line="83" Column="46" TopLine="72"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\..\..\..\fpcbuild\2.0.4\fpcsrc\packages\extra\gtk2\gtk+\gtk\gtksocket.inc"/>
|
||||||
<Caret Line="124" Column="30" TopLine="102"/>
|
<Caret Line="1" Column="1" TopLine="1"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\..\..\..\lazarus\lcl\interfaces\gtk2\gtk2extrah.inc"/>
|
||||||
<Caret Line="130" Column="13" TopLine="111"/>
|
<Caret Line="1" Column="1" TopLine="1"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
<Position9>
|
<Position9>
|
||||||
<Filename Value="..\..\..\..\fpc\2.1\fcl\xml\dom.pp"/>
|
<Filename Value="..\..\..\..\fpcbuild\2.0.4\fpcsrc\packages\extra\gtk2\gtk+\gdk\gdkdrawable.inc"/>
|
||||||
<Caret Line="217" Column="40" TopLine="198"/>
|
<Caret Line="1" Column="1" TopLine="1"/>
|
||||||
</Position9>
|
</Position9>
|
||||||
<Position10>
|
<Position10>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\..\..\..\lazarus\lcl\interfaces\win32\win32winapi.inc"/>
|
||||||
<Caret Line="134" Column="30" TopLine="111"/>
|
<Caret Line="1" Column="1" TopLine="1"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
<Position11>
|
<Position11>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\..\..\..\lazarus\lcl\interfaces\win32\win32winapi.inc"/>
|
||||||
<Caret Line="131" Column="48" TopLine="112"/>
|
<Caret Line="3164" Column="33" TopLine="3145"/>
|
||||||
</Position11>
|
</Position11>
|
||||||
<Position12>
|
<Position12>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="130" Column="1" TopLine="112"/>
|
<Caret Line="89" Column="8" TopLine="72"/>
|
||||||
</Position12>
|
</Position12>
|
||||||
<Position13>
|
<Position13>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\..\..\..\lazarus\components\fpcunit\guitestrunner.pas"/>
|
||||||
<Caret Line="83" Column="46" TopLine="72"/>
|
<Caret Line="45" Column="36" TopLine="26"/>
|
||||||
</Position13>
|
</Position13>
|
||||||
<Position14>
|
<Position14>
|
||||||
<Filename Value="..\..\..\..\fpcbuild\2.0.4\fpcsrc\packages\extra\gtk2\gtk+\gtk\gtksocket.inc"/>
|
<Filename Value="..\..\..\..\lazarus\components\fpcunit\guitestrunner.pas"/>
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
<Caret Line="47" Column="63" TopLine="28"/>
|
||||||
</Position14>
|
</Position14>
|
||||||
<Position15>
|
<Position15>
|
||||||
<Filename Value="..\..\..\..\lazarus\lcl\interfaces\gtk2\gtk2extrah.inc"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
<Caret Line="55" Column="22" TopLine="36"/>
|
||||||
</Position15>
|
</Position15>
|
||||||
<Position16>
|
<Position16>
|
||||||
<Filename Value="..\..\..\..\fpcbuild\2.0.4\fpcsrc\packages\extra\gtk2\gtk+\gdk\gdkdrawable.inc"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
<Caret Line="103" Column="5" TopLine="60"/>
|
||||||
</Position16>
|
</Position16>
|
||||||
<Position17>
|
<Position17>
|
||||||
<Filename Value="..\..\..\..\lazarus\lcl\interfaces\win32\win32winapi.inc"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
<Caret Line="33" Column="3" TopLine="31"/>
|
||||||
</Position17>
|
</Position17>
|
||||||
<Position18>
|
<Position18>
|
||||||
<Filename Value="..\..\..\..\lazarus\lcl\interfaces\win32\win32winapi.inc"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="3164" Column="33" TopLine="3145"/>
|
<Caret Line="17" Column="3" TopLine="15"/>
|
||||||
</Position18>
|
</Position18>
|
||||||
<Position19>
|
<Position19>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="89" Column="8" TopLine="72"/>
|
<Caret Line="185" Column="17" TopLine="25"/>
|
||||||
</Position19>
|
</Position19>
|
||||||
<Position20>
|
<Position20>
|
||||||
<Filename Value="..\..\..\..\lazarus\components\fpcunit\guitestrunner.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="45" Column="36" TopLine="26"/>
|
<Caret Line="174" Column="5" TopLine="131"/>
|
||||||
</Position20>
|
</Position20>
|
||||||
<Position21>
|
<Position21>
|
||||||
<Filename Value="..\..\..\..\lazarus\components\fpcunit\guitestrunner.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="47" Column="63" TopLine="28"/>
|
<Caret Line="182" Column="29" TopLine="156"/>
|
||||||
</Position21>
|
</Position21>
|
||||||
<Position22>
|
<Position22>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="55" Column="22" TopLine="36"/>
|
<Caret Line="60" Column="21" TopLine="36"/>
|
||||||
</Position22>
|
</Position22>
|
||||||
<Position23>
|
<Position23>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="103" Column="5" TopLine="60"/>
|
<Caret Line="173" Column="11" TopLine="154"/>
|
||||||
</Position23>
|
</Position23>
|
||||||
<Position24>
|
<Position24>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="33" Column="3" TopLine="31"/>
|
<Caret Line="188" Column="1" TopLine="145"/>
|
||||||
</Position24>
|
</Position24>
|
||||||
<Position25>
|
<Position25>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="17" Column="3" TopLine="15"/>
|
<Caret Line="194" Column="5" TopLine="162"/>
|
||||||
</Position25>
|
</Position25>
|
||||||
<Position26>
|
<Position26>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="185" Column="17" TopLine="25"/>
|
<Caret Line="33" Column="7" TopLine="14"/>
|
||||||
</Position26>
|
</Position26>
|
||||||
<Position27>
|
<Position27>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="174" Column="5" TopLine="131"/>
|
<Caret Line="38" Column="15" TopLine="33"/>
|
||||||
</Position27>
|
</Position27>
|
||||||
<Position28>
|
<Position28>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="182" Column="29" TopLine="156"/>
|
<Caret Line="187" Column="23" TopLine="170"/>
|
||||||
</Position28>
|
</Position28>
|
||||||
<Position29>
|
<Position29>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="60" Column="21" TopLine="36"/>
|
<Caret Line="218" Column="1" TopLine="175"/>
|
||||||
</Position29>
|
</Position29>
|
||||||
<Position30>
|
<Position30>
|
||||||
<Filename Value="..\svnclasses.pas"/>
|
<Filename Value="..\svnclasses.pas"/>
|
||||||
<Caret Line="173" Column="11" TopLine="154"/>
|
<Caret Line="216" Column="10" TopLine="192"/>
|
||||||
</Position30>
|
</Position30>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<wc-info>
|
<wc-info>
|
||||||
<schedule>normal</schedule>
|
<schedule>normal</schedule>
|
||||||
</wc-info>
|
</wc-info>
|
||||||
<commit revision="10685">
|
<commit revision="10680">
|
||||||
<author>jesus</author>
|
<author>jesus</author>
|
||||||
<date>2007-02-25T22:55:08.029980Z</date>
|
<date>2007-02-25T22:55:08.029980Z</date>
|
||||||
</commit>
|
</commit>
|
||||||
|
@ -48,6 +48,16 @@ begin
|
|||||||
AssertEquals('Wrong URL',
|
AssertEquals('Wrong URL',
|
||||||
'svn+ssh://www.freepascal.org/FPC/svn/lazarus/trunk',
|
'svn+ssh://www.freepascal.org/FPC/svn/lazarus/trunk',
|
||||||
SvnInfo.Entry.URL);
|
SvnInfo.Entry.URL);
|
||||||
|
AssertEquals('Wrong repository root',
|
||||||
|
'svn+ssh://www.freepascal.org/FPC/svn/lazarus',
|
||||||
|
SvnInfo.Entry.Repository.Root);
|
||||||
|
AssertEquals('Wrong repository UUID',
|
||||||
|
'4005530d-fff6-0310-9dd1-cebe43e6787f',
|
||||||
|
SvnInfo.Entry.Repository.UUID);
|
||||||
|
AssertEquals('Wrong commit revision', 10680, SvnInfo.Entry.Commit.Revision);
|
||||||
|
AssertEquals('Wrong commit author', 'jesus', SvnInfo.Entry.Commit.Author);
|
||||||
|
AssertEquals('Wrong commit date',
|
||||||
|
'2007-02-25T22:55:08.029980Z', SvnInfo.Entry.Commit.Date);
|
||||||
finally
|
finally
|
||||||
SvnInfo.Free;
|
SvnInfo.Free;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user