259
263
Result := EncodeDate(y,m,d) + EncodeTime(h,n,s,0);
262
function SortPathAscending(Item1, Item2: Pointer): Integer;
266
function SortPathAscending(const Item1, Item2: TSVNStatusItem): Integer;
264
Result := CompareText(PSVNStatusItem(Item1)^.Path, PSVNStatusItem(Item2)^.Path);
268
Result := CompareText(Item1.Path, Item2.Path);
267
function SortPathDescending(Item1, Item2: Pointer): Integer;
271
function SortPathDescending(const Item1, Item2: TSVNStatusItem): Integer;
269
273
Result := -SortPathAscending(Item1, Item2);
272
function SortSelectedAscending(Item1, Item2: Pointer): Integer;
276
function SortSelectedAscending(const Item1, Item2: TSVNStatusItem): Integer;
274
if PSVNStatusItem(Item1)^.Checked > PSVNStatusItem(Item2)^.Checked then
278
if Item1.Checked > Item2.Checked then
277
if PSVNStatusItem(Item1)^.Checked = PSVNStatusItem(Item2)^.Checked then
281
if Item1.Checked = Item2.Checked then
278
282
Result := SortPathDescending(Item1, Item2)
283
function SortSelectedDescending(Item1, Item2: Pointer): Integer;
287
function SortSelectedDescending(const Item1, Item2: TSVNStatusItem): Integer;
285
289
Result := -SortSelectedAscending(Item1, Item2);
288
function SortExtensionAscending(Item1, Item2: Pointer): Integer;
292
function SortExtensionAscending(const Item1, Item2: TSVNStatusItem): Integer;
290
Result := CompareText(PSVNStatusItem(Item1)^.Extension, PSVNStatusItem(Item2)^.Extension);
294
Result := CompareText(Item1.Extension, Item2.Extension);
293
function SortExtensionDescending(Item1, Item2: Pointer): Integer;
297
function SortExtensionDescending(const Item1, Item2: TSVNStatusItem): Integer;
295
299
Result := -SortExtensionAscending(Item1, Item2);
298
function SortItemStatusAscending(Item1, Item2: Pointer): Integer;
302
function SortItemStatusAscending(const Item1, Item2: TSVNStatusItem): Integer;
300
Result := CompareText(PSVNStatusItem(Item1)^.ItemStatus, PSVNStatusItem(Item2)^.ItemStatus);
304
Result := CompareText(Item1.ItemStatus, Item2.ItemStatus);
303
function SortItemStatusDescending(Item1, Item2: Pointer): Integer;
307
function SortItemStatusDescending(const Item1, Item2: TSVNStatusItem): Integer;
305
309
Result := -SortItemStatusAscending(Item1, Item2);
308
function SortPropStatusAscending(Item1, Item2: Pointer): Integer;
312
function SortPropStatusAscending(const Item1, Item2: TSVNStatusItem): Integer;
310
Result := CompareText(PSVNStatusItem(Item1)^.PropStatus, PSVNStatusItem(Item2)^.PropStatus);
314
Result := CompareText(Item1.PropStatus, Item2.PropStatus);
313
function SortPropStatusDescending(Item1, Item2: Pointer): Integer;
317
function SortPropStatusDescending(const Item1, Item2: TSVNStatusItem): Integer;
315
319
Result := -SortPropStatusAscending(Item1, Item2);
318
function SortPropertyAuthorAscending(Item1, Item2: Pointer): Integer;
322
function SortPropertyAuthorAscending(const Item1, Item2: TSVNStatusItem): Integer;
320
Result := CompareText(PSVNStatusItem(Item1)^.Author, PSVNStatusItem(Item2)^.Author);
324
Result := CompareText(Item1.Author, Item2.Author);
323
function SortPropertyAuthorDescending(Item1, Item2: Pointer): Integer;
327
function SortPropertyAuthorDescending(const Item1, Item2: TSVNStatusItem): Integer;
325
329
Result := -SortPropertyAuthorAscending(Item1, Item2);
328
function SortPropertyRevisionAscending(Item1, Item2: Pointer): Integer;
332
function SortPropertyRevisionAscending(const Item1, Item2: TSVNStatusItem): Integer;
330
if PSVNStatusItem(Item1)^.Revision > PSVNStatusItem(Item2)^.Revision then
334
if Item1.Revision > Item2.Revision then
333
if PSVNStatusItem(Item1)^.Revision = PSVNStatusItem(Item2)^.Revision then
337
if Item1.Revision = Item2.Revision then
339
function SortPropertyRevisionDescending(Item1, Item2: Pointer): Integer;
343
function SortPropertyRevisionDescending(const Item1, Item2: TSVNStatusItem): Integer;
341
345
Result := -SortPropertyRevisionAscending(Item1, Item2);
344
function SortPropertyCommitRevisionAscending(Item1, Item2: Pointer): Integer;
348
function SortPropertyCommitRevisionAscending(const Item1, Item2: TSVNStatusItem): Integer;
346
if PSVNStatusItem(Item1)^.CommitRevision > PSVNStatusItem(Item2)^.CommitRevision then
350
if Item1.CommitRevision > Item2.CommitRevision then
349
if PSVNStatusItem(Item1)^.CommitRevision = PSVNStatusItem(Item2)^.CommitRevision then
353
if Item1.CommitRevision = Item2.CommitRevision then
355
function SortPropertyCommitRevisionDescending(Item1, Item2: Pointer): Integer;
359
function SortPropertyCommitRevisionDescending(const Item1, Item2: TSVNStatusItem): Integer;
357
361
Result := -SortPropertyCommitRevisionAscending(Item1, Item2);
360
function SortPropertyDateAscending(Item1, Item2: Pointer): Integer;
364
function SortPropertyDateAscending(const Item1, Item2: TSVNStatusItem): Integer;
362
if PSVNStatusItem(Item1)^.Date > PSVNStatusItem(Item2)^.Date then
366
if Item1.Date > Item2.Date then
365
if PSVNStatusItem(Item1)^.Date = PSVNStatusItem(Item2)^.Date then
369
if Item1.Date = Item2.Date then
371
function SortPropertyDateDescending(Item1, Item2: Pointer): Integer;
375
function SortPropertyDateDescending(const Item1, Item2: TSVNStatusItem): Integer;
373
377
Result := -SortPropertyDateAscending(Item1, Item2);
464
465
Path := SubNode.Attributes.Item[0].NodeValue;
465
466
debugln('TSVNStatus.Create ' + Path);
467
467
F:=FileGetAttr(Path);
469
If (F and faDirectory)=0 then
471
//initialize author (anonymous repositories)
472
ListItem^.Author := rsNoAuthor;
475
ListItem^.Path := Path;
478
ListItem^.Extension:=ExtractFileExt(Path);
480
//get the wc-status attributes
481
ListItem^.ItemStatus:='';
482
ListItem^.Checked:=False;
483
ListItem^.PropStatus:='';
484
for i := 0 to SubNode.ChildNodes.Item[0].Attributes.Length -1 do
486
NodeName := SubNode.ChildNodes.Item[0].Attributes.Item[i].NodeName;
487
NodeValue := SubNode.ChildNodes.Item[0].Attributes.Item[i].NodeValue;
489
if NodeName = 'item' then
492
ListItem^.ItemStatus := LowerCase(NodeValue);
495
ListItem^.Checked:=(NodeValue<>'unversioned') and (NodeValue<>'normal');
498
if NodeName = 'props' then
500
ListItem^.PropStatus := NodeValue;
502
if NodeName = 'revision' then
504
ListItem^.Revision := StrToInt(NodeValue);
507
//get the commit attributes
508
SubNode := SubNode.ChildNodes.Item[0].ChildNodes.Item[0];
509
if Assigned(SubNode) then
512
ListItem^.CommitRevision:=StrToInt(SubNode.Attributes.Item[0].NodeValue);
514
for i := 0 to SubNode.ChildNodes.Count - 1 do
516
ActNode := SubNode.ChildNodes.Item[i];
518
if Assigned(ActNode) then
520
NodeName := ActNode.NodeName;
523
if NodeName = 'author' then
524
ListItem^.Author := ActNode.FirstChild.NodeValue;
527
if NodeName = 'date' then
528
ListItem^.Date := ISO8601ToDateTime(ActNode.FirstChild.NodeValue);
468
If (F<>-1) and ((F and faDirectory)=0) then
470
ListItem := TSVNStatusItem.Create;
471
//initialize author (anonymous repositories)
472
ListItem.Author := rsNoAuthor;
474
ListItem.Path := Path;
476
ListItem.Extension:=ExtractFileExt(Path);
477
//get the wc-status attributes
478
ListItem.ItemStatus:='';
479
ListItem.Checked:=False;
480
ListItem.PropStatus:='';
481
for i := 0 to SubNode.ChildNodes.Item[0].Attributes.Length -1 do
483
NodeName := SubNode.ChildNodes.Item[0].Attributes.Item[i].NodeName;
484
NodeValue := SubNode.ChildNodes.Item[0].Attributes.Item[i].NodeValue;
485
if NodeName = 'item' then
488
ListItem.ItemStatus := LowerCase(NodeValue);
490
ListItem.Checked:=(NodeValue<>'unversioned') and (NodeValue<>'normal');
492
if NodeName = 'props' then
494
ListItem.PropStatus := NodeValue;
495
if NodeName = 'revision' then
497
ListItem.Revision := StrToInt(NodeValue);
499
//get the commit attributes
500
SubNode := SubNode.ChildNodes.Item[0].ChildNodes.Item[0];
501
if Assigned(SubNode) then
504
ListItem.CommitRevision:=StrToInt(SubNode.Attributes.Item[0].NodeValue);
505
for i := 0 to SubNode.ChildNodes.Count - 1 do
507
ActNode := SubNode.ChildNodes.Item[i];
508
if Assigned(ActNode) then
510
NodeName := ActNode.NodeName;
512
if NodeName = 'author' then
513
ListItem.Author := ActNode.FirstChild.NodeValue;
515
if NodeName = 'date' then
516
ListItem.Date := ISO8601ToDateTime(ActNode.FirstChild.NodeValue);
536
522
Node := Node.NextSibling;
537
523
until not Assigned(Node);