Changeset 15 for trunk/Backends
- Timestamp:
- Jul 13, 2015, 11:44:23 AM (9 years ago)
- Location:
- trunk/Backends
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Backends/CVS/UCVS.pas
r13 r15 32 32 procedure Add(FileName: string); override; 33 33 procedure Remove(FileName: string); override; 34 procedure GetStatus(FileName: string; Status: TFileStatusList); override; 34 35 end; 35 36 … … 125 126 end; 126 127 128 procedure TCVS.GetStatus(FileName: string; Status: TFileStatusList); 129 begin 130 Status.Clear; 131 Execute(['status']); 132 133 end; 134 127 135 end. 128 136 -
trunk/Backends/Subversion/USubversion.pas
r14 r15 6 6 7 7 uses 8 Classes, SysUtils, UVCS, UBackend ;8 Classes, SysUtils, UVCS, UBackend, XMLRead, DOM, UXMLUtils; 9 9 10 10 type … … 33 33 procedure Remove(FileName: string); override; 34 34 procedure GetLog(FileName: string; Log: TLogList); override; 35 procedure GetStatus(FileName: string; Status: TFileStatusList); override; 35 36 end; 36 37 … … 172 173 end; 173 174 175 procedure TSubversion.GetStatus(FileName: string; Status: TFileStatusList); 176 var 177 Doc: TXMLDocument; 178 S: TStringStream; 179 Node: TDOMNode; 180 Node2: TDOMNode; 181 RootNode: TDOMNode; 182 TargetNode: TDOMNode; 183 StatusNode: TDOMNode; 184 StatusItem: TFileStatus; 185 CommitNode: TDOMNode; 186 ItemState: string; 187 begin 188 Status.Clear; 189 Execute(['status', '--xml', '-v']); 190 S := TStringStream.Create(ExecutionOutput.Text); 191 try 192 // Read complete XML document 193 ReadXMLFile(Doc, S); 194 RootNode := Doc.DocumentElement; 195 if RootNode.NodeName = 'status' then begin 196 TargetNode := RootNode.FindNode('target'); 197 if Assigned(TargetNode) then begin 198 Node := TargetNode.FirstChild; 199 while Assigned(Node) do begin 200 if Node.NodeName = 'entry' then begin 201 StatusItem := TFileStatus.Create; 202 StatusItem.FileName := TDOMElement(Node).GetAttribute('path'); 203 StatusNode := Node.FindNode('wc-status'); 204 if Assigned(StatusNode) then begin 205 ItemState := TDOMElement(StatusNode).GetAttribute('item'); 206 if ItemState = 'normal' then StatusItem.State := fssNotModified; 207 if ItemState = 'modified' then StatusItem.State := fssModified; 208 if ItemState = 'deleted' then StatusItem.State := fssRemoved; 209 if ItemState = 'added' then StatusItem.State := fssAdded; 210 211 CommitNode := StatusNode.FindNode('commit'); 212 if Assigned(CommitNode) then begin 213 StatusItem.Version := TDOMElement(CommitNode).GetAttribute('revision'); 214 StatusItem.Author := ReadString(CommitNode, 'author', ''); 215 StatusItem.Time := ReadDateTime(CommitNode, 'date', 0); 216 end; 217 end; 218 Status.Add(StatusItem); 219 end; 220 Node := Node.NextSibling; 221 end; 222 end; 223 end; 224 finally 225 Doc.Free; 226 S.Free; 227 end; 228 end; 229 174 230 end. 175 231
Note:
See TracChangeset
for help on using the changeset viewer.