Ignore:
Timestamp:
May 19, 2015, 11:33:02 PM (10 years ago)
Author:
chronos
Message:
  • Added: Log form to show history of object. Implemented for Subversion partialy.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Backends/Subversion/USubversion.pas

    r10 r11  
    3131    procedure Merge; override;
    3232    procedure Add(FileName: string); override;
     33    procedure GetLog(FileName: string; Log: TLogList); override;
    3334  end;
    3435
     
    9192end;
    9293
     94procedure TSubversion.GetLog(FileName: string; Log: TLogList);
     95var
     96  NewItem: TLogItem;
     97  I: Integer;
     98  Line: string;
     99  ChangedFiles: Boolean;
     100  Action: string;
     101begin
     102  NewItem := nil;
     103  Log.Clear;
     104  Execute(['log', FileName, '-v']);
     105  for I := 0 to ExecutionOutput.Count - 1 do begin
     106    Line := Trim(ExecutionOutput[I]);
     107    if Line = '------------------------------------------------------------------------' then begin
     108      if Assigned(NewItem) then Log.Add(NewItem);
     109      NewItem := TLogItem.Create;
     110    end else
     111    if Pos('|', Line) > 0 then begin
     112      NewItem.Revision := Trim(GetNext(Line, '|'));
     113      NewItem.Author := Trim(GetNext(Line, '|'));
     114      GetNext(Line, '|');
     115      //NewItem.Time := StrToDateTime(Trim(GetNext(Line, '|')));
     116    end else
     117    if Line = 'Changed paths:' then begin
     118      ChangedFiles := True;
     119    end else
     120    if ChangedFiles then begin
     121      if (Line <> '') and (Copy(ExecutionOutput[I], 1, 3) = '   ') then begin
     122        Action := GetNext(Line, ' ');
     123        NewItem.Actions := NewItem.Actions + Action;
     124        NewItem.ChangedFiles.Add(Line);
     125      end else
     126      if Line = '' then begin
     127        ChangedFiles := False;
     128      end;
     129    end else
     130      NewItem.Messages.Add(Line);
     131  end;
     132  if Assigned(NewItem) then Log.Add(NewItem);
     133end;
     134
    93135end.
    94136
Note: See TracChangeset for help on using the changeset viewer.