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